Spaces:
Sleeping
Sleeping
seriouspark
commited on
Commit
•
dc66c9b
1
Parent(s):
9e83131
Update app.py
Browse files
app.py
CHANGED
@@ -224,7 +224,6 @@ nlp=lambda x:[(x[t["start"]:t["end"]],t["entity_group"]) for t in pipeline(x)]
|
|
224 |
|
225 |
from transformers import AutoModelForSequenceClassification
|
226 |
device = 'cuda' if torch.cuda.is_available() else 'cpu'
|
227 |
-
tokenizer = AutoTokenizer.from_pretrained('bert-base-multilingual-cased')
|
228 |
|
229 |
def all_process(origin_essay):
|
230 |
essay_sent =split_essay_to_sentence(origin_essay)
|
@@ -235,7 +234,7 @@ def all_process(origin_essay):
|
|
235 |
row_dict[row] = answer
|
236 |
emo2idx, idx2emo = get_sent_labeldata()
|
237 |
tokenizer = AutoTokenizer.from_pretrained('bert-base-multilingual-cased')
|
238 |
-
cls_model = AutoModelForSequenceClassification.
|
239 |
#cls_model = AutoModelForSequenceClassification.from_pretrained('bert-base-multilingual-cased', num_labels = 6)
|
240 |
|
241 |
final_result, file_name_dt = get_word_emotion_pair(cls_model, essay_sent)
|
|
|
224 |
|
225 |
from transformers import AutoModelForSequenceClassification
|
226 |
device = 'cuda' if torch.cuda.is_available() else 'cpu'
|
|
|
227 |
|
228 |
def all_process(origin_essay):
|
229 |
essay_sent =split_essay_to_sentence(origin_essay)
|
|
|
234 |
row_dict[row] = answer
|
235 |
emo2idx, idx2emo = get_sent_labeldata()
|
236 |
tokenizer = AutoTokenizer.from_pretrained('bert-base-multilingual-cased')
|
237 |
+
cls_model = AutoModelForSequenceClassification.from_pretrained('seriouspark/bert-base-multilingual-cased-finetuning-sentimental-6label')
|
238 |
#cls_model = AutoModelForSequenceClassification.from_pretrained('bert-base-multilingual-cased', num_labels = 6)
|
239 |
|
240 |
final_result, file_name_dt = get_word_emotion_pair(cls_model, essay_sent)
|