You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
我查看了源码,extended_vocab_path的参数会作为读取字典,经过_read_vocab_list_from_file取出词表 def _read_vocab_list_from_file(self, extended_vocab_path): # load new vocab table from file vocab_list = [] with open(extended_vocab_path, "r", encoding="utf-8") as f: for line in f.readlines(): vocab = line.rstrip("\n").split("\t")[0] vocab_list.append(vocab) return vocab_list
该任务对应的字典word.dic ,第一列是索引id,不是vocab
所以TokenEmbedding无法正确加载pretrain的权重
The text was updated successfully, but these errors were encountered:
hi,
https://aistudio.baidu.com/aistudio/projectdetail/1317771
在这个NER任务中,主模型代码
class BiGRUWithCRF2(nn.Layer): def __init__(self, emb_size, hidden_size, word_num, label_num): super(BiGRUWithCRF2, self).__init__() self.word_emb = TokenEmbedding(extended_vocab_path='./conf/word.dic', unknown_token='OOV') #EMB
TokenEmbedding的利用有误
我查看了源码,extended_vocab_path的参数会作为读取字典,经过_read_vocab_list_from_file取出词表
def _read_vocab_list_from_file(self, extended_vocab_path): # load new vocab table from file vocab_list = [] with open(extended_vocab_path, "r", encoding="utf-8") as f: for line in f.readlines(): vocab = line.rstrip("\n").split("\t")[0] vocab_list.append(vocab) return vocab_list
该任务对应的字典word.dic ,第一列是索引id,不是vocab
所以TokenEmbedding无法正确加载pretrain的权重
The text was updated successfully, but these errors were encountered: