Wrong output from sentiment analysis?How to flush output of print function?How to randomly select an item from a list?How do you read from stdin?Why is reading lines from stdin much slower in C++ than Python?How to remove a key from a Python dictionary?Adding scores of sentences depending on region Python very lostPython: How to total of the scores for all the tweets in a region divided by the number of tweets (Lots of info provided,)Completing a function to add Values depending on specific “Regions” (More info provided)The procedure to matching words from a list to words in a lineWhy am I getting a syntax error for my elif statement?
What was the point of separating stdout and stderr?
A quine of sorts
Why are examinees often not allowed to leave during the start and end of an exam?
Does a lens with a bigger max. aperture focus faster than a lens with a smaller max. aperture?
Calculus, water poured into a cone: Why is the derivative non-linear?
Does "boire un jus" tend to mean "coffee" or "juice of fruit"?
Chandra exiles a card, I play it, it gets exiled again
Why isn't UDP with reliability (implemented at Application layer) a substitute of TCP?
What prevents a US state from colonizing a smaller state?
"in 60 seconds or less" or "in 60 seconds or fewer"?
What are the children of two Muggle-borns called?
Is it theoretically possible to hack printer using scanner tray?
A* pathfinding algorithm too slow
What is my external HDD doing?
Enterprise Layers and Naming Conventions
Time for some proverbs!
I agreed to cancel a long-planned vacation (with travel costs) due to project deadlines, but now the timeline has all changed again
Why didn't Caesar move against Sextus Pompey immediately after Munda?
Why am I getting an electric shock from the water in my hot tub?
What's the lunar calendar of two moons
What was the first science fiction or fantasy multiple choice book?
How to count the number of bytes in a file, grouping the same bytes?
What is this fluorinated organic substance?
Why did the Apple IIe make a hideous noise if you inserted the disk upside down?
Wrong output from sentiment analysis?
How to flush output of print function?How to randomly select an item from a list?How do you read from stdin?Why is reading lines from stdin much slower in C++ than Python?How to remove a key from a Python dictionary?Adding scores of sentences depending on region Python very lostPython: How to total of the scores for all the tweets in a region divided by the number of tweets (Lots of info provided,)Completing a function to add Values depending on specific “Regions” (More info provided)The procedure to matching words from a list to words in a lineWhy am I getting a syntax error for my elif statement?
I'll explain my coding assignment in brief:
1)I have to calculate the happiness score of tweets from 4 different timezones.
There are two files, one contains the keywords each with an associated sentiment value and the other contains the actual tweets themselves.
2) I had to first read the keywords file and categorize the key words into 4 lists (based on their sentiment value). The tweets file is in the format [lat, long] value date time text.
3) The “happiness score” for a timezone is just the total of the scores (sentiment score) for all the tweets in that region divided by the number of tweets.
My program should ignore tweets with no keywords and also ignore tweets from
outside the time zones. So there may be some from outside the time zones.
keywordsfile=input("Enter name of keyword file: ")
infile=open(keywordsfile,"r",encoding="utf-8")
depressed=[] #keywords with sentiment value 1
okay=[] #keywords with sentiment value 5
good=[] #keywords with sentiment value 7
happy=[] #keywords with sentiment value 10
for line in infile:
line=line.rstrip()
keyWords=line.split(",")
keyWords[1]=int(keyWords[1])
if keyWords[1]==1:
depressed.append(keyWords[0])
elif keyWords[1]==5:
okay.append(keyWords[0])
elif keyWords[1]==7:
good.append(keyWords[0])
elif keyWords[1]==10:
happy.append(keyWords[0])
else:
pass
infile.close()
tweetfile=input("Enter name of tweet file: ")
infile2=open(tweetfile,"r",encoding="utf-8")
DEPRESSEDVALUE=1
OKAYVALUE=5
GOODVALUE=7
HAPPYVALUE=10
depressedKeys=0
okayKeys=0
goodKeys=0
happyKeys=0
numOfTweetsEastern=0
numOfTweetsCentral=0
numOfTweetsMountain=0
numOfTweetsPacific=0
for line in infile2:
line=line.rstrip()
words=line.split()
firststriplat=words[0].rstrip(",")
lat=firststriplat.lstrip("[")
lat=float(lat)
long=words[1].rstrip("]")
long=float(long)
easternLat= 24.660845 <= lat and lat<=49.189787
easternLong= -87.518395 <= long <= -67.444574
centralLat= 24.660845 <= lat and lat<=49.189787
centralLong= -101.998892 <= long <= -87.518395
mountainLat=24.660845 <= lat and lat<=49.189787
mountainLong=-115.236428 <= long <= -101.998892
pacificLat=24.660845 <= lat and lat<=49.189787
pacificLong= -125.242264<= long <= -115.236428
if easternLat and easternLong:
for word in words:
if word in depressed:
depressedKeys=depressedKeys+1
elif word in okay:
okayKeys=okayKeys+1
elif word in good:
goodKeys=goodKeys+1
elif word in happy:
happyKeys=happyKeys+1
else:
pass
numOfTweetsEastern=numOfTweetsEastern+1
sentimentValueEastern=(depressedKeys*DEPRESSEDVALUE)+(okayKeys*OKAYVALUE)+(goodKeys*GOODVALUE)+(happyKeys*HAPPYVALUE)
elif centralLat and centralLong:
for word in words:
if word in depressed:
depressedKeys=depressedKeys+1
elif word in okay:
okayKeys=okayKeys+1
elif word in good:
goodKeys=goodKeys+1
elif word in happy:
happyKeys=happyKeys+1
else:
pass
numOfTweetsCentral=numOfTweetsCentral+1
sentimentValueCentral=(depressedKeys*DEPRESSEDVALUE)+(okayKeys*OKAYVALUE)+(goodKeys*GOODVALUE)+(happyKeys*HAPPYVALUE)
elif mountainLat and mountainLong:
for word in words:
if word in depressed:
depressedKeys=depressedKeys+1
elif word in okay:
okayKeys=okayKeys+1
elif word in good:
goodKeys=goodKeys+1
elif word in happy:
happyKeys=happyKeys+1
else:
pass
numOfTweetsMountain=numOfTweetsMountain+1
sentimentValueMountain=(depressedKeys*DEPRESSEDVALUE)+(okayKeys*OKAYVALUE)+(goodKeys*GOODVALUE)+(happyKeys*HAPPYVALUE)
elif pacificLat and pacificLong:
for word in words:
if word in depressed:
depressedKeys=depressedKeys+1
elif word in okay:
okayKeys=okayKeys+1
elif word in good:
goodKeys=goodKeys+1
elif word in happy:
happyKeys=happyKeys+1
else:
pass
numOfTweetsPacific=numOfTweetsPacific+1
sentimentValuePacific=(depressedKeys*DEPRESSEDVALUE)+(okayKeys*OKAYVALUE)+(goodKeys*GOODVALUE)+(happyKeys*HAPPYVALUE)
else:
pass
happScoreEastern=sentimentValueEastern/numOfTweetsEastern
happScoreCentral=sentimentValueCentral/numOfTweetsCentral
happScoreMountain=sentimentValueMountain/numOfTweetsMountain
happScorePacific=sentimentValuePacific/numOfTweetsPacific
print("The happiness score for the Eastern timezone is",happScoreEastern,"and the total number of tweets were",numOfTweetsEastern)
print("The happiness score for the Central timezone is",happScoreCentral,"and the total number of tweets were",numOfTweetsCentral)
print("The happiness score for the Mountain timezone is",happScoreMountain,"and the total number of tweets were",numOfTweetsMountain)
print("The happiness score for the Pacific timezone is",happScorePacific,"and the total number of tweets were",numOfTweetsPacific)
However, apparently, my happiness scores and number of tweets from each time zone are way off (apparently way large numbers) Like way off. Where did I go wrong in my code? I thought I did everything right
python sentiment-analysis tweets
add a comment |
I'll explain my coding assignment in brief:
1)I have to calculate the happiness score of tweets from 4 different timezones.
There are two files, one contains the keywords each with an associated sentiment value and the other contains the actual tweets themselves.
2) I had to first read the keywords file and categorize the key words into 4 lists (based on their sentiment value). The tweets file is in the format [lat, long] value date time text.
3) The “happiness score” for a timezone is just the total of the scores (sentiment score) for all the tweets in that region divided by the number of tweets.
My program should ignore tweets with no keywords and also ignore tweets from
outside the time zones. So there may be some from outside the time zones.
keywordsfile=input("Enter name of keyword file: ")
infile=open(keywordsfile,"r",encoding="utf-8")
depressed=[] #keywords with sentiment value 1
okay=[] #keywords with sentiment value 5
good=[] #keywords with sentiment value 7
happy=[] #keywords with sentiment value 10
for line in infile:
line=line.rstrip()
keyWords=line.split(",")
keyWords[1]=int(keyWords[1])
if keyWords[1]==1:
depressed.append(keyWords[0])
elif keyWords[1]==5:
okay.append(keyWords[0])
elif keyWords[1]==7:
good.append(keyWords[0])
elif keyWords[1]==10:
happy.append(keyWords[0])
else:
pass
infile.close()
tweetfile=input("Enter name of tweet file: ")
infile2=open(tweetfile,"r",encoding="utf-8")
DEPRESSEDVALUE=1
OKAYVALUE=5
GOODVALUE=7
HAPPYVALUE=10
depressedKeys=0
okayKeys=0
goodKeys=0
happyKeys=0
numOfTweetsEastern=0
numOfTweetsCentral=0
numOfTweetsMountain=0
numOfTweetsPacific=0
for line in infile2:
line=line.rstrip()
words=line.split()
firststriplat=words[0].rstrip(",")
lat=firststriplat.lstrip("[")
lat=float(lat)
long=words[1].rstrip("]")
long=float(long)
easternLat= 24.660845 <= lat and lat<=49.189787
easternLong= -87.518395 <= long <= -67.444574
centralLat= 24.660845 <= lat and lat<=49.189787
centralLong= -101.998892 <= long <= -87.518395
mountainLat=24.660845 <= lat and lat<=49.189787
mountainLong=-115.236428 <= long <= -101.998892
pacificLat=24.660845 <= lat and lat<=49.189787
pacificLong= -125.242264<= long <= -115.236428
if easternLat and easternLong:
for word in words:
if word in depressed:
depressedKeys=depressedKeys+1
elif word in okay:
okayKeys=okayKeys+1
elif word in good:
goodKeys=goodKeys+1
elif word in happy:
happyKeys=happyKeys+1
else:
pass
numOfTweetsEastern=numOfTweetsEastern+1
sentimentValueEastern=(depressedKeys*DEPRESSEDVALUE)+(okayKeys*OKAYVALUE)+(goodKeys*GOODVALUE)+(happyKeys*HAPPYVALUE)
elif centralLat and centralLong:
for word in words:
if word in depressed:
depressedKeys=depressedKeys+1
elif word in okay:
okayKeys=okayKeys+1
elif word in good:
goodKeys=goodKeys+1
elif word in happy:
happyKeys=happyKeys+1
else:
pass
numOfTweetsCentral=numOfTweetsCentral+1
sentimentValueCentral=(depressedKeys*DEPRESSEDVALUE)+(okayKeys*OKAYVALUE)+(goodKeys*GOODVALUE)+(happyKeys*HAPPYVALUE)
elif mountainLat and mountainLong:
for word in words:
if word in depressed:
depressedKeys=depressedKeys+1
elif word in okay:
okayKeys=okayKeys+1
elif word in good:
goodKeys=goodKeys+1
elif word in happy:
happyKeys=happyKeys+1
else:
pass
numOfTweetsMountain=numOfTweetsMountain+1
sentimentValueMountain=(depressedKeys*DEPRESSEDVALUE)+(okayKeys*OKAYVALUE)+(goodKeys*GOODVALUE)+(happyKeys*HAPPYVALUE)
elif pacificLat and pacificLong:
for word in words:
if word in depressed:
depressedKeys=depressedKeys+1
elif word in okay:
okayKeys=okayKeys+1
elif word in good:
goodKeys=goodKeys+1
elif word in happy:
happyKeys=happyKeys+1
else:
pass
numOfTweetsPacific=numOfTweetsPacific+1
sentimentValuePacific=(depressedKeys*DEPRESSEDVALUE)+(okayKeys*OKAYVALUE)+(goodKeys*GOODVALUE)+(happyKeys*HAPPYVALUE)
else:
pass
happScoreEastern=sentimentValueEastern/numOfTweetsEastern
happScoreCentral=sentimentValueCentral/numOfTweetsCentral
happScoreMountain=sentimentValueMountain/numOfTweetsMountain
happScorePacific=sentimentValuePacific/numOfTweetsPacific
print("The happiness score for the Eastern timezone is",happScoreEastern,"and the total number of tweets were",numOfTweetsEastern)
print("The happiness score for the Central timezone is",happScoreCentral,"and the total number of tweets were",numOfTweetsCentral)
print("The happiness score for the Mountain timezone is",happScoreMountain,"and the total number of tweets were",numOfTweetsMountain)
print("The happiness score for the Pacific timezone is",happScorePacific,"and the total number of tweets were",numOfTweetsPacific)
However, apparently, my happiness scores and number of tweets from each time zone are way off (apparently way large numbers) Like way off. Where did I go wrong in my code? I thought I did everything right
python sentiment-analysis tweets
add a comment |
I'll explain my coding assignment in brief:
1)I have to calculate the happiness score of tweets from 4 different timezones.
There are two files, one contains the keywords each with an associated sentiment value and the other contains the actual tweets themselves.
2) I had to first read the keywords file and categorize the key words into 4 lists (based on their sentiment value). The tweets file is in the format [lat, long] value date time text.
3) The “happiness score” for a timezone is just the total of the scores (sentiment score) for all the tweets in that region divided by the number of tweets.
My program should ignore tweets with no keywords and also ignore tweets from
outside the time zones. So there may be some from outside the time zones.
keywordsfile=input("Enter name of keyword file: ")
infile=open(keywordsfile,"r",encoding="utf-8")
depressed=[] #keywords with sentiment value 1
okay=[] #keywords with sentiment value 5
good=[] #keywords with sentiment value 7
happy=[] #keywords with sentiment value 10
for line in infile:
line=line.rstrip()
keyWords=line.split(",")
keyWords[1]=int(keyWords[1])
if keyWords[1]==1:
depressed.append(keyWords[0])
elif keyWords[1]==5:
okay.append(keyWords[0])
elif keyWords[1]==7:
good.append(keyWords[0])
elif keyWords[1]==10:
happy.append(keyWords[0])
else:
pass
infile.close()
tweetfile=input("Enter name of tweet file: ")
infile2=open(tweetfile,"r",encoding="utf-8")
DEPRESSEDVALUE=1
OKAYVALUE=5
GOODVALUE=7
HAPPYVALUE=10
depressedKeys=0
okayKeys=0
goodKeys=0
happyKeys=0
numOfTweetsEastern=0
numOfTweetsCentral=0
numOfTweetsMountain=0
numOfTweetsPacific=0
for line in infile2:
line=line.rstrip()
words=line.split()
firststriplat=words[0].rstrip(",")
lat=firststriplat.lstrip("[")
lat=float(lat)
long=words[1].rstrip("]")
long=float(long)
easternLat= 24.660845 <= lat and lat<=49.189787
easternLong= -87.518395 <= long <= -67.444574
centralLat= 24.660845 <= lat and lat<=49.189787
centralLong= -101.998892 <= long <= -87.518395
mountainLat=24.660845 <= lat and lat<=49.189787
mountainLong=-115.236428 <= long <= -101.998892
pacificLat=24.660845 <= lat and lat<=49.189787
pacificLong= -125.242264<= long <= -115.236428
if easternLat and easternLong:
for word in words:
if word in depressed:
depressedKeys=depressedKeys+1
elif word in okay:
okayKeys=okayKeys+1
elif word in good:
goodKeys=goodKeys+1
elif word in happy:
happyKeys=happyKeys+1
else:
pass
numOfTweetsEastern=numOfTweetsEastern+1
sentimentValueEastern=(depressedKeys*DEPRESSEDVALUE)+(okayKeys*OKAYVALUE)+(goodKeys*GOODVALUE)+(happyKeys*HAPPYVALUE)
elif centralLat and centralLong:
for word in words:
if word in depressed:
depressedKeys=depressedKeys+1
elif word in okay:
okayKeys=okayKeys+1
elif word in good:
goodKeys=goodKeys+1
elif word in happy:
happyKeys=happyKeys+1
else:
pass
numOfTweetsCentral=numOfTweetsCentral+1
sentimentValueCentral=(depressedKeys*DEPRESSEDVALUE)+(okayKeys*OKAYVALUE)+(goodKeys*GOODVALUE)+(happyKeys*HAPPYVALUE)
elif mountainLat and mountainLong:
for word in words:
if word in depressed:
depressedKeys=depressedKeys+1
elif word in okay:
okayKeys=okayKeys+1
elif word in good:
goodKeys=goodKeys+1
elif word in happy:
happyKeys=happyKeys+1
else:
pass
numOfTweetsMountain=numOfTweetsMountain+1
sentimentValueMountain=(depressedKeys*DEPRESSEDVALUE)+(okayKeys*OKAYVALUE)+(goodKeys*GOODVALUE)+(happyKeys*HAPPYVALUE)
elif pacificLat and pacificLong:
for word in words:
if word in depressed:
depressedKeys=depressedKeys+1
elif word in okay:
okayKeys=okayKeys+1
elif word in good:
goodKeys=goodKeys+1
elif word in happy:
happyKeys=happyKeys+1
else:
pass
numOfTweetsPacific=numOfTweetsPacific+1
sentimentValuePacific=(depressedKeys*DEPRESSEDVALUE)+(okayKeys*OKAYVALUE)+(goodKeys*GOODVALUE)+(happyKeys*HAPPYVALUE)
else:
pass
happScoreEastern=sentimentValueEastern/numOfTweetsEastern
happScoreCentral=sentimentValueCentral/numOfTweetsCentral
happScoreMountain=sentimentValueMountain/numOfTweetsMountain
happScorePacific=sentimentValuePacific/numOfTweetsPacific
print("The happiness score for the Eastern timezone is",happScoreEastern,"and the total number of tweets were",numOfTweetsEastern)
print("The happiness score for the Central timezone is",happScoreCentral,"and the total number of tweets were",numOfTweetsCentral)
print("The happiness score for the Mountain timezone is",happScoreMountain,"and the total number of tweets were",numOfTweetsMountain)
print("The happiness score for the Pacific timezone is",happScorePacific,"and the total number of tweets were",numOfTweetsPacific)
However, apparently, my happiness scores and number of tweets from each time zone are way off (apparently way large numbers) Like way off. Where did I go wrong in my code? I thought I did everything right
python sentiment-analysis tweets
I'll explain my coding assignment in brief:
1)I have to calculate the happiness score of tweets from 4 different timezones.
There are two files, one contains the keywords each with an associated sentiment value and the other contains the actual tweets themselves.
2) I had to first read the keywords file and categorize the key words into 4 lists (based on their sentiment value). The tweets file is in the format [lat, long] value date time text.
3) The “happiness score” for a timezone is just the total of the scores (sentiment score) for all the tweets in that region divided by the number of tweets.
My program should ignore tweets with no keywords and also ignore tweets from
outside the time zones. So there may be some from outside the time zones.
keywordsfile=input("Enter name of keyword file: ")
infile=open(keywordsfile,"r",encoding="utf-8")
depressed=[] #keywords with sentiment value 1
okay=[] #keywords with sentiment value 5
good=[] #keywords with sentiment value 7
happy=[] #keywords with sentiment value 10
for line in infile:
line=line.rstrip()
keyWords=line.split(",")
keyWords[1]=int(keyWords[1])
if keyWords[1]==1:
depressed.append(keyWords[0])
elif keyWords[1]==5:
okay.append(keyWords[0])
elif keyWords[1]==7:
good.append(keyWords[0])
elif keyWords[1]==10:
happy.append(keyWords[0])
else:
pass
infile.close()
tweetfile=input("Enter name of tweet file: ")
infile2=open(tweetfile,"r",encoding="utf-8")
DEPRESSEDVALUE=1
OKAYVALUE=5
GOODVALUE=7
HAPPYVALUE=10
depressedKeys=0
okayKeys=0
goodKeys=0
happyKeys=0
numOfTweetsEastern=0
numOfTweetsCentral=0
numOfTweetsMountain=0
numOfTweetsPacific=0
for line in infile2:
line=line.rstrip()
words=line.split()
firststriplat=words[0].rstrip(",")
lat=firststriplat.lstrip("[")
lat=float(lat)
long=words[1].rstrip("]")
long=float(long)
easternLat= 24.660845 <= lat and lat<=49.189787
easternLong= -87.518395 <= long <= -67.444574
centralLat= 24.660845 <= lat and lat<=49.189787
centralLong= -101.998892 <= long <= -87.518395
mountainLat=24.660845 <= lat and lat<=49.189787
mountainLong=-115.236428 <= long <= -101.998892
pacificLat=24.660845 <= lat and lat<=49.189787
pacificLong= -125.242264<= long <= -115.236428
if easternLat and easternLong:
for word in words:
if word in depressed:
depressedKeys=depressedKeys+1
elif word in okay:
okayKeys=okayKeys+1
elif word in good:
goodKeys=goodKeys+1
elif word in happy:
happyKeys=happyKeys+1
else:
pass
numOfTweetsEastern=numOfTweetsEastern+1
sentimentValueEastern=(depressedKeys*DEPRESSEDVALUE)+(okayKeys*OKAYVALUE)+(goodKeys*GOODVALUE)+(happyKeys*HAPPYVALUE)
elif centralLat and centralLong:
for word in words:
if word in depressed:
depressedKeys=depressedKeys+1
elif word in okay:
okayKeys=okayKeys+1
elif word in good:
goodKeys=goodKeys+1
elif word in happy:
happyKeys=happyKeys+1
else:
pass
numOfTweetsCentral=numOfTweetsCentral+1
sentimentValueCentral=(depressedKeys*DEPRESSEDVALUE)+(okayKeys*OKAYVALUE)+(goodKeys*GOODVALUE)+(happyKeys*HAPPYVALUE)
elif mountainLat and mountainLong:
for word in words:
if word in depressed:
depressedKeys=depressedKeys+1
elif word in okay:
okayKeys=okayKeys+1
elif word in good:
goodKeys=goodKeys+1
elif word in happy:
happyKeys=happyKeys+1
else:
pass
numOfTweetsMountain=numOfTweetsMountain+1
sentimentValueMountain=(depressedKeys*DEPRESSEDVALUE)+(okayKeys*OKAYVALUE)+(goodKeys*GOODVALUE)+(happyKeys*HAPPYVALUE)
elif pacificLat and pacificLong:
for word in words:
if word in depressed:
depressedKeys=depressedKeys+1
elif word in okay:
okayKeys=okayKeys+1
elif word in good:
goodKeys=goodKeys+1
elif word in happy:
happyKeys=happyKeys+1
else:
pass
numOfTweetsPacific=numOfTweetsPacific+1
sentimentValuePacific=(depressedKeys*DEPRESSEDVALUE)+(okayKeys*OKAYVALUE)+(goodKeys*GOODVALUE)+(happyKeys*HAPPYVALUE)
else:
pass
happScoreEastern=sentimentValueEastern/numOfTweetsEastern
happScoreCentral=sentimentValueCentral/numOfTweetsCentral
happScoreMountain=sentimentValueMountain/numOfTweetsMountain
happScorePacific=sentimentValuePacific/numOfTweetsPacific
print("The happiness score for the Eastern timezone is",happScoreEastern,"and the total number of tweets were",numOfTweetsEastern)
print("The happiness score for the Central timezone is",happScoreCentral,"and the total number of tweets were",numOfTweetsCentral)
print("The happiness score for the Mountain timezone is",happScoreMountain,"and the total number of tweets were",numOfTweetsMountain)
print("The happiness score for the Pacific timezone is",happScorePacific,"and the total number of tweets were",numOfTweetsPacific)
However, apparently, my happiness scores and number of tweets from each time zone are way off (apparently way large numbers) Like way off. Where did I go wrong in my code? I thought I did everything right
python sentiment-analysis tweets
python sentiment-analysis tweets
asked Mar 25 at 16:35
Amandeep PasrichaAmandeep Pasricha
197 bronze badges
197 bronze badges
add a comment |
add a comment |
0
active
oldest
votes
Your Answer
StackExchange.ifUsing("editor", function ()
StackExchange.using("externalEditor", function ()
StackExchange.using("snippets", function ()
StackExchange.snippets.init();
);
);
, "code-snippets");
StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "1"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);
else
createEditor();
);
function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);
);
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55342503%2fwrong-output-from-sentiment-analysis%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
0
active
oldest
votes
0
active
oldest
votes
active
oldest
votes
active
oldest
votes
Is this question similar to what you get asked at work? Learn more about asking and sharing private information with your coworkers using Stack Overflow for Teams.
Is this question similar to what you get asked at work? Learn more about asking and sharing private information with your coworkers using Stack Overflow for Teams.
Thanks for contributing an answer to Stack Overflow!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55342503%2fwrong-output-from-sentiment-analysis%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown