HMPhuoc commited on
Commit
374606d
1 Parent(s): 0b15904

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +5 -5
app.py CHANGED
@@ -16,9 +16,9 @@ from underthesea import word_tokenize
16
  #from phoBERT import BERT_predict
17
 
18
  # Load tokenizer
19
- fp = Path(__file__).with_name('tokenizer.pkl')
20
- with open(fp,mode="rb") as f:
21
- tokenizer = pickle.load(f)
22
 
23
  #Load LSTM
24
  #fp = Path(__file__).with_name('lstm_model.h5')
@@ -40,7 +40,7 @@ def tokenizer_pad(tokenizer,comment_text,max_length=200):
40
  return padded_sequences
41
 
42
  def LSTM_predict(x):
43
- x = tokenizer_pad(tokenizer=tokenizer,comment_text=x)
44
 
45
  pred_proba = LSTM_model.predict(x)[0]
46
 
@@ -51,7 +51,7 @@ def LSTM_predict(x):
51
  return pred_proba
52
 
53
  def GRU_predict(x):
54
- x = tokenizer_pad(tokenizer=tokenizer,comment_text=x)
55
 
56
 
57
  pred_proba = GRU_model.predict(x)[0]
 
16
  #from phoBERT import BERT_predict
17
 
18
  # Load tokenizer
19
+ # fp = Path(__file__).with_name('tokenizer.pkl')
20
+ # with open(fp,mode="rb") as f:
21
+ # tokenizer = pickle.load(f)
22
 
23
  #Load LSTM
24
  #fp = Path(__file__).with_name('lstm_model.h5')
 
40
  return padded_sequences
41
 
42
  def LSTM_predict(x):
43
+ # x = tokenizer_pad(tokenizer=tokenizer,comment_text=x)
44
 
45
  pred_proba = LSTM_model.predict(x)[0]
46
 
 
51
  return pred_proba
52
 
53
  def GRU_predict(x):
54
+ # x = tokenizer_pad(tokenizer=tokenizer,comment_text=x)
55
 
56
 
57
  pred_proba = GRU_model.predict(x)[0]