def label_dict(self, handle): #Assemble classified tweets in a dict for ease of readability - see what the top ones are l_dict = {} predicted = self.classifier.predict(tweet_array(handle)) labels = self.bin_labels.inverse_transform(predicted) for raw_label in labels: if raw_label: label = str(raw_label[0]) if label in l_dict.keys(): l_dict[label] = l_dict[label] + 1 else: l_dict[label] = 0 return l_dict
def classified_tweets(self, handle): #Gets classified tweets from a specific user predicted = self.classifier.predict(tweet_array(handle)) labels = self.bin_labels.inverse_transform(predicted) return labels
def get_tweets_from_handle(handle): array = Reader.tweet_array(handle) return json.dumps(array)