Part of Speech for Hindi


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_hdtb", "hi") \
    .setInputCols(["document", "token"]) \
nlp_pipeline = Pipeline(stages=[document_assembler, sentence_detector, tokenizer, pos])
light_pipeline = LightPipeline([['']]).toDF("text")))
results = light_pipeline.fullAnnotate("उत्तर के राजा होने के अलावा, जॉन स्नो एक अंग्रेजी चिकित्सक और संज्ञाहरण और चिकित्सा स्वच्छता के विकास में अग्रणी है।")
val pos = PerceptronModel.pretrained("pos_ud_hdtb", "hi")
    .setInputCols(Array("document", "token"))
val pipeline = new Pipeline().setStages(Array(document_assembler, sentence_detector, tokenizer, pos))
val result =["उततर     अल,   एक  ििसक और हरण और िि वचछत  ि ें अगरण ै।"].toDS.toDF("text")).transform(data)


[Row(annotatorType='pos', begin=0, end=4, result='PROPN', metadata={'word': 'उत्तर'}),
Row(annotatorType='pos', begin=6, end=7, result='ADP', metadata={'word': 'के'}),
Row(annotatorType='pos', begin=9, end=12, result='NOUN', metadata={'word': 'राजा'}),
Row(annotatorType='pos', begin=14, end=17, result='VERB', metadata={'word': 'होने'}),
Row(annotatorType='pos', begin=19, end=20, result='ADP', metadata={'word': 'के'}),

Model Information

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

Data Source

The model is imported from