def get_bear_bull_ratio(tweet_text): tweet_classified = classifier.score_tweets(tweet_text) bear_bull_tweets = classifier.get_bear_bull(tweet_classified) if len(bear_bull_tweets[1]) != 0: return float(len(bear_bull_tweets[0])) / float(len(bear_bull_tweets[1])) else: return len(bear_bull_tweets[0])
def get_bear_bull(tweet_text): ''' ''' tweet_classified = classifier.score_tweets(tweet_text) bear_bull_tweets = classifier.get_bear_bull(tweet_classified) return (len(bear_bull_tweets[0]), len(bear_bull_tweets[1]))