seriouspark commited on
Commit
9e83131
1 Parent(s): 3cde0b0

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -3
app.py CHANGED
@@ -136,7 +136,7 @@ def get_word_emotion_pair(cls_model, origin_essay_sentence, idx2emo):
136
 
137
 
138
  def get_essay_base_analysis(file_made_dt_str):
139
- essay1 = pd.read_csv(f"./result/{file_name_dt}/essay_result.csv")
140
  essay1['noun_list_len'] = essay1['noun_list'].apply(lambda x : len(x))
141
  essay1['noun_list_uniqlen'] = essay1['noun_list'].apply(lambda x : len(set(x)))
142
  essay1['adj_list_len'] = essay1['adj_list'].apply(lambda x : len(x))
@@ -235,8 +235,8 @@ 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.from_pretrain ed('seriouspark/bert-base-multilingual-cased-finetuning-sentimental-6label')
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)
242
  all_result, adj_\result, noun_result, essay_summary, file_made_dt_str = get_essay_base_analysis(file_name_dt)
 
136
 
137
 
138
  def get_essay_base_analysis(file_made_dt_str):
139
+ essay1 = pd.read_csv(f"./result/{file_made_dt_str}/essay_result.csv")
140
  essay1['noun_list_len'] = essay1['noun_list'].apply(lambda x : len(x))
141
  essay1['noun_list_uniqlen'] = essay1['noun_list'].apply(lambda x : len(set(x)))
142
  essay1['adj_list_len'] = essay1['adj_list'].apply(lambda x : len(x))
 
235
  row_dict[row] = answer
236
  emo2idx, idx2emo = get_sent_labeldata()
237
  tokenizer = AutoTokenizer.from_pretrained('bert-base-multilingual-cased')
238
+ cls_model = AutoModelForSequenceClassification.from_pretrain ed('seriouspark/bert-base-multilingual-cased-finetuning-sentimental-6label')
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)
242
  all_result, adj_\result, noun_result, essay_summary, file_made_dt_str = get_essay_base_analysis(file_name_dt)