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

请问predictor_classes.py程序中的问题 #13

Open
xsc1234 opened this issue Jan 5, 2024 · 1 comment
Open

请问predictor_classes.py程序中的问题 #13

xsc1234 opened this issue Jan 5, 2024 · 1 comment

Comments

@xsc1234
Copy link

xsc1234 commented Jan 5, 2024

您好,请问能详细介绍下predictor_classes.py,Predictor这个类中get_pos函数的具体作用吗?为什么在获取索引的时候要乘以100000呢?

@leanwang326
Copy link
Collaborator

其实就是,比如我想在input_id 里(不妨假设它是个List[int])匹配一个长度为二的List[int] [a,b] (比如要找label,但只匹配label本身的话万一句子里也有多次出现,可能会出问题,所以再匹配下前面的':')

所以我去匹配了下x_{i-1}100000+x_{i}和a100000+b(取100000单纯是为了大于词表大小)
就单纯是为了匹配下子序列,来获取索引

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