Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

关于unilm文本生成 #8

Open
thinkingmanyangyang opened this issue Jan 6, 2021 · 1 comment
Open

关于unilm文本生成 #8

thinkingmanyangyang opened this issue Jan 6, 2021 · 1 comment

Comments

@thinkingmanyangyang
Copy link

苏神您好,我看了下您那个自动生成标题的代码,有一个关于预测时批次处理的问题。举个例子,输入时sentence1和sentence2,经过tokenizer的处理后会变成[cls s1 sep s2 sep padding]的形式。但是在预测的时候时由于没有sentence2,把输入padding到同一长度后会变为[cls s1 sep padding],那么sentence2相对于训练时候的position ids会比原来偏移量多了padding的数目,请问这个会对模型的预测有问题吗?bert4keras的源码有些长,我理解的也比较浅薄,希望苏神可以解答一下,多谢。

@bojone
Copy link

bojone commented Jan 27, 2021

预测的时候是单个样本进行的,没有padding

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants