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

resolve_data.py可能存在的问题和一些疑惑 #18

Open
boyang9602 opened this issue Jul 26, 2021 · 4 comments
Open

resolve_data.py可能存在的问题和一些疑惑 #18

boyang9602 opened this issue Jul 26, 2021 · 4 comments

Comments

@boyang9602
Copy link

您好,

请问resolve_data.py的第120行 为何返回1?我的理解是这个词不在vocabulary中,所以要返回unknown对应得值,但在vocabulary.txt中,unknown的对应的值其实是0. 如果是这种情况的话用return vocabulary['unknown']可以避免这种错误.

还有是有点好奇lca是指什么,build_lca看起来是把每一个节点的祖先按顺序找出来了(其中包括该节点本身),并返回了这些祖先节点和terminal的节点。然后在line_mask中他的返回值只是被用来生成邻接矩阵。

另外Rule.txt是如何生成的呢?我最开始读论文的时候的理解是Rule都是python语法规则里面的东西,但是现在发现里边有很多项目相关的内容,例如

 attr true Huffer
 attr true Misha
 attr true Leokk
@zysszy
Copy link
Owner

zysszy commented Jul 26, 2021

您好,

我看vocabulary里面确实不是1,应该是当时改的时候没改过来,这里确实有点问题,不过不是很影响最后的效果。

LCA 本来是最近公共祖先,后来被我改了就不是这个算法了,名字没改,不好意思。

Rule.txt 是从训练集中的抽象语法树中收集出来的,其中包括一些项目相关内容(训练集中所存在的规则序列)。

Zeyu

@boyang9602
Copy link
Author

您好,我看了您的数据预处理的脚本,还是没有理清楚Rule.txt的产生规则。整体上来说,里边每一行都是父节点 true 子节点1 子节点2 ...,但是哪一些规则会被写进去呢?

从Rule.txt中的内容,我感觉如果是一个terminal节点,String类型,并且它出现在了自然语言描述中,那么它就用copy,否则的话就会被写进Rule.txt中。不知道我理解的对不对?

@zysszy
Copy link
Owner

zysszy commented Aug 26, 2021

您好,我看了您的数据预处理的脚本,还是没有理清楚Rule.txt的产生规则。整体上来说,里边每一行都是父节点 true 子节点1 子节点2 ...,但是哪一些规则会被写进去呢?

从Rule.txt中的内容,我感觉如果是一个terminal节点,String类型,并且它出现在了自然语言描述中,那么它就用copy,否则的话就会被写进Rule.txt中。不知道我理解的对不对?

对~你理解的是对的,如果能copy就不写到规则里,否则就写到规则里。

Zeyu

@boyang9602
Copy link
Author

明白了,非常感谢!

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

2 participants