Description
This is a scalable, production-ready Stopwords Remover model trained using the corpus available at stopwords-iso.
How to use
documentAssembler = DocumentAssembler() \
.setInputCol("text") \
.setOutputCol("document")
tokenizer = Tokenizer() \
.setInputCols(["document"]) \
.setOutputCol("token")
stop_words = StopWordsCleaner.pretrained("stopwords_iso","sa") \
.setInputCols(["token"]) \
.setOutputCol("cleanTokens")
pipeline = Pipeline(stages=[documentAssembler, tokenizer, stop_words])
example = spark.createDataFrame([["यावद्द्रॄष्टिभ्रुवोर्मध्ये तावत्कालभयं कुत: ॥"]], ["text"])
results = pipeline.fit(example).transform(example)
Results
+----------------------------------------------------+
|result |
+----------------------------------------------------+
|[यावद्द्रॄष्टिभ्रुवोर्मध्ये, तावत्कालभयं, कुत, :, ॥]|
+----------------------------------------------------+
Model Information
Model Name: | stopwords_iso |
Compatibility: | Spark NLP 3.4.1+ |
License: | Open Source |
Edition: | Official |
Input Labels: | [token] |
Output Labels: | [cleanTokens] |
Language: | sa |
Size: | 2.9 KB |