Interface ResponseProcessor<T extends Output<T>>

All Superinterfaces:
com.oracle.labs.mlrg.olcut.config.Configurable, com.oracle.labs.mlrg.olcut.provenance.Provenancable<com.oracle.labs.mlrg.olcut.provenance.ConfiguredObjectProvenance>
All Known Implementing Classes:
BinaryResponseProcessor, EmptyResponseProcessor, FieldResponseProcessor, QuartileResponseProcessor

public interface ResponseProcessor<T extends Output<T>> extends com.oracle.labs.mlrg.olcut.config.Configurable, com.oracle.labs.mlrg.olcut.provenance.Provenancable<com.oracle.labs.mlrg.olcut.provenance.ConfiguredObjectProvenance>
An interface that will take the response field and produce an Output.
  • Method Summary

    Modifier and Type
    Method
    Description
    Deprecated.
    use getFieldNames() and support multiple values instead.
    Gets the field names this ResponseProcessor uses.
    Gets the OutputFactory this ResponseProcessor uses.
    process(String value)
    Deprecated.
    use process(List) and support multiple values instead.
    default Optional<T>
    process(List<String> values)
    Returns Optional.empty() if it failed to process out a response.This method has a default implementation for backwards compatibility with Tribuo 4.0 and 4.1.
    void
    setFieldName(String fieldName)
    Deprecated.
    Response processors should be immutable; downstream objects assume that they are Set the field name this ResponseProcessor uses.

    Methods inherited from interface com.oracle.labs.mlrg.olcut.config.Configurable

    postConfig

    Methods inherited from interface com.oracle.labs.mlrg.olcut.provenance.Provenancable

    getProvenance
  • Method Details

    • getOutputFactory

      OutputFactory<T> getOutputFactory()
      Gets the OutputFactory this ResponseProcessor uses.
      Returns:
      The output factory.
    • getFieldName

      @Deprecated String getFieldName()
      Deprecated.
      use getFieldNames() and support multiple values instead. Gets the field name this ResponseProcessor uses.
      Returns:
      The field name.
    • setFieldName

      @Deprecated void setFieldName(String fieldName)
      Deprecated.
      Response processors should be immutable; downstream objects assume that they are Set the field name this ResponseProcessor uses.
      Parameters:
      fieldName - The field name.
    • process

      @Deprecated Optional<T> process(String value)
      Deprecated.
      use process(List) and support multiple values instead. Returns Optional.empty() if it failed to process out a response.
      Parameters:
      value - The value to process.
      Returns:
      The response value if found.
    • process

      default Optional<T> process(List<String> values)
      Returns Optional.empty() if it failed to process out a response.This method has a default implementation for backwards compatibility with Tribuo 4.0 and 4.1. This method should be overridden by code which depends on newer versions of Tribuo. The default implementation will be removed when the deprecated members are removed. Unless is is overridden it will throw an IllegalArgumentException when called with multiple values.
      Parameters:
      values - The value to process.
      Returns:
      The response values if found.
    • getFieldNames

      List<String> getFieldNames()
      Gets the field names this ResponseProcessor uses.
      Returns:
      The field names.