Closed livc closed 4 years ago
Just assign an empty string to the option unk
: --unk=
.
It works, thanks.
Traceback (most recent call last): File "run.py", line 58, in <module> cmd(args) File "/public/sist/home/lizhao/biaffine-parser/parser/cmds/train.py", line 40, in __call__ super(Train, self).__call__(args) File "/public/sist/home/lizhao/biaffine-parser/parser/cmds/cmd.py", line 49, in __call__ self.WORD.build(train, args.min_freq, embed) File "/public/sist/home/lizhao/biaffine-parser/parser/utils/field.py", line 86, in build tokens[embed.unk_index] = self.unk File "/public/sist/home/lizhao/biaffine-parser/parser/utils/embedding.py", line 29, in unk_index return self.tokens.index(self.unk) ValueError: tuple.index(x): x not in tuple
Hi, I check that the
unk
token is not added to classEmbedding
so it can't be indexed. Any suggestions? Thanks.It works, thanks.
你好,请问python run.py train时是加了 --unk='unk' 还是 --unk=unk
两种都试过了,没用。
@xiaoxiaoAurora --unk=''
Hi, I check that the
unk
token is not added to classEmbedding
so it can't be indexed. Any suggestions? Thanks.