com.johnsnowlabs.nlp.embeddings
Word Embeddings lookup annotator that maps tokens to vectors
Word Embeddings lookup annotator that maps tokens to vectors
input annotations columns currently used
Gets annotation column name going to generate
Gets annotation column name going to generate
Output annotation type : DOCUMENT, TOKEN
Output annotation type : DOCUMENT, TOKEN
columns that contain annotations necessary to run this annotator AnnotatorType is used both as input and output columns if not specified
columns that contain annotations necessary to run this annotator AnnotatorType is used both as input and output columns if not specified
Error message
Error message
Output annotation type : WORD_EMBEDDINGS
Output annotation type : WORD_EMBEDDINGS
cache size for items retrieved from storage.
cache size for items retrieved from storage. Increase for performance but higher memory consumption
Overrides required annotators column if different than default
Overrides required annotators column if different than default
Overrides annotation column name when transforming
Overrides annotation column name when transforming
Cache size for items retrieved from storage.
Cache size for items retrieved from storage. Increase for performance but higher memory consumption.
Buffer size limit before dumping to disk storage while writing.
requirement for pipeline transformation validation.
requirement for pipeline transformation validation. It is called on fit()
takes a Dataset and checks to see if all the required annotation types are present.
takes a Dataset and checks to see if all the required annotation types are present.
to be validated
True if all the required types are present, else false
buffer size limit before dumping to disk storage while writing
Required input and expected output annotator types
Word Embeddings lookup annotator that maps tokens to vectors. See https://github.com/JohnSnowLabs/spark-nlp/blob/master/src/test/scala/com/johnsnowlabs/nlp/embeddings/WordEmbeddingsTestSpec.scala for further reference on how to use this API.
There are also two convenient functions to retrieve the embeddings coverage with respect to the transformed dataset:
withCoverageColumn(dataset, embeddingsCol, outputCol): Adds a custom column with word coverage stats for the embedded field: (coveredWords, totalWords, coveragePercentage). This creates a new column with statistics for each row.
overallCoverage(dataset, embeddingsCol): Calculates overall word coverage for the whole data in the embedded field. This returns a single coverage object considering all rows in the field.