brokenwind / bertsimilarity Goto Github PK
View Code? Open in Web Editor NEWComputing similarity of two sentences with google's BERT algorithm。利用Bert计算句子相似度。语义相似度计算。文本相似度计算。
Computing similarity of two sentences with google's BERT algorithm。利用Bert计算句子相似度。语义相似度计算。文本相似度计算。
INFO:tensorflow:Saving checkpoints for 0 into ...../model.ckpt.
I1107 14:10:38.075445 140053106304832 basic_session_run_hooks.py:606] Saving checkpoints for 0 into ....../model.ckpt.
到这就停了。
Top命令,也没找到python的进程。
4核cpu. ubuntu18.04.
有什么解决办法么?
您好,请问可以在百忙之中将similarity.py文件中的各个步骤尽可能详细的加一些注释吗,都知道是干什么的,数据维度什么的,有助于学习与理解。万分感谢 抱拳
使用tf 2.5运行报错
ValueError: Tensor-typed variable initializers must either be wrapped in an init_scope or callable (e.g., tf.Variable(lambda : tf.truncated_normal([10, 40]))
) when building functions. Please file a feature request if this restriction inconveniences you.
下载作者训练好的模型做预测,同样的测试案例,相似度却很低
我通过网盘中的数据,已经跑通了程序。现在想用自己的数据训练,应该怎么训练呢?
@Brokenwind
请问最终预测的输出是相似度百分数还是二分类标签0和1
您好,请问使用的是gpu还是cpu训练的,能设置吗,在哪里设置呢
请问预测的相似度和不相似度的百分数具体是怎么计算出来的,最后一层的处理步骤能说下吗
调用代码如下
`sim.set_mode(tf.estimator.ModeKeys.PREDICT)
predict_start_time = datetime.now()
predict = sim.predict(text_1, text_2)
predict_end_time = datetime.now()
print("预测predict花费时间:", (predict_end_time - predict_start_time).total_seconds())
score = predict[0][1]
response["score"] = str(score)
response["words"] = request_body
print('TextSimilarity time used: {} sec'.format((datetime.now() - start).total_seconds()))`
实际结果如下:
INFO:tensorflow:tokens: [CLS] 借 呗 逾 期 短 信 通 知 [SEP] 如 何 购 买 花 呗 短 信 通 知 [SEP]
INFO:tensorflow:input_ids: 101 955 1446 6874 3309 4764 928 6858 4761 102 1963 862 6579 743 5709 1446 4764 928 6858 4761 102 0 0 0 0 0 0 0 0 0 0 0
INFO:tensorflow:input_mask: 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 0 0 0 0 0 0 0 0 0 0 0
INFO:tensorflow:segment_ids: 0 0 0 0 0 0 0 0 0 0 1 1 1 1 1 1 1 1 1 1 1 0 0 0 0 0 0 0 0 0 0 0
INFO:tensorflow:label: 0 (id = 0)
预测predict花费时间: 0:00:07.576646
TextSimilarity time used: 8.100247 sec
请问tensorflow的版本是多少啊
您好,我看项目中没有代码提到chinese_L-12_H-768_A-12词向量模型,是没有使用吗
用这个提供的训练好的模型,同样的测试案例,相似度很低
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.