Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

使用窗口去切分句子有相关的参考材料吗? #2

Closed
Mariobai opened this issue Jan 9, 2019 · 8 comments
Closed

使用窗口去切分句子有相关的参考材料吗? #2

Mariobai opened this issue Jan 9, 2019 · 8 comments

Comments

@Mariobai
Copy link

Mariobai commented Jan 9, 2019

我想问一下你的用窗口去切分句子是自己想的还是看Paper的啊?如果是看Paper可以分享一下Paper的链接吗?

@beader
Copy link
Owner

beader commented Jan 9, 2019

用滑动窗口去切句子是一种比较常见的做法,但是我在比赛中用到的方法有一点点不一样,不清楚是否有在别的 Paper 中出现过。

@Mariobai
Copy link
Author

Mariobai commented Jan 9, 2019

您好。您能说一下您的程序每个部分是干嘛的吗?对于原始数据集做处理的部分的程序有吗?具体在什么地方呢?每个部分的程序的大概说一下他的功能是干嘛的呢?

@beader
Copy link
Owner

beader commented Jan 9, 2019

数据处理部分的代码请参考 ./data_utils/data_utils.py
为了数据处理的方便,抽象出了几个类。

  • Entity 用来表示一个命名实体
  • Sentence 用来表示一个句子,句子包含文本,若干个 Entity,以及该 SentenceDocument 中的偏移量 offset
  • Document 用来表示一篇文章,一个 Document 包含文本,以及若干个 Entity
  • Documents 用来表示一个文档列表,方便你像操作列表一样得到每一个 Document

因为我们的模型是对一个句子做预测,但是你提交结果是对一篇文章提交结果。因此这里就涉及到 EntitySentenceDocument 上的坐标转换。

譬如一个 Document 有 20 个字 [w0, w1, ..., w19],两个 Entities,坐标分别是 (3, 5), (12, 15)。如果把这个 Document 切分成两个 Sentence 的话,有

Sentence 1 - text: [w0, w1, ..., w9], entities: [(3, 5)], offset: 0
Sentence 2 - text: [w10, w11, ..., w19], entities: [(2, 5)], offset: 10

通过记录 sentence 在 document 中的偏移量 offset,之后可以再把针对 sentence 做预测得到的 entity 还原到 document 的坐标下。

@beader beader closed this as completed Jan 10, 2019
@beader beader reopened this Jan 10, 2019
@Mariobai
Copy link
Author

好的。谢谢。您好。可以加一下您的QQ吗?我想复现一下您的这个项目。

@BeerTai
Copy link

BeerTai commented Feb 15, 2019

您好,请问一下最终的图谱您有没有构造出来?对于这种实体数目比较小的图谱该怎么构造?谢谢~

@beader
Copy link
Owner

beader commented Feb 15, 2019

您好,请问一下最终的图谱您有没有构造出来?对于这种实体数目比较小的图谱该怎么构造?谢谢~

这个比赛没有要求真的去构造知识图谱。您可以考虑一下图数据库,比如 TigerGraph, ArangoDB 或者 Neo4j

@beader beader changed the title 请教 使用窗口去切分句子有相关的参考材料吗? May 15, 2019
@WeiYichenBuaaer
Copy link

为啥是5的长度嘞?

@beader
Copy link
Owner

beader commented Sep 23, 2019

长度为5只是举例子

@beader beader closed this as completed Sep 23, 2019
@beader beader pinned this issue Sep 23, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants