Skip to main content

Python Machine Learning based API to predict sentiment for Persian text.

Project description

Persian Sentiment Analysis

A trained model to predict sentiment class of a given Persian text.

Installation

pip3 install persian_sa

Read More:

To find about preprocessing and feature engineering, and how the model predicts visit arXiv.

Usage:

Running the source code

  • To run the program, use python3 persian_sa.py
  • Next you will be prompted to give a Persian text as input.
  • To exit the program write exit on terminal.
MOHAMMADs:persian_sa mohammadkasra$ python3 persian_sa.py 


This app uses ML to predict setntiment (e.g., Positive or Negative)
of a given Persian text. Toexit  the app write  'exit' in terminal.


Input: زیاد در خاطرات دیگران ورود نکنید، چرا که در خاطرات هر شخص رازهایی وجود دارد که حتی می ترسد آن ها را برای خودش آشکار کند!
... Negative!


Input: زندگی همچون یک آینه است زمانی که در آن لبخند بزنیم شگفت انگیزترین نتایج را به دست خواهیم آورد
... Positive!


Input: exit
...  exit: 0
MOHAMMADs:persian_sa mohammadkasra$ 

Running with after Pip install

>>> from persian_sa.persian_sa import persian_sa
>>> 
>>> persian_sa.predict_sentiment('می تواند به همین دلیل از آن متنفر باشد')
'Negative!'
>>> # Or you can predict the class number; if you set "return_class_label = True"
>>> persian_sa.predict_sentiment('می تواند به همین دلیل از آن متنفر باشد', return_class_label = True)
0
>>> persian_sa.predict_sentiment('اجرای آنها شادی مطلق است')
'Positive!'
>>> persian_sa.predict_sentiment('اجرای آنها شادی مطلق است', return_class_label = True)
1
>>>

CHANGE LOG:

++++++++++++++++++++++CHANGE LOG+++++++++++++++++++++ +++++++++++++++++++++++++++++++++++++++++++++++++++++

..... Version 0.2.3 --> 26.01.2021 --> 1st Release | | | | | | | | | .....................................................

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

persian_sa-0.2.5-py3-none-any.whl (260.3 kB view details)

Uploaded Python 3

File details

Details for the file persian_sa-0.2.5-py3-none-any.whl.

File metadata

  • Download URL: persian_sa-0.2.5-py3-none-any.whl
  • Upload date:
  • Size: 260.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.3.0 pkginfo/1.7.0 requests/2.23.0 setuptools/47.1.1 requests-toolbelt/0.9.1 tqdm/4.56.0 CPython/3.7.0

File hashes

Hashes for persian_sa-0.2.5-py3-none-any.whl
Algorithm Hash digest
SHA256 86e81b15512f54718ce79a9a353e4f75cec16cb173eeb428441376342b3c905d
MD5 6088cfd2b70b3c2c9e728e8c65e3beff
BLAKE2b-256 5facac3890f5ab0ec9ceff0df85bf6f84e37a9720bb4f02dbcbb210d2c437b75

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page