Use PubTator Format to train model, and inference. There are 5 steps, including pre-process data, train module, decode data, generate result with module and evaluate. Environment: Python: 2.7 Pytorch: 1.0.1 OSX : 10.1 NCRF++
- Preprocess CDR data
echo " prepare datasets: test.txt " python prepare.py
- Train Module in NCRF++ Configed NCRF++ to train without GPU, Configure file: "dh.train.config" Output module file: "lstmcrf.6.model"
echo "start training.. to get model " python main.py --config demo.train.config
- Decode data in NCRF++ Configed NCRF++ to train without GPU, Configure file: "dh.decode.config" Output file: "raw.out"
echo "start decode... to get rawout " python main.py --config demo.decode.config
- Generate result generate result via "assemble.py"
echo "process rawout to get result.txt" python reassemble.py
- Evaluation Evaluated via bc5cdr_eval.jar
echo " evaluate the result" ./eval_mention.sh PubTator CDR_TestSet.PubTator.txt result.txt