lemonhu / open-entity-relation-extraction

Knowledge triples extraction and knowledge base construction based on dependency syntax for open domain text.
MIT License
524 stars 122 forks source link

open-entity-relation-extraction/code/core/entity_combine.py 的第55行注释问题 #12

Open tianyunzhe opened 4 years ago

tianyunzhe commented 4 years ago

您好,您在open-entity-relation-extraction/code/core/entity_combine.py 的第55行注释中表明 词合并: (前后词都是实体) and (前后词的词性相同 or 前词 in ["nz", "j"] or 后词 in ["nz", "j"]) 但是在56行和57行代码中,只有设置前词 in ["nz", "j"] or 后词 in ["nz", "j"],并没有设置 前后词性相同这一个步骤


if (self.is_entity(word.postag) and self.is_entity(words[i-1].postag)
                    and (word.postag in {'nz', 'j'} or words[i-1].postag in {'nz', 'j'})):
                newword += word.lemma

所以这可能是一个可以改进的原因,但根据我的实验目前来看,由于分词的产生的错误,根据词性相同来合并普通实体并不能很好的补充识别命名实体。当然这只是我个人的一个观点了,最后再次感谢您的贡献!

lemonhu commented 4 years ago

好的,谢谢你的建议。