Questions tagged [tweets]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
0
votes
1answer
37 views

Sentiments “tweets” elif statement error

Trying to run this, but getting an error at the very bottom "elif" statement while trying to set the colour saying it is invalid syntax. I don't know why. Also, am I doing this problem correctly? I ...
0
votes
1answer
106 views

pset6 sentiments tweets

I need some help with tweets. My code works in that it prints all requested tweets from the user timeline but it does it all in yellow and i'm struggling to figure out why. Analyzer works fine with ...
0
votes
1answer
104 views

PSET6/Sentiments/analyzer.py, tweets

I have been trying hard to get my mistakes for this PSET but can't find what errors have I made in implementing analyzer.py and tweets.On running ./smile word be it love, hate, Stanford I get :| in ...
0
votes
1answer
40 views

pset6 tweets subtraction when word is negative doesn't work

import nltk class Analyzer(): """Implements sentiment analysis.""" def __init__(self, positives, negatives): """Initialize Analyzer.""" # TODO self.pos_words = set() #starting set ...
0
votes
1answer
682 views

I don't understant how TweetTokenizer works

!/usr/bin/env python3 import os import sys from analyzer import Analyzer from termcolor import colored from helpers import get_user_timeline from nltk.tokenize import TweetTokenizer def main(): # ...
1
vote
1answer
799 views

Error in pset6 API Key not set

I'm getting this error, I have been working to make it work but i can't. I followed the instructions on setting up the API_KEY value: Traceback (most recent call last): File "tweets", line 25, in ...
0
votes
1answer
477 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
0answers
26 views

Pset6 Tweets - Installed pip3 install --user -r requirements.txt and it ruined my code :( [duplicate]

Trying to built tweets on pset6 and am encountering some errors, is it due to bad installation? What caused that error message? Should i have not used the import functions and i Here is my code: #!...
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 ...
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
439 views

Pset6 Tweets output score and color different to staff version

My Tweets function can output score and tweet from Tweeter user. However, the output is a bit different to the staff version's output. I find that some words with first character capitalized are not ...
0
votes
1answer
296 views

Python. Can't understand this code

def get_user_timeline(screen_name, count=200): """Return list of most recent tweets posted by screen_name.""" # ensure count is valid if count < 1 or count > 200: raise ...
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!...
0
votes
1answer
213 views

Tweets.py - Need help with code that retrieves tweets

I need to know if I am using the following code correctly. tweets = helpers.get_user_timeline(sys.argv[1], 50) Immediately after this line of code, I check to make sure I found tweets with: if ...
0
votes
1answer
602 views

Lost trying to figure out sentiments PSET 6 2017

I need some help with pset6 I'm basically lost trying to figure out what I should be doing. I have my analyzer code which doesn't return any errors when I run it but at the same time returns no output ...
2
votes
1answer
6k views

Why am I getting TypeError: expected string or buffer?

This is my tweets file #!/usr/bin/env python3 import os import sys from analyzer import Analyzer from termcolor import colored from helpers import get_user_timeline def ...
0
votes
1answer
834 views

pset6 - tweets, get_user_timeline function

I can't seen to get a list of tweets when calling the get_user_timeline() function. I always get None in return every time. Maybe I'm not understanding the function but for example when I try calling ...