wtangdev/UniRel

模型中是如何获取头尾实体,交互只是预训练模型的注意力矩阵吗?如何输出保存最好的模型呢,我跑出的结果相差很大

Closed this issue · 6 comments

模型中是如何获取头尾实体,交互只是预训练模型的注意力矩阵吗?如何输出保存最好的模型呢,我跑出的结果相差很大

你好,在 https://github.com/wtangdev/UniRel/blob/1dbc2e72d0ed1a8eeb418883dd8dbb0cd797876d/run.py#L340C17-L340C32 中会保存dev集上最好结果的checkpoint。

效果不好,请确认下使用的是否的是正确的数据集,test_data_tyep = unirel_span对应的是nyt数据集(而不是nyt_star)

我按照正确的方式下载webnlg数据并训练,报如下错误:
embeddings = inputs_embeds + token_type_embeddings
RuntimeError: The size of tensor a (334) must match the size of tensor b (322) at non-singleton dimension 1
这是为什么,数据集用的是readme.md所提供的。

抱歉回复的很晚。

在 run.py line 30:
DataProcessorDict = {
"nyt_all_sa": UniRelDataProcessor,
"unirel_span": UniRelDataProcessor
}
可以看到只有nyt_all_sa/unirel_span两种,其中nyt_all_sa是适合 nyt*/webnlg*的,unirel_span是适合nyt/webnlg的。(也抱歉命名容易产生误解)

我按照正确的方式下载webnlg数据并训练,报如下错误: embeddings = inputs_embeds + token_type_embeddings RuntimeError: The size of tensor a (334) must match the size of tensor b (322) at non-singleton dimension 1 这是为什么,数据集用的是readme.md所提供的。

可以看看是不是没有区分WebNLG和WebNLG*数据集。