请问作者有在其它数据集尝试GP模型吗?
有个疑惑,自己搜集了一些预料,用bert基础版预训练模型做了个训练,然后再测试集上预测时,出现了预测实体多且长的问题。
测试集一条样本:
{
"text": "**政府宣布2019年国防开支将比前一年增长7.5%,超过预计今年的经济增长率。第十三届全国人大第二次会议星期二(2019年3月5日)在开幕时公布的政府预算报告显示,今年的国防开支将达到11899亿元人民币,相当于大约1780亿美元。外界一般认为,**实际的军事开支可能高出政府公开的国防预算金额。**国防部公布的消息说,今年的国防预算将重点支持国防和军队改革,全面推动国防和军队现代化建设。**每年一度的国防开支预告一直受到国际广泛关注。各国试图从中了解**战略意图的变化和发展。",
"entities": [
{
"start_idx": 0,
"end_idx": 4,
"type": "ORG",
"entity": "**政府"
},
{
"start_idx": 6,
"end_idx": 11,
"type": "TIM",
"entity": "2019年"
},
{
"start_idx": 18,
"end_idx": 20,
"type": "NUM",
"entity": "一年"
},
{
"start_idx": 57,
"end_idx": 66,
"type": "TIM",
"entity": "2019年3月5日"
},
{
"start_idx": 93,
"end_idx": 103,
"type": "NUM",
"entity": "11899亿元人民币"
},
{
"start_idx": 109,
"end_idx": 116,
"type": "NUM",
"entity": "1780亿美元"
},
{
"start_idx": 124,
"end_idx": 126,
"type": "LOC",
"entity": "**"
},
{
"start_idx": 149,
"end_idx": 154,
"type": "ORG",
"entity": "**国防部"
},
{
"start_idx": 196,
"end_idx": 198,
"type": "LOC",
"entity": "**"
},
{
"start_idx": 228,
"end_idx": 230,
"type": "LOC",
"entity": "**"
}
]
}
预测结果:
{
"text": "**政府宣布2019年国防开支将比前一年增长7.5%,超过预计今年的经济增长率。第十三届全国人大第二次会议星期二(2019年3月5日)在开幕时公布的政府预算报告显示,今年的国防开支将达到11899亿元人民币,相当于大约1780亿美元。外界一般认为,**实际的军事开支可能高出政府公开的国防预算金额。**国防部公布的消息说,今年的国防预算将重点支持国防和军队改革,全面推动国防和军队现代化建设。**每年一度的国防开支预告一直受到国际广泛关注。各国试图从中了解**战略意图的变化和发展。",
"pred_entities": [
{
"start_idx": 0,
"end_idx": 1,
"type": "TIM",
"entity": "中"
},
{
"start_idx": 0,
"end_idx": 10,
"type": "TIM",
"entity": "**政府宣布2019"
},
{
"start_idx": 0,
"end_idx": 12,
"type": "TIM",
"entity": "**政府宣布2019年国"
},
{
"start_idx": 0,
"end_idx": 24,
"type": "TIM",
"entity": "**政府宣布2019年国防开支将比前一年增长7."
},
{
"start_idx": 0,
"end_idx": 34,
"type": "TIM",
"entity": "**政府宣布2019年国防开支将比前一年增长7.5%,超过预计今年的"
},
{
"start_idx": 0,
"end_idx": 46,
"type": "TIM",
"entity": "**政府宣布2019年国防开支将比前一年增长7.5%,超过预计今年的经济增长率。第十三届全国"
},
...
{
"start_idx": 236,
"end_idx": 240,
"type": "WEA",
"entity": "化和发展"
},
{
"start_idx": 237,
"end_idx": 240,
"type": "WEA",
"entity": "和发展"
}
]
}
然后,分析了下代码,发现 decode_ent 这里预测实体的起止索引向量维度很高
d = np.where(pred_matrix > threshold)
print(np.array(d).shape)
# Out[4]: (3, 112304)
看起来,模型并没有很好地预测出实体的边界,自己检查过已标注的实体,index正常。想问下,作者有遇到类似情况吗?还是说GP模型在实体较长、嵌套较深、或者上下文信息较丰富的情况下就是会出现这种情况。感谢!