2024-07-05 18:29:22 +08:00
|
|
|
import zmq
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
context = zmq.Context()
|
|
|
|
|
socket = context.socket(zmq.REQ)
|
|
|
|
|
socket.connect("tcp://localhost:6668")
|
|
|
|
|
|
|
|
|
|
filter_w = (213, 540)
|
|
|
|
|
filter_h = (120, 360)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
while True:
|
|
|
|
|
a = input("")
|
|
|
|
|
socket.send_string("")
|
|
|
|
|
resp = socket.recv_pyobj()
|
|
|
|
|
print(resp)
|
|
|
|
|
if resp.get('code') == 0:
|
|
|
|
|
text = ''
|
|
|
|
|
for item in resp.get('content'):
|
2024-08-04 10:04:27 +08:00
|
|
|
if item['probability']['average'] < 0.80:
|
2024-07-05 18:29:22 +08:00
|
|
|
continue
|
|
|
|
|
text += item['words']
|
|
|
|
|
print(text)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|