Class TextFieldProcessor
java.lang.Object
org.tribuo.data.columnar.processors.field.TextFieldProcessor
- All Implemented Interfaces:
com.oracle.labs.mlrg.olcut.config.Configurable,com.oracle.labs.mlrg.olcut.provenance.Provenancable<com.oracle.labs.mlrg.olcut.provenance.ConfiguredObjectProvenance>,FieldProcessor
A
FieldProcessor which takes a text field and runs a TextPipeline on it
to generate features.-
Nested Class Summary
Nested classes/interfaces inherited from interface org.tribuo.data.columnar.FieldProcessor
FieldProcessor.GeneratedFeatureType -
Field Summary
Fields inherited from interface org.tribuo.data.columnar.FieldProcessor
NAMESPACE -
Constructor Summary
ConstructorsConstructorDescriptionTextFieldProcessor(String fieldName, TextPipeline pipeline) Constructs a field processor which uses the supplied text pipeline to process the field value. -
Method Summary
Modifier and TypeMethodDescriptionNote: the copy shares the text pipeline with the original.Returns the feature type this FieldProcessor generates.Gets the field name this FieldProcessor uses.com.oracle.labs.mlrg.olcut.provenance.ConfiguredObjectProvenanceProcesses the field value and generates a (possibly empty) list ofColumnarFeatures.toString()static List<ColumnarFeature> wrapFeatures(String fieldName, List<Feature> inputFeatures) Convert theFeatures from a text pipeline intoColumnarFeatures with the right field name.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface com.oracle.labs.mlrg.olcut.config.Configurable
postConfigMethods inherited from interface org.tribuo.data.columnar.FieldProcessor
getNumNamespaces
-
Constructor Details
-
TextFieldProcessor
Constructs a field processor which uses the supplied text pipeline to process the field value.- Parameters:
fieldName- The field name to read.pipeline- The text processing pipeline to use.
-
-
Method Details
-
getFieldName
Description copied from interface:FieldProcessorGets the field name this FieldProcessor uses.- Specified by:
getFieldNamein interfaceFieldProcessor- Returns:
- The field name.
-
process
Description copied from interface:FieldProcessorProcesses the field value and generates a (possibly empty) list ofColumnarFeatures.- Specified by:
processin interfaceFieldProcessor- Parameters:
value- The field value to process.- Returns:
- A list of
ColumnarFeatures.
-
getFeatureType
Description copied from interface:FieldProcessorReturns the feature type this FieldProcessor generates.- Specified by:
getFeatureTypein interfaceFieldProcessor- Returns:
- The feature type.
-
copy
Note: the copy shares the text pipeline with the original. This may induce multithreading issues if the underlying pipeline is not thread safe. Tribuo builtin pipelines are thread safe.- Specified by:
copyin interfaceFieldProcessor- Parameters:
newFieldName- The new field name for the copy.- Returns:
- A copy of this TextFieldProcessor with the new field name.
-
wrapFeatures
Convert theFeatures from a text pipeline intoColumnarFeatures with the right field name.- Parameters:
fieldName- The field name to prepend.inputFeatures- The features to convert.- Returns:
- A list of columnar features.
-
toString
-
getProvenance
- Specified by:
getProvenancein interfacecom.oracle.labs.mlrg.olcut.provenance.Provenancable<com.oracle.labs.mlrg.olcut.provenance.ConfiguredObjectProvenance>
-