Commit 3165d73c authored by sanlu's avatar sanlu

1612冰箱/冷柜类更新,多线程多渠道API获取数据功能更新。

parent f6485fc9
This source diff could not be displayed because it is too large. You can view the blob instead.
This diff is collapsed.
...@@ -154,7 +154,7 @@ class LSTMNER: ...@@ -154,7 +154,7 @@ class LSTMNER:
return param_dict return param_dict
if __name__ == '__main__': if __name__ == '__main__':
ner = LSTMNER('3513') ner = LSTMNER('1612')
while 1: while 1:
a = input('请输入产品名称:') a = input('请输入产品名称:')
#print(ner.class_dict) #print(ner.class_dict)
......
...@@ -39,7 +39,7 @@ class LSTMNER: ...@@ -39,7 +39,7 @@ class LSTMNER:
self.class_dict = dict_create(categorycode) self.class_dict = dict_create(categorycode)
self.EMBEDDING_DIM = 300 self.EMBEDDING_DIM = 300
self.EPOCHS = 5 self.EPOCHS = 5
self.BATCH_SIZE = 32 self.BATCH_SIZE = 24
self.NUM_CLASSES = len(self.class_dict) self.NUM_CLASSES = len(self.class_dict)
self.VOCAB_SIZE = len(self.word_dict) self.VOCAB_SIZE = len(self.word_dict)
self.TIME_STAMPS = 150 self.TIME_STAMPS = 150
...@@ -209,5 +209,5 @@ class LSTMNER: ...@@ -209,5 +209,5 @@ class LSTMNER:
f.close() f.close()
if __name__ == '__main__': if __name__ == '__main__':
ner = LSTMNER('3513') ner = LSTMNER('1612')
ner.train_model() ner.train_model()
\ No newline at end of file
...@@ -15,6 +15,19 @@ import re ...@@ -15,6 +15,19 @@ import re
from lstm_predict import LSTMNER from lstm_predict import LSTMNER
import os import os
from ZOL_Crawler import CRAWLER from ZOL_Crawler import CRAWLER
import threading
exitFlag = 0
class myThread (threading.Thread):
def __init__(self, channel):
threading.Thread.__init__(self)
self.channel = channel
self.data_api = data_fetch(model='LXWL_model', localhost=False, source=f'ZH_{self.channel}')
def run(self):
print ("开始线程:" + self.channel)
self.data_api.run()
print ("退出线程:" + self.channel)
def param_extract_function(data_table,channel): def param_extract_function(data_table,channel):
#读取数据 #读取数据
...@@ -552,11 +565,31 @@ class data_fetch(): ...@@ -552,11 +565,31 @@ class data_fetch():
if __name__ == '__main__': if __name__ == '__main__':
thread_DL = myThread('DL')
thread_DZ = myThread('DZ')
thread_YHD = myThread('YHD')
thread_OFS = myThread('OFS')
thread_ZCSM = myThread('ZCSM')
thread_DW = myThread('DW')
thread_DL.start()
thread_DZ.start()
thread_YHD.start()
thread_OFS.start()
thread_ZCSM.start()
thread_DW.start()
thread_DL.join()
thread_DZ.join()
thread_YHD.join()
thread_OFS.join()
thread_ZCSM.join()
thread_DW.join()
print('完毕!')
'''
channel = 'SN' channel = 'SN'
data_api = data_fetch(model='LXWL_model', localhost=False, source=f'ZH_{channel}') data_api = data_fetch(model='LXWL_model', localhost=False, source=f'ZH_{channel}')
data_api_table = data_api.run() data_api_table = data_api.run()
''' #param_extract_function(data_api_table,channel)
table = pd.read_excel('api_data/ZH_SN_no_category_data_2020-01-08.xlsx') '''
return_error(table) \ No newline at end of file
'''
#param_extract_function(data_api_table,channel)
\ No newline at end of file
This diff is collapsed.
)
UNK
R
N
Y
-
p
T
7
C
线
s
B
L
b
d
(
M
4
v
G
Q
8
3
Z
6
P
O
E
c
h
H
J
X
;
S
V
D
5
+
m
/
9
%
i
2
A
I
u
t
1
a
U
W
F
0
e
.
r
x
o
l
n
K
 
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment