leefsir / triplet_extraction

知识图谱三元组抽取(实体-关系-实体,实体-属性-属性值)
Apache License 2.0
100 stars 18 forks source link

model predict error #5

Open RyanYip-Kat opened 3 years ago

RyanYip-Kat commented 3 years ago

When I run model_predict.py as described in readme ,I got the error: Traceback (most recent call last): File "model_predict.py", line 17, in print(model.predict(text)) File "/home/jovyan/work/triplet_extraction/train/entity_relation_extract.py", line 176, in predict ) for s, p, o in spoes File "/home/jovyan/work/triplet_extraction/train/entity_relation_extract.py", line 176, in ) for s, p, o in spoes KeyError: 11

And how can I fix it?Thanks!

leefsir commented 3 years ago

In this position,When you run predict,   self.i2p_dict keys will become str, but the 'p' types is int. You need transition it's types to str

------------------ 原始邮件 ------------------ 发件人: "leefsir/triplet_extraction" @.>; 发送时间: 2021年7月26日(星期一) 上午8:42 @.>; @.***>; 主题: [leefsir/triplet_extraction] model predict error (#5)

When I run model_predict.py as described in readme ,I got the error: Traceback (most recent call last): File "model_predict.py", line 17, in print(model.predict(text)) File "/home/jovyan/work/triplet_extraction/train/entity_relation_extract.py", line 176, in predict ) for s, p, o in spoes File "/home/jovyan/work/triplet_extraction/train/entity_relation_extract.py", line 176, in ) for s, p, o in spoes KeyError: 11

And how can I fix it?Thanks!

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub, or unsubscribe.

RyanYip-Kat commented 3 years ago

OK!Thanks!