Att-ChemdNER


This repo contains the source code and dataset for the following paper:

Att-ChemdNER uses the following dependencies:

Content

Train a basic BiLSTM-CRF model

To train a basic BiLSTM-CRF model, you need to provide the file of the training set, development set,testing set and word embedding model, and run the train.py script:

python train.py --train trainfile --dev devfile --test testfile --pre_emb word_embedding.model 

Train a Att-BiLSTM-CRF model

To train our Att-BiLSTM-CRF model, you need to provide the file of the training set, development set,testing set and word embedding model, and run the AttenTrain.py script:

python AttenTrain.py --train trainfile --dev devfile --test testfile --pre_emb word_embedding.model 

Tag the documents using the BiLSTM-CRF model

Recognize the chemical entities from the documents using the pretrained BiLSTM-CRF model, and you need to provide the pretrained model, inputfile and outputfile:

python tagger.py --model BiLSTM-CRF.model --input inputfile --output outputfile

The inputfile should contain one document by line, and they have to be tokenized.

Tag the documents using the Att-BiLSTM-CRF model

Recognize the chemical entities from the documents using the pretrained Att-BiLSTM-CRF model, and you need to provide the pretrained model, inputfile and outputfile:

python Atten_tagger.py --model Att-BiLSTM-CRF.model --input inputfile --output outputfile

The inputfile should contain one document by line, and they have to be tokenized.