Comments (4)
We migrated to Python 3 a little while ago, so there may be backwards compatibility issues with Python 2. For your issue -- in Python 2, the open() function takes no encoding argument (the third argument is the buffering option instead).
The fix is to add the following line near the top of the vaderSentiment.py file:
from io import open
If you are able to make this work, let me know, and I'll update the master branch so that others will benefit from this backwards compatibility hack.
from vadersentiment.
Hello, thank you for the fast reply.
Adding from io import open
seems to fix the issue (tested on 2.7.12 and 3.6).
I ran mine using f.read().decode('UTF-8')
because I didn't see your message in time, but your solution is better since it handles both versions.
Thank you!
from vadersentiment.
@cjhutto I've added that but it still comes up with this:
File "/usr/local/lib/python2.7/dist-packages/vaderSentiment/vaderSentiment.py", line 212, in init
lexicon_full_filepath = os.path.join(os.path.dirname(this_module_file_path), lexicon_file)
TypeError: 'encoding' is an invalid keyword argument for this function
from vadersentiment.
You saved my day! Including the line in my script did it! Thanks 👍
from vadersentiment.
Related Issues (20)
- Dictionary contains phrases like "fed up" that will never hit because of how the sentence is tokenized HOT 1
- Is NLP still required when using VADER?
- vaderSentiment data output in a different order than specified in the docs
- Wrong weight assigned for hashtags with capitals
- Doubt about threshold values used in VADER categorization
- is this thing still alive?
- incorrect result while running on large dataset HOT 2
- Demo None Type not Iterable HOT 2
- Adding Turkish words HOT 2
- help with adding values to vader_lexicon.txt HOT 1
- Download additional DATASETS AND TESTING RESOURCES mentioned in README HOT 3
- Total dataset is decreasing after processed by VADER
- VADER can't parse the word 'bad ass'? HOT 2
- Positive score always 0? HOT 2
- `SPECIAL_CASES` do not work HOT 3
- Support for new Emojis
- list index out of range error persists... HOT 2
- Supporting Aspect Based sentiment analysis
- Add Julia Fork Link To ReadMe
- the sentimentIntensityAnalyzer VADER is giving results only on emojicon logic and NOT text HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from vadersentiment.