Comments (2)
@BoomBaYang [SEP]是BERT中的符号,用于表示sentence间的分隔符,会在一条完整的sentence结尾添加一个[SEP]符号表示句子结束。
你有修改代码吗?如果没有的话,可能的原因是你sentence的长度超过了超参max_seq_len,原sentence被截断为max_seq_len - 1,在最后append [SEP],在解码的时候,把最后一位标记截断。因为要对投入BERT的sentence做字符转换的保护,必然会将最后一位的标记设置为[SEP]。
你可以试一下把max_seq_len增大一点,256或512,但这样会降低模型的解码速度。
另外一种方法就是你自己调整一下训练&测试数据的长度,控制到max_seq_len以下。
from bertner.
原来是这样,我把max_seq_len设置的太小了。谢谢你的回答!
from bertner.
Related Issues (20)
- 项目引用格式 HOT 1
- 训练出来模型,同样话predict出来结果不一致,大概是5次中有一次不一样 HOT 10
- ModuleNotFoundError: No module named 'tensorflow.contrib' HOT 1
- What is the use of the .dev file in data? HOT 3
- ValueError: Couldn't find 'checkpoint' file or checkpoints in given directory chinese_L-12_H-768_A-12/bert_model.ckpt HOT 1
- 代码复现第4步(训练)遇到问题 HOT 3
- 训练结果相关问题
- GPU没有被使用
- 如何加入早停机制呢,放钩子? HOT 1
- config_file HOT 1
- lstm_outputs = self.biLSTM_layer(lstm_inputs, self.lstm_dim, self.lengths)为什么 lstm_outputs的维度是(?,?,786)这里的问号为什么不是实数呢?) HOT 4
- 用其他数据集跑,因为数据集标签不同,报错“ KeyError: 'B-Project' ”,请问如何解决? HOT 2
- 请问data里的bio是怎么生成的,如何进行bio标注
- 没有日志 HOT 1
- 有关iteration step epoch的问题 HOT 1
- 有关评估指标的问题 HOT 5
- 请教一下 HOT 1
- 请教一下 precision recall为零的原因
- Testing issues HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from bertner.