aonotas / deep-crf

An implementation of Conditional Random Fields (CRFs) with Deep Learning Method
http://deep-crf.com
MIT License
167 stars 48 forks source link

ValueError: Invalid input feature sizes #58

Closed indiclinguist closed 6 years ago

indiclinguist commented 6 years ago

I used the following command: deep-crf predict input_file_multi.txt --delimiter=' ' --input_idx 0,1 --output_idx 2 --model_filename ./save_model_dir/bilstm-cnn-crf_multi_epoch3.model --save_dir save_model_dir --save_name bilstm-cnn-crf_multi --predicted_output predicted.txt

and I am getting the following error: ValueError: Invalid input feature sizes: "7". Please check at line [3]

The training and dev data files are in CoNLL format. Can anyone help? Thanks in advance.

aonotas commented 6 years ago

Hi @indiclinguist

Can you tell me the following result?

$ head -n 10 input_file_multi.txt

Please check that your file input_file_multi.txt contains three features (two input and one output).

(Example)

Barack  NN B−PERSON 
Hussein NN I−PERSON 
Obama   NN E−PERSON
is      VBZ O 
a       DT  O 
man     NN  O 
.       .   O

Please check that the delimiter is space? (since you set --delimiter=' ').

indiclinguist commented 6 years ago

Hello, The delimiter is a white-space. This is the result that you asked for.

$ head -n 10 data/train_multi.txt Barack NN B−PERSON Hussein NN I−PERSON Obama NN E−PERSON is VBZ O a DT O man NN O . . O

Yuji NN B−PERSON Matsumoto NN E−PERSON $

Thanks

aonotas commented 6 years ago

Did you use following the command?

deep-crf predict input_file_multi.txt --delimiter=' ' --input_idx 0,1 --output_idx 2 --model_filename ./save_model_dir/bilstm-cnn-crf_multi_epoch3.model --save_dir save_model_dir --save_name bilstm-cnn-crf_multi --predicted_output predicted.txt

I want to see input_file_multi.txt. or Did you use data/train_multi.txt?

indiclinguist commented 6 years ago

the test-input file format was wrong. now it works.