Skip to content

Latest commit

 

History

History
31 lines (25 loc) · 1.46 KB

File metadata and controls

31 lines (25 loc) · 1.46 KB

Sentiment analysis

Rule-based library for sentiment analysis. The main idea, that library returns mark of the sentiment (3, -5, etc), but not only trend - positive or negative. The way how sentiment mark is calculated is just summarization of positive and negative adjectives, paying attention to the increment, decrement and inverter words.

Current version of the library works only with english text.

Main features

The library handles:

  • increment and decrement words (like less, greatly, etc.)
  • inverter words (like not, etc.)
  • comparative and superlative form

The vocabulary of the adjectives can strongly influence on the sentiment mark. So you can use different vocabularies of the positive and negative adjectives depends of the context of documents.

Installation

For installation the best way use conda. After installation conda just run:

conda env create -f env.yml

After the installation was done successfully, activate your enviroment:

source activate sa

For using conda and environments, please read full documentation of conda.

Example

from sentiment_analysis.estimator import Estimator

estimator = Estimator()
print(estimator.estimate('The staff is amazing, friendly and helpful.'))