修改验证集
This commit is contained in:
parent
0ca26576a4
commit
13c1691426
@ -1,6 +1,6 @@
|
|||||||
# bert-utils
|
# bert-utils
|
||||||
|
|
||||||
本文基于Google开源的[BERT]()代码进行了进一步的简化,方便生成句向量与做文本分类
|
本文基于Google开源的[BERT](https://github.com/google-research/bert)代码进行了进一步的简化,方便生成句向量与做文本分类
|
||||||
|
|
||||||
1、下载BERT中文模型
|
1、下载BERT中文模型
|
||||||
|
|
||||||
|
Can't render this file because it is too large.
|
@ -664,13 +664,13 @@ class BertSim:
|
|||||||
|
|
||||||
if __name__ == '__main__':
|
if __name__ == '__main__':
|
||||||
sim = BertSim()
|
sim = BertSim()
|
||||||
# sim.set_mode(tf.estimator.ModeKeys.TRAIN)
|
sim.set_mode(tf.estimator.ModeKeys.TRAIN)
|
||||||
# sim.train()
|
sim.train()
|
||||||
# sim.set_mode(tf.estimator.ModeKeys.EVAL)
|
sim.set_mode(tf.estimator.ModeKeys.EVAL)
|
||||||
# sim.eval()
|
sim.eval()
|
||||||
sim.set_mode(tf.estimator.ModeKeys.PREDICT)
|
# sim.set_mode(tf.estimator.ModeKeys.PREDICT)
|
||||||
while True:
|
# while True:
|
||||||
sentence1 = input('sentence1: ')
|
# sentence1 = input('sentence1: ')
|
||||||
sentence2 = input('sentence2: ')
|
# sentence2 = input('sentence2: ')
|
||||||
predict = sim.predict(sentence1, sentence2)
|
# predict = sim.predict(sentence1, sentence2)
|
||||||
print(f'similarity:{predict[0][1]}')
|
# print(f'similarity:{predict[0][1]}')
|
||||||
|
Loading…
Reference in New Issue
Block a user