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

Make stdin and stdout available for prediction #49

Open massongit opened 6 years ago

massongit commented 6 years ago

When we predict named entity tags using named entity tagger such as CRF ++, KyTea and KNP, stdin and stdout are used for inputting target data and outputting prediction results. Therefore, it seems to be good to make stdin and stdout available for inputting target data and outputting prediction results when we predict those.

aonotas commented 6 years ago

You mean we should use logging for prediction?

massongit commented 6 years ago

The current prediction command is as follows:

$ deep-crf predict input_raw_file.txt --delimiter=' ' --model_filename ./save_model_dir/bilstm-cnn-crf_adam_epoch3.model --save_dir save_model_dir --save_name bilstm-cnn-crf_adam  --predicted_output predicted.txt

I think it would be better to be able to also use the following command:

$ deep-crf predict --delimiter=' ' --model_filename ./save_model_dir/bilstm-cnn-crf_adam_epoch3.model --save_dir save_model_dir --save_name bilstm-cnn-crf_adam < input_raw_file.txt > predicted.txt

FYI: Prediction command of KyTea:

kytea -model trained_model.model < input_raw_file.txt > predicted.txt