seriouspark commited on
Commit
0b9acb3
1 Parent(s): 1a41782

change model to bert basic

Browse files
Files changed (1) hide show
  1. app.py +4 -2
app.py CHANGED
@@ -13,7 +13,7 @@ from tqdm import tqdm
13
  from torch import nn
14
  from transformers import BertModel
15
 
16
- from transformers import AutoTokenizer
17
 
18
  import argparse
19
 
@@ -243,7 +243,9 @@ def all_process(origin_essay):
243
  answer = question_answerer(question=question, context=row)
244
  row_dict[row] = answer
245
  emo2idx, idx2emo = get_sent_labeldata()
246
- tokenizer, cls_model = load_model()
 
 
247
  final_result, file_name_dt = get_word_emotion_pair(cls_model, essay_sent)
248
  all_result, adj_result, noun_result, essay_summary, file_made_dt_str = get_essay_base_analysis(file_name_dt)
249
 
 
13
  from torch import nn
14
  from transformers import BertModel
15
 
16
+ from transformers import AutoTokenizer, AutoModelForSequenceClassification
17
 
18
  import argparse
19
 
 
243
  answer = question_answerer(question=question, context=row)
244
  row_dict[row] = answer
245
  emo2idx, idx2emo = get_sent_labeldata()
246
+ #tokenizer, cls_model = load_model()
247
+ tokenizer = AutoTokenizer.from_pretrained('bert-base-multilingual-cased')
248
+ cls_model = AutoModelForSequenceClassification.from_pretrained('bert-base-multilingual-cased')
249
  final_result, file_name_dt = get_word_emotion_pair(cls_model, essay_sent)
250
  all_result, adj_result, noun_result, essay_summary, file_made_dt_str = get_essay_base_analysis(file_name_dt)
251