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

[BUG]span_index不一致的问题 #16

Open
micrazy opened this issue Jul 27, 2023 · 2 comments
Open

[BUG]span_index不一致的问题 #16

micrazy opened this issue Jul 27, 2023 · 2 comments

Comments

@micrazy
Copy link

micrazy commented Jul 27, 2023

您好!您在处理数组下标的时候存在不一致的问题:
假设单字符作为aspect或opnion
processor.py
这里通过a2 + 1,实际上的a_end_idx=a_start_idx+1,但
https://github.com/wireless911/span-aste/blob/e158fea27c0926944bf029eefa50b569eb9658f9/models/model.py#L60C3-L60C3
这里的逻辑里单字符的a_end_idx和 a_start_idx是相等的
@wireless911 @ZhihengHao
但似乎对训练不会造成大的影响,只是构造出来的window=1的span是无效的

@wireless911
Copy link
Owner

processor.py
这里a2 + 1是为了获取到当前token
a_start_idx, a_end_idx = self.fetch_offset(" ".join(tokens[:a1]), " ".join(tokens[a1:a2 + 1]))

你可以调试看下window=1时的start_idx 和 end_idx

@micrazy
Copy link
Author

micrazy commented Aug 8, 2023

感谢作者回复~ 我理解这个操作是为了获取当前token的范围 [a_start_idx,a_end_idx),但是在https://github.com/wireless911/span-aste/blob/e158fea27c0926944bf029eefa50b569eb9658f9/models/model.py#L60C3-L60C3 这里,window=1时生成的候选span indice就无用了,因为不可能会有(a_start_idx,a_start_idx)这样的golden span

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