【问题标题】:What decoder_input_ids should be for sequence-to-sequence Transformer model?对于序列到序列的 Transformer 模型,应该使用什么 decoder_input_ids?
【发布时间】:2020-11-28 02:22:34
【问题描述】:

我使用 HuggingFace 的 Transformers 库来构建基于 BART 和 T5 的序列到序列模型。我仔细阅读了文档和研究论文,但我找不到解码器的输入 (decoder_input_ids) 应该用于序列到序列任务。

两个模型(BART 和 T5)的解码器输入应该与 lm_labels(LM 头的输出)相同还是应该与 input_ids(编码器的输入)相同?

【问题讨论】:

标签: nlp huggingface-transformers


【解决方案1】:

decoder_input_ids(可选)对应labels,labels是提供decoder_input_ids的首选方式。 https://huggingface.co/transformers/glossary.html#decoder-input-ids

这是因为在内部,如果 decoder_input_ids 为 None,它们将通过将标签向右移动来导出,因此您不必自己进行移动。

【讨论】:

    猜你喜欢
    • 2017-12-08
    • 1970-01-01
    • 2017-09-14
    • 2022-01-23
    • 2021-02-28
    • 1970-01-01
    • 2021-08-18
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多