bert-utils icon indicating copy to clipboard operation
bert-utils copied to clipboard

一行代码使用BERT生成句向量,BERT做文本分类、文本相似度计算

Results 56 bert-utils issues
Sort by recently updated
recently updated
newest added

按照你的执行的句向量,但每次 [CLS]和[SEP]之间只能是3个字,如下: INFO:tensorflow:tokens: [CLS] 话 说 今 [SEP] 请问如何修改长度?

predict_from_queue为什么要设置守护线程,去掉有什么影响吗?

多线程怎么保证输入和输出的一致性的,我没看太懂...

update predict method to support batch prediction. 添加对于批量预测的支持。使用方式与原来略有改变,使用及测试见main函数。

除了句向量以外,如何获取每个词的词向量呢

这份代码基于python3还是2啊,tensorflow的版本呢?

有时会报错,ValueError: `generator` yielded an element of shape (0,) where an element of shape (?, 128) was expected。 另外,输入一句话,每个字都会产生一个词向量,最后要把所有的词向量都想加组成句子的词向量吗?

您好,我的笔记本电脑是GTX1070的,跑的时候报ResourceExhaustedError (see above for traceback): OOM when allocating tensor with shape[4096,768] and type float on /job:localhost/replica:0/task:0/device:GPU:0 by allocator GPU_0_bfc 应该是内存不够,这应该怎么办呀?

你好,我想做句子分类。如:上半年证金公司***** (句子),股票(label),单句对应一个分类标签。训练过程已经完成。但在eval过程时,遇到了。tensorflow.python.framework.errors_impl.InvalidArgumentError:assertion failed predictions must be in [0,1] [condition x