Assign Doc Properties¶
- class sycamore.transforms.assign_doc_properties.AssignDocProperties(child: Node, parameters: List[str], **resource_args)[source]¶
Bases:
SingleThreadUser
,NonGPUUser
,Map
The AssignDocProperties transform is used to copy properties from first element of a specific type to the parent document. This allows for the consolidation of key attributes at the document level.
- Parameters:
child -- The source node or component that provides the dataset for assigning properties from element.
resource_args -- Additional resource-related arguments passed to the operation for property assignment.
Example
source_node = ... # Define a source node or component that provides hierarchical documents. property_transform = AssignDocProperties(child=source_node, list=["table", "llm_response"]) property_dataset = property_transform.execute()