File size: 314 Bytes
6cae882
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
def predict_tweet(tweet, pipeline):
    label = pipeline(tweet)[0]['label']
    if label == 'LABEL_0':
        return 0
    else:
        return 1

def get_predictions(tweets, pipeline):
    predictions = []
    for tweet in tweets:
        predictions.append(predict_tweet(tweet, pipeline))
    return predictions