aonotas / deep-crf

An implementation of Conditional Random Fields (CRFs) with Deep Learning Method

Home Page:http://deep-crf.com

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

ValueError: need more than 1 value to unpack

masakuri opened this issue · comments

When I predicted with English test file, it worked.
But when I predicted with Japanese test file (and set pre-trained Japanese word embeddings file), I got the following error.

  File "build/bdist.linux-x86_64/egg/deepcrf/__init__.py", line 119, in predict
  File "build/bdist.linux-x86_64/egg/deepcrf/main.py", line 149, in run
  File "build/bdist.linux-x86_64/egg/deepcrf/util.py", line 65, in load_vocab
ValueError: need more than 1 value to unpack

My command is like:
deep-crf predict input_test_jp.txt --delimiter=" " --model_filename ./save_jpmodel_dir/bilstm-cnn-crf_adam_jp_epoch41.model --save_dir save_jpmodel_dir --save_name bilstm-cnn-crf_adam_jp --word_emb_file jp_word_emb300.txt --n_word_emb 300 --word_emb_vocab_type replace_only --predicted_output predicted41_jp.txt --gpu 0

Any ideas? Thank you.

OK. please let me know following information

ls -lr ./save_jpmodel_dir/
head ./save_jpmodel_dir/bilstm-cnn-crf_adam_jp.vocab_char

Please tell me your .vocab_char file contains '\t' ?

I just fix the code now.
0fec504

So please try recent version.

It worked!
Thank you very much.

Thank you.
I fix code again.
please try to use recent version again.
Maybe you char_file contains :
CHAR \t CHAR \t Index.

Recent version is also worked. Thank you very much.
I checked my char_file (bilstm-cnn-crf_adam_jp.vocab_char) but I could not find CHAR[tab]CHAR [tab]Index.

I found an following unusual example but I could not find CHAR[tab]CHAR[tab]Index ones.
<U+0080>[tab]438
Maybe this is the cause. I don't know.