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

请问word2vec词表中未出现的词怎么表示呢? #10

Open
Melanielyw opened this issue May 9, 2019 · 1 comment
Open

请问word2vec词表中未出现的词怎么表示呢? #10

Melanielyw opened this issue May 9, 2019 · 1 comment

Comments

@Melanielyw
Copy link

您好,我想请问如果待预测的文本中出现词向量表中没有的单词,是怎样表示的呢?谢谢您!

@MrLeeeee
Copy link

只有那些在词汇表中的词才会被选中去训练,如果一个词没有出现的话,他是不会被编进去的。比如:这是一个奇葩的例子。因为奇葩这个词在词汇表中没有,那么真正编码的句子是:这是一个例子。你可以仔细看一下loader.py中的这句话: data_id.append([word_to_id[x] for x in contents[i] if x in word_to_id])

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