All Projects → ErikGartner → sentimental

ErikGartner / sentimental

Licence: other
Sentiment analysis made easy; built on top off solid libraries.

Programming Languages

python
139335 projects - #7 most used programming language

Projects that are alternatives of or similar to sentimental

Aspect-Based-Sentiment-Analysis
No description or website provided.
Stars: ✭ 29 (+20.83%)
Mutual labels:  sentiment-analysis
Sentiment-Analysis-Play-Store-Reviews
Sentiment Analyser: Sentiment Analysis of user feedback in Play Store to improve app quality!
Stars: ✭ 22 (-8.33%)
Mutual labels:  sentiment-analysis
ML2017FALL
Machine Learning (EE 5184) in NTU
Stars: ✭ 66 (+175%)
Mutual labels:  sentiment-analysis
Stock-Prediction
LSTM RNN for sentiment-based stock prediction
Stars: ✭ 50 (+108.33%)
Mutual labels:  sentiment-analysis
billboard
🎤 Lyrics/associated NLP data for Billboard's Top 100, 1950-2015.
Stars: ✭ 53 (+120.83%)
Mutual labels:  sentiment-analysis
DeepSentiPers
Repository for the experiments described in the paper named "DeepSentiPers: Novel Deep Learning Models Trained Over Proposed Augmented Persian Sentiment Corpus"
Stars: ✭ 17 (-29.17%)
Mutual labels:  sentiment-analysis
LSX
A word embeddings-based semi-supervised model for document scaling
Stars: ✭ 42 (+75%)
Mutual labels:  sentiment-analysis
sentR
Simple sentiment analysis framework for R
Stars: ✭ 31 (+29.17%)
Mutual labels:  sentiment-analysis
kesci-urdu-sentiment-analysis
sentiment-analysis
Stars: ✭ 70 (+191.67%)
Mutual labels:  sentiment-analysis
TwEater
A Python Bot for Scraping Conversations from Twitter
Stars: ✭ 16 (-33.33%)
Mutual labels:  sentiment-analysis
FinBERT
A Pretrained BERT Model for Financial Communications. https://arxiv.org/abs/2006.08097
Stars: ✭ 193 (+704.17%)
Mutual labels:  sentiment-analysis
Persian-Sentiment-Analyzer
Persian sentiment analysis ( آناکاوی سهش های فارسی | تحلیل احساسات فارسی )
Stars: ✭ 30 (+25%)
Mutual labels:  sentiment-analysis
NRC-Persian-Lexicon
NRC Word-Emotion Association Lexicon
Stars: ✭ 30 (+25%)
Mutual labels:  sentiment-analysis
stock-news-sentiment-analysis
This program uses Vader SentimentIntensityAnalyzer to calculate the news headline overall sentiment for a stock
Stars: ✭ 21 (-12.5%)
Mutual labels:  sentiment-analysis
amazon-rekognition-engagement-meter
The Engagement Meter calculates and shows engagement levels of an audience participating in a meeting
Stars: ✭ 49 (+104.17%)
Mutual labels:  sentiment-analysis
Sentic-GCN
[KBS] Aspect-based sentiment analysis via affective knowledge enhanced graph convolutional networks
Stars: ✭ 19 (-20.83%)
Mutual labels:  sentiment-analysis
vista-net
Code for the paper "VistaNet: Visual Aspect Attention Network for Multimodal Sentiment Analysis", AAAI'19
Stars: ✭ 67 (+179.17%)
Mutual labels:  sentiment-analysis
strtsmrt
Stock price trend prediction with news sentiment analysis using deep learning
Stars: ✭ 63 (+162.5%)
Mutual labels:  sentiment-analysis
Kaggle-Twitter-Sentiment-Analysis
Kaggle Twitter Sentiment Analysis Competition
Stars: ✭ 18 (-25%)
Mutual labels:  sentiment-analysis
sentiment-thermometer
Measure the sentiment towards a word, name or sentence on social networks
Stars: ✭ 56 (+133.33%)
Mutual labels:  sentiment-analysis

Sentimental

Sentiment analysis made easy; built on top off solid libraries.

PyPI

Sentimental uses Scikit-learn to perform easy sentiment analysis. The idea is to create a simple out-of-box solution that yields acceptable results without complex configuration. Sentimental also uses a simple format for its training corpora that makes it easy to add more training data.

Sentimental labels a sentence either: positive, neutral or negative together with the probability.

Take a look at sentimental/data for the included training corpora.

Usage

Sentimental is released as a python package, just run:

pip install sentimental

Examples

Below are some simple examples that covers most functions and use cases.

Extracting example sentences from a corpus

Using lists of negative and positive words Sentimental can extract sentences containing positive, neutral and negative keywords.

from sentimental import ExampleExtractor, get_data_path

e = ExampleExtractor()
e.load_labeled_words(get_data_path() + '/sv/lexicon/positive_examples.txt', 'positive')
e.load_labeled_words(get_data_path() + '/sv/lexicon/negative_examples.txt', 'negative')
e.extract_examples(get_data_path() + '/sv/_newcorpus/corpus.txt', 'data/sv/_newcorpus')

Training a model from example sentences

Once you have a lists of positive, negative and neutral sentences you can train the Sentimental model on them to make prediction on other sentences.

from sentimental import Sentimental

sentimental = Sentimental()
sentimental.train(['path/to/a/data_folder', 'path/to/more/data'])
sentimental.sentiment('Erik is very happy about the nice weather')
>>> {'negative': 0.012843021692660004, 'positive': 0.97922132069306, 'neutral': 0.0079356576142799052}

Saving and loading a pre-trained model:

Training a model and performing cross-validation can take some time on large datasets. To save time, once a model has been trained it can be saved and later loaded.

sentimental.save('model.pickle')
sentimental2 = Sentimental.load('model.pickle')

Evaluating the predictor

There are two ways to evaluate Sentimental. The first is by looking at the cross-validation scores:

sentimental.accuracy()

The second is to perform validation on an external test set:

sentimental.validate('path/to/validation_files/positive.txt', 'positive')
sentimental.validate('path/to/validation_files/negative.txt', 'negative')
sentimental.validate('path/to/validation_files/neutral.txt', 'neutral')

Data

A sentimental analyzer is only as good as its data. Sentimental comes with some data and pre-trained models. As a bonus the format is very simple and it is easy to train the model on your own data.

For details see the readme in the data folder.

If you have good data, either lexicons of polarity words or example sentences, feel free to make a pull request.

Technical

Sentimental uses Logistic Regression on a tf-idf matrix of n-grams. Then the model is evaluated using k-fold crossvalidation.

Contributions

Please feel free to make pull requests, especially to add more training data.

License

Copyright 2016 Erik Gärtner

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].