# sentianalyse
A simple python library that generates sentiment type(positive,negetive,neutral) pie chart, percentage,number and ternary value for pandas dataframe text portion.
The code is Python 2 and 3 compatible.
# Installation
Fast install:
- ::
pip install sentianalyse
For a manual install get this package:
$wget https://github.com/garain/sentianalyse/archive/master.zip
$unzip master.zip
$rm master.zip
$cd sentianalyse-master
Install the package:
python setup.py install
# The library is pandas dataframe dependent.
:: Have to get dataframe(‘text columns’) and give to command. Like df[‘text’]
# Example
import sentianalyse as sa
# Features
# - sentiment type pie chart :
sa.pie()
# sentiment type amount :
# - Get the sentiment type(postive,negetive,neutral numbers)
sa.number()
# sentiment percentage :
# - Get the percentage of sentiment type
sa.percentage()
# sa.ternary_analysis
# - Get the type of all text, here -1:negetive, 0:neutral, 1:positive
sa.ternary_analysis()
import pandas as pd
df=pd.read_csv("/home/samin/anaconda3/dataset_2.csv")
percent=at.percentage(df['text'])
print(percent)
number = sa.number(df['text'])
print(number)
analysis = sa.analysis_ternary(df['text'])
print(analysis)
#sa.pie(df['text'])
# Pass list of texts as input
df=pd.DataFrame(["I love you very much."],columns=['text'])
Here is the output:
Positve : 33.31 %, Negetive 20.96 %, Neutral : 45.72 %
{'positive ': 1087, 'negetive': 684, 'neutral': 1492}
[-1, 1, 0.0, 0.0, 0.0, 0.0,.......,1]
Please cite these publications if this library comes to any use:
Ray, Biswarup, Avishek Garain, and Ram Sarkar. “An ensemble-based hotel recommender system using sentiment analysis and aspect categorization of hotel reviews.” Applied Soft Computing 98 (2021): 106935.
Garain, Avishek, and Sainik Kumar Mahata. “Sentiment Analysis at SEPLN (TASS)-2019: Sentiment Analysis at Tweet Level Using Deep Learning.” (2019).
Garain, Avishek, and Arpan Basu. “The titans at SemEval-2019 task 5: Detection of hate speech against immigrants and women in twitter.” Proceedings of the 13th International Workshop on Semantic Evaluation. 2019.
Garain, Avishek. “Humor Analysis based on Human Annotation (HAHA)-2019: Humor Analysis at Tweet Level using Deep Learning.” (2019).
Garain, Avishek, and Arpan Basu. “The titans at SemEval-2019 task 6: Offensive language identification, categorization and target identification.” Proceedings of the 13th International Workshop on Semantic Evaluation. 2019.
Metadata
Release files for sentianalyse 0.0.2
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| sentianalyse-0.0.2.tar.gz | 3.9 kB | Without provenance | Details for sentianalyse-0.0.2.tar.gz |
Release files / sentianalyse-0.0.2.tar.gz
| Download URL | sentianalyse-0.0.2.tar.gz |
|---|---|
| Size | 3.9 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
ae40aefa1624ffccd4b9429ac7057d2b56f4f3fe3b9a0220409dd27e0c21b1ee
|
|
BLAKE2b-256 checksum How to use checksums |
63df8f0acd1e4e53ba11dd9afa6491465dcba01150d20382778a2a89cc4ed232
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
Python-urllib/3.6
|
Security for sentianalyse 0.0.2
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.