aishell cn model, different results between warm test and demo client
Created by: lightsailpro
I run the demo_server using aisheill model and test data. The demo_server.py has the following, basically save the uploaded wave file with sample rate 8000. But the "Warm up test" and demo client got different result with the exact same wave file ( "以前我们国家一直提出保护艾滋病病人的隐私" vs "你们我们国家一直保护令病人的隐私"). Is this because wave format conversion? What should I do in order to duplicate the warm test result?
# write to wav file
file = wave.open(out_filename, 'wb')
file.setnchannels(1)
file.setsampwidth(4)
file.setframerate(8000)
Warming up ... ('Warm-up Test Case %d: %s', 0, u'/home/ml/.cache/paddle/dataset/speech/Aishell/data_aishell/wav/train/S0722/BAC009S0722W0187.wav') Response Time: 0.691690, Transcript: 以前我们国家一直提出保护艾滋病病人的隐私
"""test client""" import struct import socket import sys import argparse import wave
data_list = []
waveFile = wave.open('/home/ml/.cache/paddle/dataset/speech/Aishell/data_aishell/wav/train/S0722/BAC009S0722W0187.wav', 'rb') data = waveFile.readframes(waveFile.getnframes()) data_list.append(data)
if len(data_list) > 0: # Connect to server and send data sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM) sock.connect(("192.168.1.16", 8086)) sent = ''.join(data_list) sock.sendall(struct.pack('>i', len(sent)) + sent) print('Speech[length=%d] Sent.' % len(sent)) # Receive data from the server and shut down received = sock.recv(1024) print "Recognition Results: {}".format(received) sock.close() data_list = []