PaddleNLP icon indicating copy to clipboard operation
PaddleNLP copied to clipboard

[Question]: 关于使用ErnieForGeneration的如何生成句子

Open hl123-123 opened this issue 2 years ago • 1 comments

请提出你的问题

我根据使用PaddleNLP预训练模型ERNIE-GEN生成诗歌 这个项目学习的ernie gen的句子生成解码策略,想直接使用预训练权重用ErnieForGeneration 生成句子 具体详见我这个aistudio项目 : https://aistudio.baidu.com/aistudio/projectdetail/4923792

就是使用ErnieForGeneration 的例子我除了上面这个写诗歌的我找不到其他的,然后我想问下是你们权重参数的问题,还是我这个解码策略的问题

hl123-123 avatar Oct 29 '22 16:10 hl123-123

您好,您是希望用ernie gen做其他生成任务,这个暂时没有例子,做的话只要把 https://github.com/PaddlePaddle/PaddleNLP/tree/develop/model_zoo/ernie-gen#%E6%95%B0%E6%8D%AE%E5%87%86%E5%A4%87 这里的诗歌数据换成您那边需要的数据就可以了,比如 https://github.com/PaddlePaddle/PaddleNLP/tree/develop/applications/text_summarization/pegasus#%E6%95%B0%E6%8D%AE%E5%87%86%E5%A4%87 这里的摘要数据转换成和ernie gen里一样的数据格式

只就 我根据使用PaddleNLP预训练模型ERNIE-GEN生成诗歌这个项目学习的ernie gen的句子生成解码策略 学习生成策略这个的话其实不是特别推荐ernie gen和https://aistudio.baidu.com/aistudio/projectdetail/4923792,因为ernie gen的解码生成策略比较特殊,infilling beam search,这个策略相比标准的beam search和其他采样策略使用的较少,也会复杂一点

guoshengCS avatar Nov 02 '22 02:11 guoshengCS

This issue is stale because it has been open for 60 days with no activity. 当前issue 60天内无活动,被标记为stale。

github-actions[bot] avatar Jan 02 '23 00:01 github-actions[bot]

This issue was closed because it has been inactive for 14 days since being marked as stale. 当前issue 被标记为stale已有14天,即将关闭。

github-actions[bot] avatar Jan 16 '23 00:01 github-actions[bot]