def __init__(self, vocab_file, host='localhost', port=8888, batch_size=32, num_coroutine=1, timeout=10.0, max_seqlen=128):
    host_port = ('tcp://%s:%d' % (host, port))
    client = super(ErnieClient, self).__init__(host_port, batch_size=batch_size, num_coroutine=num_coroutine, timeout=timeout)
    self.vocab = {j.strip().split(b'\t')[0].decode('utf8'): i for (i, j) in enumerate(open(vocab_file, 'rb'))}
    self.tokenizer = util.data.CharTokenizer(self.vocab.keys())
    self.max_seqlen = max_seqlen
    self.cls_id = self.vocab['[CLS]']
    self.sep_id = self.vocab['[SEP]']
def __init__(self, vocab_file, host='localhost', port=8888, batch_size=32, num_coroutine=1, timeout=10.0, max_seqlen=128):
    host_port = ('tcp://%s:%d' % (host, port))
    client = super(ErnieClient, self).__init__(host_port, batch_size=batch_size, num_coroutine=num_coroutine, timeout=timeout)
    self.vocab = {j.strip().split(b'\t')[0].decode('utf8'): i for (i, j) in enumerate(open(vocab_file, 'rb'))}
    self.tokenizer = util.data.CharTokenizer(self.vocab.keys())
    self.max_seqlen = max_seqlen
    self.cls_id = self.vocab['[CLS]']
    self.sep_id = self.vocab['[SEP]']