[docs]defget_chunk_by_field_name(doc,field_name):""" Gets a specific chunk by field name, using its position instead of getting the attribute directly. This solves the getattr problem when there are conflicting attributes with Document. :param doc: Document to get the chunk from. :param field_name: Field needed to extract the position. :return: Specific chunk by field. """try:field_position=int(doc._metadata['multi_modal_schema'][field_name]['position'])returndoc.chunks[field_position]exceptExceptionase:raisee
You can ask questions about our docs. Try:
What is Jina NOW?
How to install NOW?
What apps are supported?
Hi there 👋
Ask our docs!😵💫 I'm sorry but I don't know the answer.