def get_emotion_embeddings(input_file): model = EmotionPredictor(classification='plutchik', setting='mc', use_unison_model=True) f = open(input_file) tweets = f.read().splitlines() embeddings = model.embedd(tweets) return embeddings
import argparse from emotion_predictor import EmotionPredictor parser = argparse.ArgumentParser() parser.add_argument('-tweets') args = parser.parse_args() tweets = args.tweets model = EmotionPredictor(classification='ekman', setting='mc', use_unison_model=True) predictions = model.predict_classes(tweets) print(predictions, '\n') probabilities = model.predict_probabilities(tweets) print(probabilities, '\n') embeddings = model.embedd(tweets) print(embeddings, '\n')