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

input idx not exposed as a cmd line argument #4

Closed harsha-surukam closed 6 years ago

harsha-surukam commented 7 years ago

The example under Additional Feature Support in the readme, mentions arguments −−input idx and −−output idx, that are not handled yet.

This is definitely a great functionality to have, since it would be possible to ignore metadata fields from the raw data files.

aonotas commented 7 years ago

OK. I will fix it. Thank you for your comments!

renweibo commented 7 years ago

Any update for this?

aonotas commented 7 years ago

Hi @harsha-surukam @renweibo

I have done this issues.

First, please update deep-crf.

cd deep-crf
git pull
python setup.py install

Second, please following commands:

deep-crf train input_file_multi.txt --input_idx 0,1 --output_idx 2 --n_layer 1 --max_iter 30 --optimizer sgd_mom --save_dir save_model_dir --weight_decay 0.05 --delimiter ' ' --gpu 0 --model_name bilstm-cnn-crf --dev_file input_file_multi_dev.txt
$ cat input_file_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 
is      VBZ O 
a       DT  O 
man     NN  O 
.       .   O

Please see README.md more details! https://github.com/aonotas/deep-crf/blob/master/README.md