aboSamoor / polyglot

Multilingual text (NLP) processing toolkit
http://polyglot-nlp.com
Other
2.31k stars 337 forks source link

Persian sentiment analysis problems. #206

Open prp-e opened 5 years ago

prp-e commented 5 years ago

Greetings.

Last night I was trying to do something with Persian language (my mother tongue), and I found polyglot supports it. So, I installed libraries and dependencies and I also downloaded needed files (using polyglot downloader). When I do something like this :

a = Text("این یک جمله فارسی است.") 
a.polarity

in python shell, it gives me the correct one. But when I do something like this (in python 2 & 3) :

farsi_text = ("این یک جمله خنثای فارسی است." 
"این فیلم، فیلم خوبی نبود." 
"اما روز، روز خوبی بود.") 

sample_text = Text(farsi_text) 
text_sentences = sample_text.sentences 

it still works fine, but when I do this (in python 3) :

text_sentences.entities

It returns an empty list. and in Python 2, it returns an array of unicodes, so I can't use positive_sentiment or negative_sentiment methods.

Could anyone get a good result from an RTL language like Persian or Arabic?

P.S : I also asked this question on r/polyglot (link) but it seems I chose the wrong place to ask my question.

Hsgngr commented 3 years ago

I have the same problem, did you find a way to solve this ?