Code Monkey home page Code Monkey logo

Comments (6)

yuwl798180 avatar yuwl798180 commented on July 20, 2024

你好,index这个key当初设想是句子中存在相同实体时防止错误标记位置。
举个例子:南京大学位于南京的东北方。那么 <南京大学,南京>这个实体中,tail的南京 index 应该是6而不是0。
之所以需要强调这点,是因为后续会对头尾实体的位置做特殊标注。
比如上面例子会处理成:南京大学位于南京的东北方。
如果头尾实体有重叠,就会导致这种处理出现错误。
同时还有另一种情况:句子有相同实体。比如:南京大学位于南京的东北方,南京大学新校区的风景很美丽。后一个南京大学和南京并不是我们所希望判断关系的实体对。
当然,如果你的语料中这些特殊情况没有,或者比较少可以忽略不计,那么index这个key确实是不需要的。
之前我把这块写死了,后续会更改掉。

from deepke.

yuwl798180 avatar yuwl798180 commented on July 20, 2024

不好意思,刚看了你的报错信息,我弄错了。。

你的报错信息是(看最后一行):

File "/home/wgh/deepke/preprocess.py", line 90, in
relation_data = sorted(relation_data, key=lambda i: int(i['index']))
KeyError: 'index'

这句话意思就是:你的 relation.csv 文件里没有 index 这一列。
我们需要把关系也序列化一下的,比如10个关系,那么就序列化为1-10(其中0为NA)。

from deepke.

wangguanhua avatar wangguanhua commented on July 20, 2024

额,我数据集里是有index的,我所有数据集都是按照你的格式做的。不止index,head,tail等都曾爆keyerror。当我把你main.py内所说可注释掉的两行代码注释掉后,程序正常运行。

from deepke.

yuwl798180 avatar yuwl798180 commented on July 20, 2024

你注释掉的两行是预处理的代码。。
注释掉了,你是怎么运行通顺的呀,难道你之前已经预处理过了?
建议你再检查下data文件,relation.csv是一个 csv,是不是格式错误的问题。

from deepke.

cqguowangshu avatar cqguowangshu commented on July 20, 2024

from deepke.

wangguanhua avatar wangguanhua commented on July 20, 2024

from deepke.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.