Skip to content

Calculating the sentiment of adjectives in a text.

Notifications You must be signed in to change notification settings

l-stahlhut/adjective-sentiment

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 

Repository files navigation

Adjective Sentiment dictionary

This script calculates the mean sentiment of the adjectives in a text. -1, 0 and 1 denote a negative, neutral and positive sentiment respectively.

How to use the script

The script requires

  • a file with a list of adjectives and their respective sentiment in the form of adjective_sentiment.txt. A sentiment dictionary is created from this list.
  • a text with POS-tags in the form of test_news.txt or test_hobbies.txt. The tag 'JJ' stands for adjectives. This data is from the Brown corpus.

Example:

$ python3 adjective_sentiment.py adjective_sentiment.txt test_hobbies.txt

License

MIT

About

Calculating the sentiment of adjectives in a text.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages