rishe 0.5.0

Rishe (ریشه): High-performance Persian NLP engine in Rust — tokenization, SBD, lemmatization, ezafe detection, informal→formal normalization, stemming, spell checking, embeddings
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
"""Normalize, tokenize, lemmatize and inspect a sentence."""

from rishe import Pipeline

pipe = Pipeline()
doc = pipe("اون داره تو خونه کتاب میخونه، چیه؟")

print("normalized:", doc.normalized_text)
print("formal:    ", doc.formal_text)
print("sentences: ", doc.sentences)
print("tokens:    ", doc.tokens)
print("lemmas:    ", doc.lemmas)
print("ezafe:     ", doc.ezafe_markers)
print("stem:      ", pipe.stem("کتاب‌ها"))
print("conjugate: ", pipe.conjugate("رفت")["present"][:3])