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 Document
s and converts them to AnnotateTextResponse
s.
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:
-
Nested Class Summary
Nested Classes -
Field Summary
Fields inherited from class org.apache.beam.sdk.transforms.PTransform
annotations, displayData, name, resourceHints
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionPCollection
<com.google.cloud.language.v1.AnnotateTextResponse> expand
(PCollection<com.google.cloud.language.v1.Document> input) Override this method to specify how thisPTransform
should be expanded on the givenInputT
.abstract com.google.cloud.language.v1.AnnotateTextRequest.Features
features()
static AnnotateText.Builder
Methods inherited from class org.apache.beam.sdk.transforms.PTransform
addAnnotation, compose, compose, getAdditionalInputs, getAnnotations, getDefaultOutputCoder, getDefaultOutputCoder, getDefaultOutputCoder, getKindString, getName, getResourceHints, populateDisplayData, setDisplayData, setResourceHints, toString, validate, validate
-
Constructor Details
-
AnnotateText
public AnnotateText()
-
-
Method Details
-
languageHint
-
features
public abstract com.google.cloud.language.v1.AnnotateTextRequest.Features features() -
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 thisPTransform
should be expanded on the givenInputT
.NOTE: This method should not be called directly. Instead apply the
PTransform
should be applied to theInputT
using theapply
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 classPTransform<PCollection<com.google.cloud.language.v1.Document>,
PCollection<com.google.cloud.language.v1.AnnotateTextResponse>>
-