Skip to content
This repository has been archived by the owner on Apr 20, 2019. It is now read-only.

Commit

Permalink
Handle iterables in __prepare_labeled_tweets
Browse files Browse the repository at this point in the history
  • Loading branch information
JulianKniephoff committed Jan 2, 2017
1 parent 6f44f72 commit 739fea5
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions cnn.py
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,9 @@ def output_for_class(class_number):
output[class_number] = 1
return output

# In case we are getting an iterator, we collect it here
# since we iterate over it twice
tweets = list(tweets)
return {
'input': self.__tweets_to_indices(
labeled_tweet.tweet for labeled_tweet in tweets
Expand Down

0 comments on commit 739fea5

Please sign in to comment.