HMPhuoc commited on
Commit
39e27f0
1 Parent(s): aa87a91

Update main.py

Browse files
Files changed (1) hide show
  1. main.py +1 -88
main.py CHANGED
@@ -1,5 +1,5 @@
1
  from flask import Flask, request
2
- from app import judge, judgePlus, judgeBert, tokenize, lstm_predict, gru_predict
3
  from phoBERT import BERT_predict
4
  from flask_cors import CORS
5
  import threading
@@ -45,93 +45,6 @@ def time():
45
  l100 = []
46
  l200 = []
47
 
48
- t_lstm_10 = []
49
- t_lstm_100 = []
50
- t_lstm_200 = []
51
-
52
- t_gru_10 = []
53
- t_gru_100 = []
54
- t_gru_200 = []
55
-
56
- t_bert_10 = []
57
- t_bert_100 = []
58
- t_bert_200 = []
59
-
60
- #LSTM
61
- for com in l10:
62
- com = tokenize(com)
63
- t1 = time.time()
64
- lstm_predict(com)
65
- t2 = time.time()
66
- t = t2-t1
67
- t_lstm_10.append(t)
68
-
69
- for com in l100:
70
- com = tokenize(com)
71
- t1 = time.time()
72
- lstm_predict(com)
73
- t2 = time.time()
74
- t = t2-t1
75
- t_lstm_100.append(t)
76
-
77
- for com in l200:
78
- com = tokenize(com)
79
- t1 = time.time()
80
- lstm_predict(com)
81
- t2 = time.time()
82
- t = t2-t1
83
- t_lstm_200.append(t)
84
-
85
- #GRU
86
- for com in l10:
87
- com = tokenize(com)
88
- t1 = time.time()
89
- gru_predict(com)
90
- t2 = time.time()
91
- t = t2-t1
92
- t_gru_10.append(t)
93
-
94
- for com in l100:
95
- com = tokenize(com)
96
- t1 = time.time()
97
- gru_predict(com)
98
- t2 = time.time()
99
- t = t2-t1
100
- t_gru_100.append(t)
101
-
102
- for com in l200:
103
- com = tokenize(com)
104
- t1 = time.time()
105
- gru_predict(com)
106
- t2 = time.time()
107
- t = t2-t1
108
- t_gru_200.append(t)
109
-
110
- #BERT
111
- for com in l10:
112
- com = tokenize(com)
113
- t1 = time.time()
114
- BERT_predict(com)
115
- t2 = time.time()
116
- t = t2-t1
117
- t_bert_10.append(t)
118
-
119
- for com in l100:
120
- com = tokenize(com)
121
- t1 = time.time()
122
- BERT_predict(com)
123
- t2 = time.time()
124
- t = t2-t1
125
- t_bert_100.append(t)
126
-
127
- for com in l200:
128
- com = tokenize(com)
129
- t1 = time.time()
130
- BERT_predict(com)
131
- t2 = time.time()
132
- t = t2-t1
133
- t_bert_200.append(t)
134
-
135
  return 'ok'
136
 
137
 
 
1
  from flask import Flask, request
2
+ from app import judge, judgePlus, judgeBert
3
  from phoBERT import BERT_predict
4
  from flask_cors import CORS
5
  import threading
 
45
  l100 = []
46
  l200 = []
47
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
48
  return 'ok'
49
 
50