polyglot icon indicating copy to clipboard operation
polyglot copied to clipboard

Persian sentiment analysis problems.

Open prp-e opened this issue 5 years ago • 1 comments

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.

prp-e avatar Oct 27 '19 09:10 prp-e

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

Hsgngr avatar Mar 01 '21 21:03 Hsgngr