medkit.text.postprocessing.attribute_duplicator
medkit.text.postprocessing.attribute_duplicator#
Classes:
|
Annotator to copy attributes from a source segment to its nested segments. |
- class AttributeDuplicator(attr_labels, uid=None)[source]#
Annotator to copy attributes from a source segment to its nested segments. For each attribute to be duplicated, a new attribute is created in the nested segment
Instantiate the attribute duplicator
- Parameters
attr_labels (
List
[str
]) – Labels of the attributes to copyuid (str) – Identifier of the annotator
Methods:
run
(source_segments, target_segments)Add attributes from source segments to all nested segments.
set_prov_tracer
(prov_tracer)Enable provenance tracing.
Attributes:
Contains all the operation init parameters.
- run(source_segments, target_segments)[source]#
Add attributes from source segments to all nested segments. The nested segments are chosen among the target_segments based on their spans.
- property description: medkit.core.operation_desc.OperationDescription#
Contains all the operation init parameters.
- Return type
- set_prov_tracer(prov_tracer)#
Enable provenance tracing.
- Parameters
prov_tracer (
ProvTracer
) – The provenance tracer used to trace the provenance.