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
ConstructorDescriptionTextFieldProcessor
(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.ConfiguredObjectProvenance
Processes the field value and generates a (possibly empty) list ofColumnarFeature
s.toString()
static List<ColumnarFeature>
wrapFeatures
(String fieldName, List<Feature> inputFeatures) Convert theFeature
s from a text pipeline intoColumnarFeature
s with the right field name.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
Methods inherited from interface com.oracle.labs.mlrg.olcut.config.Configurable
postConfig
Methods 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:FieldProcessor
Gets the field name this FieldProcessor uses.- Specified by:
getFieldName
in interfaceFieldProcessor
- Returns:
- The field name.
-
process
Description copied from interface:FieldProcessor
Processes the field value and generates a (possibly empty) list ofColumnarFeature
s.- Specified by:
process
in interfaceFieldProcessor
- Parameters:
value
- The field value to process.- Returns:
- A list of
ColumnarFeature
s.
-
getFeatureType
Description copied from interface:FieldProcessor
Returns the feature type this FieldProcessor generates.- Specified by:
getFeatureType
in 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:
copy
in interfaceFieldProcessor
- Parameters:
newFieldName
- The new field name for the copy.- Returns:
- A copy of this TextFieldProcessor with the new field name.
-
wrapFeatures
Convert theFeature
s from a text pipeline intoColumnarFeature
s 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
public com.oracle.labs.mlrg.olcut.provenance.ConfiguredObjectProvenance getProvenance()- Specified by:
getProvenance
in interfacecom.oracle.labs.mlrg.olcut.provenance.Provenancable<com.oracle.labs.mlrg.olcut.provenance.ConfiguredObjectProvenance>
-