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

如何添加自己的词向量? #41

Open
Shenxin0925 opened this issue Jun 20, 2021 · 4 comments
Open

如何添加自己的词向量? #41

Shenxin0925 opened this issue Jun 20, 2021 · 4 comments

Comments

@Shenxin0925
Copy link

我用word2vec训练了50维的词向量,更改路径运行后发生了这个报错:
Traceback (most recent call last):
File "main.py", line 526, in
data.build_word_pretrain_emb(char_emb)
File "/home/admin/lc/各种模型/融合词典的中文分词/LexiconAugmentedNER-master/utils/data.py", line 262, in build_word_pretrain_emb
self.pretrain_word_embedding, self.word_emb_dim = build_pretrain_embedding(emb_path, self.word_alphabet, self.word_emb_dim, self.norm_word_emb)
File "/home/admin/lc/各种模型/融合词典的中文分词/LexiconAugmentedNER-master/utils/functions.py", line 188, in build_pretrain_embedding
embedd_dict, embedd_dim = load_pretrain_emb(embedding_path)
File "/home/admin/lc/各种模型/融合词典的中文分词/LexiconAugmentedNER-master/utils/functions.py", line 233, in load_pretrain_emb
assert (embedd_dim + 1 == len(tokens))
AssertionError

请问这是什么原因?

@SomeoneNotLikeYou
Copy link

你是要替换某个词向量 还是添加额外的向量

@Kakaiero
Copy link

Kakaiero commented Oct 7, 2021

请问如果是添加额外的向量呢

@550952213
Copy link

老哥你解决了吗

@Kakaiero
Copy link

Kakaiero commented Mar 28, 2022 via email

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