Class TextFieldProcessor

All Implemented Interfaces:,<>, FieldProcessor

public class TextFieldProcessor extends Object implements FieldProcessor
A FieldProcessor which takes a text field and runs a TextPipeline on it to generate features.
  • Constructor Details

    • TextFieldProcessor

      public TextFieldProcessor(String fieldName, TextPipeline pipeline)
      Constructs a field processor which uses the supplied text pipeline to process the field value.
      fieldName - The field name to read.
      pipeline - The text processing pipeline to use.
  • Method Details

    • getFieldName

      public String getFieldName()
      Description copied from interface: FieldProcessor
      Gets the field name this FieldProcessor uses.
      Specified by:
      getFieldName in interface FieldProcessor
      The field name.
    • process

      public List<ColumnarFeature> process(String value)
      Description copied from interface: FieldProcessor
      Processes the field value and generates a (possibly empty) list of ColumnarFeatures.
      Specified by:
      process in interface FieldProcessor
      value - The field value to process.
      A list of ColumnarFeatures.
    • getFeatureType

      public FieldProcessor.GeneratedFeatureType getFeatureType()
      Description copied from interface: FieldProcessor
      Returns the feature type this FieldProcessor generates.
      Specified by:
      getFeatureType in interface FieldProcessor
      The feature type.
    • copy

      public TextFieldProcessor copy(String newFieldName)
      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 interface FieldProcessor
      newFieldName - The new field name for the copy.
      A copy of this TextFieldProcessor with the new field name.
    • wrapFeatures

      public static List<ColumnarFeature> wrapFeatures(String fieldName, List<Feature> inputFeatures)
      Convert the Features from a text pipeline into ColumnarFeatures with the right field name.
      fieldName - The field name to prepend.
      inputFeatures - The features to convert.
      A list of columnar features.
    • toString

      public String toString()
      toString in class Object
    • getProvenance

      public getProvenance()
      Specified by:
      getProvenance in interface<>