Class AnnotateText

java.lang.Object
org.apache.beam.sdk.transforms.PTransform<PCollection<com.google.cloud.language.v1.Document>,PCollection<com.google.cloud.language.v1.AnnotateTextResponse>>
org.apache.beam.sdk.extensions.ml.AnnotateText
All Implemented Interfaces:
Serializable, HasDisplayData

public abstract class AnnotateText extends PTransform<PCollection<com.google.cloud.language.v1.Document>,PCollection<com.google.cloud.language.v1.AnnotateTextResponse>>
A PTransform using the Cloud AI Natural language processing capability. Takes an input PCollection of Documents and converts them to AnnotateTextResponses.

It is possible to provide a language hint to the API. A AnnotateTextRequest.Features object is required to configure analysis types to be done on the data.

See Also:
  • Constructor Details

    • AnnotateText

      public AnnotateText()
  • Method Details

    • languageHint

      public abstract @Nullable String languageHint()
    • features

      public abstract com.google.cloud.language.v1.AnnotateTextRequest.Features features()
    • newBuilder

      public static AnnotateText.Builder newBuilder()
    • expand

      public PCollection<com.google.cloud.language.v1.AnnotateTextResponse> expand(PCollection<com.google.cloud.language.v1.Document> input)
      Description copied from class: PTransform
      Override this method to specify how this PTransform should be expanded on the given InputT.

      NOTE: This method should not be called directly. Instead apply the PTransform should be applied to the InputT using the apply method.

      Composite transforms, which are defined in terms of other transforms, should return the output of one of the composed transforms. Non-composite transforms, which do not apply any transforms internally, should return a new unbound output and register evaluators (via backend-specific registration methods).

      Specified by:
      expand in class PTransform<PCollection<com.google.cloud.language.v1.Document>,PCollection<com.google.cloud.language.v1.AnnotateTextResponse>>