add emotion classification
Browse files- emotions.py +1 -1
emotions.py
CHANGED
@@ -5,7 +5,7 @@ tokenizer = AutoTokenizer.from_pretrained("mrm8488/t5-base-finetuned-emotion")
|
|
5 |
model = AutoModelWithLMHead.from_pretrained("mrm8488/t5-base-finetuned-emotion")
|
6 |
|
7 |
|
8 |
-
def get_emotion(text):
|
9 |
input_ids = tokenizer.encode(text + '</s>', return_tensors='pt')
|
10 |
|
11 |
output = model.generate(input_ids=input_ids,
|
|
|
5 |
model = AutoModelWithLMHead.from_pretrained("mrm8488/t5-base-finetuned-emotion")
|
6 |
|
7 |
|
8 |
+
def get_emotion(text='No text yet'):
|
9 |
input_ids = tokenizer.encode(text + '</s>', return_tensors='pt')
|
10 |
|
11 |
output = model.generate(input_ids=input_ids,
|