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
exiton 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 | | | | | | | | | .....................................................
Metadata
Release files for persian-sa 0.2.5
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| persian_sa-0.2.5-py3-none-any.whl | Python 3 | none | any | Details for persian_sa-0.2.5-py3-none-any.whl |
Release files / persian_sa-0.2.5-py3-none-any.whl
| Download URL | persian_sa-0.2.5-py3-none-any.whl |
|---|---|
| Size | 260.3 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
86e81b15512f54718ce79a9a353e4f75cec16cb173eeb428441376342b3c905d
|
|
BLAKE2b-256 checksum How to use checksums |
5facac3890f5ab0ec9ceff0df85bf6f84e37a9720bb4f02dbcbb210d2c437b75
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is 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
|
Security for persian-sa 0.2.5
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.