update code
Browse files
app.py
CHANGED
@@ -3,24 +3,22 @@ import siameser
|
|
3 |
import norm_typing
|
4 |
import json
|
5 |
import logging
|
6 |
-
#
|
7 |
-
import
|
8 |
-
import
|
9 |
-
import
|
10 |
-
import utils
|
11 |
|
12 |
std = siameser.Siameser(stadard_scope='all')
|
13 |
|
14 |
-
#
|
15 |
-
|
16 |
-
|
17 |
-
|
18 |
-
|
19 |
-
|
20 |
-
|
21 |
-
|
22 |
-
|
23 |
-
os.chmod(file_path, stat.S_IRUSR | stat.S_IWUSR)
|
24 |
|
25 |
count = 0
|
26 |
|
@@ -28,8 +26,7 @@ def standardize(raw_address):
|
|
28 |
global count
|
29 |
raw_address = norm_typing.norm_vietnamese_sentence_accent(raw_address)
|
30 |
top_1, top_5 = std.get_top_k(raw_address, 5)
|
31 |
-
#
|
32 |
-
utils.save_result(file_path, top_5)
|
33 |
count += 1
|
34 |
if count % 10 == 9:
|
35 |
print(f'Request: {count}')
|
|
|
3 |
import norm_typing
|
4 |
import json
|
5 |
import logging
|
6 |
+
# import os
|
7 |
+
# import parameters
|
8 |
+
# import stat
|
9 |
+
# import utils
|
|
|
10 |
|
11 |
std = siameser.Siameser(stadard_scope='all')
|
12 |
|
13 |
+
# directory = parameters.LOG_DIRECTORY
|
14 |
+
# file_path = os.path.join(directory, parameters.LOG_RESULT_FILE)
|
15 |
+
# if not os.path.exists(directory):
|
16 |
+
# os.mkdir(directory)
|
17 |
+
# os.chmod(directory, stat.S_IRWXU)
|
18 |
+
# data = []
|
19 |
+
# with open(file_path, 'w', encoding='utf8') as f:
|
20 |
+
# json.dump(data, f, ensure_ascii=False, indent=4)
|
21 |
+
# os.chmod(file_path, stat.S_IRUSR | stat.S_IWUSR)
|
|
|
22 |
|
23 |
count = 0
|
24 |
|
|
|
26 |
global count
|
27 |
raw_address = norm_typing.norm_vietnamese_sentence_accent(raw_address)
|
28 |
top_1, top_5 = std.get_top_k(raw_address, 5)
|
29 |
+
# utils.save_result(file_path, top_5)
|
|
|
30 |
count += 1
|
31 |
if count % 10 == 9:
|
32 |
print(f'Request: {count}')
|