Permalink
Browse files

update

  • Loading branch information...
Hutto, CJ
Hutto, CJ committed Dec 10, 2016
1 parent 24f831a commit 1f978867fb18cfe1f645434c3f1de720ab77e342
Showing with 22 additions and 9 deletions.
  1. +1 −1 MANIFEST.in
  2. +13 −0 setup.py
  3. +6 −6 vaderSentiment/vaderSentiment.py
  4. +2 −2 vaderSentiment/vader_lexicon.txt
View
@@ -1,3 +1,3 @@
include *.txt *.py *.md *.rst
include *.txt *.py *.rst
recursive-include vaderSentiment *.txt *.py
recursive-include additional_resources *.tar.gz
View
@@ -1,11 +1,24 @@
import codecs
import os
from setuptools import setup, find_packages
HERE = os.path.abspath(os.path.dirname(__file__))
def read(*parts):
"""
Build an absolute path from *parts* and and return the contents of the
resulting file. Assume UTF-8 encoding.
"""
with codecs.open(os.path.join(HERE, *parts), "rb", "utf-8") as f:
return f.read()
setup(
name = 'vaderSentiment',
#packages = ['vaderSentiment'], # this must be the same as the name above
packages = find_packages(exclude=['tests*']), # a better way to do it than the line above -- this way no typo/transpo errors
include_package_data=True,
version = '2.1',
description = 'VADER Sentiment Analysis. VADER (Valence Aware Dictionary and sEntiment Reasoner) is a lexicon and rule-based sentiment analysis tool that is specifically attuned to sentiments expressed in social media, and works well on texts from other domains.',
long_description=read("README.rst"),
author = 'C.J. Hutto',
author_email = 'cjhutto@gatech.edu',
license = 'MIT License: http://opensource.org/licenses/MIT',
@@ -487,7 +487,7 @@ def score_valence(self, sentiments, text):
you want multidimensional measures of sentiment for a given sentence.""")
print("----------------------------------------------------")
raw_input("\nPress Enter to continue the demo...\n") # for DEMO purposes...
input("\nPress Enter to continue the demo...\n") # for DEMO purposes...
tricky_sentences = ["Sentiment analysis has never been good.",
"Sentiment analysis has never been this good!",
@@ -508,7 +508,7 @@ def score_valence(self, sentiments, text):
print("{:-<69} {}".format(sentence, str(vs)))
print("----------------------------------------------------")
raw_input("\nPress Enter to continue the demo...\n") # for DEMO purposes...
input("\nPress Enter to continue the demo...\n") # for DEMO purposes...
print("----------------------------------------------------")
print(" - VADER works best when analysis is done at the sentence level (but it can work on single words or entire novels).")
@@ -526,7 +526,7 @@ def score_valence(self, sentiments, text):
print("AVERAGE SENTIMENT FOR PARAGRAPH: \t" + str(round(paragraphSentiments/len(sentence_list), 4)))
print("----------------------------------------------------")
raw_input("\nPress Enter to continue the demo...\n") # for DEMO purposes...
input("\nPress Enter to continue the demo...\n") # for DEMO purposes...
print("----------------------------------------------------")
print(" - Analyze sentiment of IMAGES/VIDEO data based on annotation 'tags' or image labels. \n")
@@ -547,9 +547,9 @@ def score_valence(self, sentiments, text):
print("AVERAGE SENTIMENT OF TAGS/LABELS: \t" + str(round(conceptSentiments/len(conceptList), 4)))
print("----------------------------------------------------")
raw_input("\nPress Enter to continue the demo...") # for DEMO purposes...
("\nPress Enter to continue the demo...") # for DEMO purposes...
do_translate = raw_input("\nWould you like to run VADER demo examples with NON-ENGLISH text? (Note: requires Internet access) \n Type 'y' or 'n', then press Enter: ")
do_translate = input("\nWould you like to run VADER demo examples with NON-ENGLISH text? (Note: requires Internet access) \n Type 'y' or 'n', then press Enter: ")
if do_translate.lower().lstrip() == 'y':
print("/n----------------------------------------------------")
print(" - Analyze sentiment of NON ENGLISH text...for example:")
@@ -591,4 +591,4 @@ def score_valence(self, sentiments, text):
print("- {: <8}: {: <69}\t {} ({})".format(languages[nonEnglish_sentences.index(sentence)], sentence, str(vs['compound']), translator_name))
print("----------------------------------------------------")
print("\n\n Demo Done!")
print("\n\n Demo Done!")
@@ -124,7 +124,7 @@ $: -1.5 0.80623 [-1, -1, -1, -1, -3, -1, -3, -1, -2, -1]
:-p 1.5 0.5 [1, 1, 1, 1, 1, 2, 2, 2, 2, 2]
:-| -0.7 0.64031 [-1, -1, 0, 0, 0, -1, -1, -2, 0, -1]
:-|| -2.5 0.67082 [-2, -2, -2, -3, -2, -3, -3, -2, -2, -4]
:- 0.9 1.04403 [1, -1, 1, 2, 1, -1, 1, 2, 2, 1]
:-Þ 0.9 1.04403 [1, -1, 1, 2, 1, -1, 1, 2, 2, 1]
:/ -1.4 0.66332 [-1, -1, -1, -1, -1, -1, -3, -2, -2, -1]
:3 2.3 1.26886 [4, 1, 1, 1, 2, 2, 4, 3, 4, 1]
:< -2.1 0.7 [-3, -1, -2, -2, -2, -2, -3, -3, -2, -1]
@@ -156,7 +156,7 @@ $: -1.5 0.80623 [-1, -1, -1, -1, -3, -1, -3, -1, -2, -1]
:{ -1.9 0.83066 [-2, -1, -1, -2, -2, -1, -3, -3, -3, -1]
:| -0.4 1.11355 [-1, -1, 0, -1, -1, -1, 1, -2, 2, 0]
:} 2.1 1.22066 [3, 1, 1, 1, 2, 1, 4, 3, 4, 1]
: 1.1 0.53852 [1, 1, 1, 1, 0, 1, 1, 2, 2, 1]
:Þ 1.1 0.53852 [1, 1, 1, 1, 0, 1, 1, 2, 2, 1]
;) 0.9 1.04403 [2, -1, 1, 1, 1, 1, -1, 2, 2, 1]
;-) 1.0 1.73205 [1, -2, 1, -2, 1, 4, 2, 1, 2, 2]
;-* 2.2 0.74833 [2, 2, 1, 3, 4, 2, 2, 2, 2, 2]

0 comments on commit 1f97886

Please sign in to comment.