macanv / BERT-BiLSTM-CRF-NER

Tensorflow solution of NER task Using BiLSTM-CRF model with Google BERT Fine-tuning And private Server services
https://github.com/macanv/BERT-BiLSMT-CRF-NER
4.67k stars 1.25k forks source link

句子对问题,效果类似随机(已在run_classifier.py下运行,效果可接受) #365

Open robblecrunch opened 3 years ago

robblecrunch commented 3 years ago

我使用bert_base布署了二个服务,一是意图识别,效果非常好。

二是句子对相似性。识别效果不好,好像随机。我的代码如下:

coding=utf-8

import csv from bert_base.client import BertClient

for row in open('./test.tsv'): tag = row.split('\t')[0].strip() str1=row.split('\t')[1].strip() str2=row.split('\t')[2].strip()

with BertClient(show_server_config=False, check_version=False, check_length=False,
    mode="CLASS", port=7006, port_out=7007) as bc:
    res = bc.encode(['%s ||| %s' % (str1, str2)], is_tokenized = False)

print(res)
robblecrunch commented 3 years ago

bert_base版本是:0.09

cxx-cindy commented 2 years ago

你好,用的模型是bert+bilstm吗?