
## Persian Universal Part-of-Speech Tagging in Flair

This is the universal part-of-speech tagging model for Persian that ships with [Flair](https://github.com/flairNLP/flair/).

F1-Score: **97,73** (UD_PERSIAN)

Predicts Universal POS tags:

| **tag**                        | **meaning** |
|:---------------------------------:|:-----------:|
|ADJ |  adjective |
|   ADP |  adposition |
|   ADV |  adverb |
|   AUX |  auxiliary |
|   CCONJ |  coordinating conjunction |
|   DET |  determiner |
|   INTJ |  interjection |
|   NOUN |  noun |
|   NUM |  numeral |
|   PART |  particle |
|   PRON |  pronoun |
|   PUNCT |  punctuation |
|   SCONJ |  subordinating conjunction |
|   VERB |  verb |
|   X |  other |

---

### Demo: How to use in Flair

Requires: **[Flair](https://github.com/flairNLP/flair/)** (`pip install flair`)

```python
from flair.data import Sentence
from flair.models import SequenceTagger

# load tagger
tagger = SequenceTagger.load("hamedkhaledi/persain-flair-upos")

# make example sentence
sentence = Sentence("مقامات مصری به خاطر حفظ ثبات کشور در منطقهای پرآشوب بر خود میبالند .")

tagger.predict(sentence)
#print result
print(sentence.to_tagged_string())
```

This yields the following output:
```
مقامات <NOUN> مصری <ADJ> به <ADP> خاطر <NOUN> حفظ <NOUN> ثبات <NOUN> کشور <NOUN> در <ADP> منطقهای <NOUN> پرآشوب <ADJ> بر <ADP> خود <PRON> میبالند <VERB> . <PUNCT>
```

---

### Results
- F-score (micro) 0.9773
- F-score (macro) 0.9461
- Accuracy 0.9773

```
By class:
              precision    recall  f1-score   support

        NOUN     0.9770    0.9849    0.9809      6420
         ADP     0.9947    0.9916    0.9932      1909
         ADJ     0.9342    0.9128    0.9234      1525
       PUNCT     1.0000    1.0000    1.0000      1365
        VERB     0.9840    0.9711    0.9775      1141
       CCONJ     0.9912    0.9937    0.9925       794
         AUX     0.9622    0.9799    0.9710       546
        PRON     0.9751    0.9865    0.9808       517
       SCONJ     0.9797    0.9757    0.9777       494
         NUM     0.9948    1.0000    0.9974       385
         ADV     0.9343    0.9033    0.9185       362
         DET     0.9773    0.9711    0.9742       311
        PART     0.9916    1.0000    0.9958       237
        INTJ     0.8889    0.8000    0.8421        10
           X     0.7143    0.6250    0.6667         8

   micro avg     0.9773    0.9773    0.9773     16024
   macro avg     0.9533    0.9397    0.9461     16024
weighted avg     0.9772    0.9773    0.9772     16024
 samples avg     0.9773    0.9773    0.9773     16024

Loss: 0.12471389770507812

```
{"language": ["fa"], "tags": ["flair", "token-classification", "sequence-tagger-model"], "datasets": ["ontonotes"], "widget": [{"text": "\u0645\u0642\u0627\u0645\u0627\u062a \u0645\u0635\u0631\u06cc \u0628\u0647 \u062e\u0627\u0637\u0631 \u062d\u0641\u0638 \u062b\u0628\u0627\u062a \u06a9\u0634\u0648\u0631 \u062f\u0631 \u0645\u0646\u0637\u0642\u0647\u0627\u06cc \u067e\u0631\u0622\u0634\u0648\u0628 \u0628\u0631 \u062e\u0648\u062f \u0645\u06cc\u0628\u0627\u0644\u0646\u062f \u060c \u062f\u0631 \u062d\u0627\u0644\u06cc \u06a9\u0647 \u0627\u06cc\u0646 \u06a9\u0634\u0648\u0631 \u062f\u0631 \u0637\u0648\u0644 \u06f1\u06f6 \u0633\u0627\u0644 \u06af\u0630\u0634\u062a\u0647 \u062a\u0646\u0647\u0627 \u0647\u0634\u062a \u0633\u0627\u0644 \u0622\u0646\u0631\u0627 \u0628\u062f\u0648\u0646 \u0627\u0639\u0644\u0627\u0645 \u0648\u0636\u0639\u06cc\u062a \u0627\u0636\u0637\u0631\u0627\u0631\u06cc \u0633\u067e\u0631\u06cc \u06a9\u0631\u062f\u0647 \u0627\u0633\u062a ."}]}
flair pytorch token-classification sequence-tagger-model fa dataset:ontonotes region:us
TAGS
#flair #pytorch #token-classification #sequence-tagger-model #fa #dataset-ontonotes #region-us 

Persian Universal Part-of-Speech Tagging in Flair
-------------------------------------------------


This is the universal part-of-speech tagging model for Persian that ships with Flair.


F1-Score: 97,73 (UD\_PERSIAN)


Predicts Universal POS tags:





---


### Demo: How to use in Flair


Requires: Flair ('pip install flair')


This yields the following output:




---


### Results


* F-score (micro) 0.9773
* F-score (macro) 0.9461
* Accuracy 0.9773



### Demo: How to use in Flair


Requires: Flair ('pip install flair')


This yields the following output:




--- ### Results


* F-score (micro) 0.9773
* F-score (macro) 0.9461
* Accuracy 0.9773
TAGS
#flair #pytorch #token-classification #sequence-tagger-model #fa #dataset-ontonotes #region-us 
 ### Demo: How to use in Flair


Requires: Flair ('pip install flair')


This yields the following output:




--- ### Results


* F-score (micro) 0.9773
* F-score (macro) 0.9461
* Accuracy 0.9773
passage: TAGS
#flair #pytorch #token-classification #sequence-tagger-model #fa #dataset-ontonotes #region-us 
### Demo: How to use in Flair


Requires: Flair ('pip install flair')


This yields the following output:




---### Results


* F-score (micro) 0.9773
* F-score (macro) 0.9461
* Accuracy 0.9773