v-mipeng / LexiconAugmentedNER

Reject complicated operations for incorporating lexicon for Chinese NER.
436 stars 66 forks source link

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

Open Shenxin0925 opened 3 years ago

Shenxin0925 commented 3 years ago

我用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 commented 3 years ago

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

Kakaiero commented 3 years ago

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

550952213 commented 2 years ago

老哥你解决了吗

Kakaiero commented 2 years ago

没啊,愁的很

------------------ 原始邮件 ------------------ 发件人: "v-mipeng/LexiconAugmentedNER" @.>; 发送时间: 2022年3月21日(星期一) 晚上9:52 @.>; @.**@.>; 主题: Re: [v-mipeng/LexiconAugmentedNER] 如何添加自己的词向量? (#41)

老哥你解决了吗

— Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you commented.Message ID: @.***>