Questions tagged [pset6-sentiments]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
1
vote
1answer
69 views

i cant set up twitter developer account for pset6 sentiments tweets

As of july 2018 twitter requires a developer account to make new apps, there are a bunch of questions that they ask that I dont know the answer to , my application for developer account got rejected ...
1
vote
1answer
443 views

PSET6 credit.py, not able to import 'get_long_long'

Traceback (most recent call last): File "credit.py", line 1, in from cs50 import get_long_long ImportError: cannot import name 'get_long_long'
0
votes
1answer
68 views

pset6 caesar.py Invalid output only with lowercase characters

I am porting caesar.c to python and am having a problem. The code below works for uppercase characters, for example 'A' outputs 'B' with a shift of 1. But lowercase characters, like 'a' with the ...
0
votes
1answer
161 views

pset6 mario(more).py check50 problems even when output is correct?

Working on mario (more).py port into python. My code works and it seems to output the correct things, but check50 does not like it. Can anyone point me in the right direction of where I am incorrect?
0
votes
1answer
165 views

pset6 Sentiments TypeError: analyze() missing 1 required positional argument: 'text'

Finished writing code for my pset6 Sentiments and when I follow the steps "select CS50 IDE > Web Server in CS50 IDE’s top-left corner. Search for some user’s screen name, and you should see a chart." ...
0
votes
1answer
200 views

CS50 2017: string index out of range when trying to load words into dictionary (dict.update())

I am at the very first part of pset6, which is just loading words in the text files into memory. I am using a python dict structure. To test a simple case first, I created a test-words.txt file, put ...
0
votes
1answer
73 views

How can for File IO works in Python?

I have finished pset5 and now on pset6 but I have one doubt about how we can read the file without file.read() or readlines() etc. I understand both code file = open(“testfile.txt”, “r”) c = file....
1
vote
1answer
144 views

Confused by NLTK

I'm a little unsure of what's going on with the syntax when using the NLTK to tokenize strings. In the tips for the pset this code is shown initially: nltk.tokenize.casual.TweetTokenizer Then they ...
0
votes
1answer
76 views

tokens in analyzer and tweets not working ? - sentiments - pset 6

i ve been reading post because the tokens is not working in the analyzer and i don t understand how come in all post i ve red about tweets there are no tokens at all (but zamyla said to use the tokens ...
0
votes
1answer
72 views

TweetTokenizer don't process 3 specific words

I am working on analyzer and smile. Except "a+", "2-faced" and "2-faces" my code works correctly.These words should give me ':)', ':(', ':('. But all of them give me ':|'. I am sure these words in ...
0
votes
2answers
62 views

Pset 6 Words are randomly not being added to the dictionary

For the most part my solution to pset6 works, it correctly fetches the tweets, graphs them, and analyzes them, but for some reason some words will not get added to my dictionary. For example hate ...
0
votes
1answer
59 views

Pset6 analyzer.py not incrementing counter

I've checked over my code many times for errors, but everything looks logically sound to me. For some reason, "counter" in the analyze method will never change, which means that my conditional ...
0
votes
1answer
2k views

if !(line.startswith(';')):

Is there a way to use the ! symbol or another symbol with the line below? Though the following syntax is wrong, I have it here to illustrate what I am aiming for if !(line.startswith(';')): ...
0
votes
1answer
483 views

problem debuging tweet

i am having trouble with tweets. I copied the get_user_timeline function from helper to tweets, since it was origanily set to def get_user_timeline(screen_name, count=200): I am not clear why anyone ...
0
votes
1answer
244 views

Pset6 2017 - problem with application.py

I have a problem with the final part of Pset6 2017 - printing a pie chart showing the distribution of a particular twitter user's tweets according to whether they are positive, negative or neutral. ...
0
votes
2answers
395 views

Struggling to load positive and negative words in analyzer.py, PSET6 2017

I'm hoping you can help me - I'm rather struggling with the jump from C to Python in CS50 2017 edition - lots of new syntax and concepts to cover in one week! I'm currently at the very first stage - ...
0
votes
1answer
26 views

pset6 - builtins.importerror when run webserser

Got result as below after flask - run CS50 IDE - Web Server
0
votes
1answer
216 views

pset6, how can one resolve this error in sentiments, OSError: [Errno 98] Address already in use

/workspace/pset6/sentiments/ $ flask run * Serving Flask app "application" * Forcing debug mode on Traceback (most recent call last): File "/usr/local/bin/flask", line 11, in sys.exit(main()) ...
0
votes
1answer
134 views

Analyzer Pset6 does not work

just started this and have quite a bit trouble getting used to python despite having read all the courseware. My code keeps returning a neutral face. What is wrong? Thanks. import nltk class ...
0
votes
1answer
81 views

pset6: are the scores being calculated correctly?

my code for tweets works perfectly, except that the tweets do not seem to have the right score. A "happy" tweet does not have a positive score, for instance. Why is that? For your reference, I ...
0
votes
1answer
181 views

pset6: why is my version of the analyzer not working?

For analyzer.py, I think my code works for defining the first part: instantiation of the analyzer, but not for defining the second: analyze. Please see the failing part of my code below. Also, I have ...
3
votes
1answer
2k views

pset6 tweets, analyze.py and application.py

I've been stuck here for a while, any help would be appreciated, thanks I'm getting this error on the console while trying to run ./tweets @cs50: ~/workspace/pset6/sentiments/ $ ./tweets @cs50 ...
0
votes
1answer
1k views

CS50 2017 Pset6 Sentiments tweets

I need some help with tweets. Or just help me get what inspiration to get from smile for it, as per the specs. Here's my code: #!/usr/bin/env python3 import os import sys import nltk from ...
0
votes
1answer
55 views

Pset6_Tweets works, but each line of output has parentheses around it. Why?

Here is a link to tweets code: http://pastebin.com/iHWaTkjj Here is output excerpt (colors not replicated below): (0, 'The spotlight has finally been put on the low-life leakers! They will be caught!...