Part of Speech for Marathi

Description

This model annotates the part of speech of tokens in a text. The parts of speech annotated include PRON (pronoun), CCONJ (coordinating conjunction), and 15 others. The part of speech model is useful for extracting the grammatical structure of a piece of text automatically.

Open in Colab Download

How to use


pos = PerceptronModel.pretrained("pos_ud_ufal", "mr") \
    .setInputCols(["document", "token"]) \
    .setOutputCol("pos")
nlp_pipeline = Pipeline(stages=[document_assembler, sentence_detector, tokenizer, pos])
light_pipeline = LightPipeline(nlp_pipeline.fit(spark.createDataFrame([['']]).toDF("text")))
results = light_pipeline.fullAnnotate("उत्तरेचा राजा होण्याव्यतिरिक्त, जॉन स्नो एक इंग्रज चिकित्सक आहे आणि भूल आणि वैद्यकीय स्वच्छतेच्या विकासासाठी अग्रगण्य आहे.")

val pos = PerceptronModel.pretrained("pos_ud_ufal", "mr")
    .setInputCols(Array("document", "token"))
    .setOutputCol("pos")

Results

[Row(annotatorType='pos', begin=0, end=7, result='NOUN', metadata={'word': 'उत्तरेचा'}, embeddings=[]),
Row(annotatorType='pos', begin=9, end=12, result='NOUN', metadata={'word': 'राजा'}, embeddings=[]),
Row(annotatorType='pos', begin=14, end=29, result='NOUN', metadata={'word': 'होण्याव्यतिरिक्त'}, embeddings=[]),
Row(annotatorType='pos', begin=30, end=30, result='PUNCT', metadata={'word': ','}, embeddings=[]),
Row(annotatorType='pos', begin=32, end=34, result='NOUN', metadata={'word': 'जॉन'}, embeddings=[]),
...]

Model Information

Model Name: pos_ud_ufal
Type: pos
Compatibility: Spark NLP 2.5.5+
Edition: Official
Input labels: [token]
Output labels: [pos]
Language: mr
Case sensitive: false
License: Open Source

Data Source

The model is imported from https://universaldependencies.org