whuxiaobenben / Att-ChemdNER

Att-ChemdNER

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Att-ChemdNER


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

Dependency package

Att-ChemdNER uses the following dependencies:

Content

  • data
    • CHENDNER corpus
    • CDR corpus
  • models
    • The basic BiLSTM-CRF model
    • The Att-BiLSTM-CRF model
    • The 50-dimensional word embedding
  • src
    • backend
    • evaluation: evaluate result of NER task
    • activations.py: activation functions
    • initializations.py
    • loader.py: load the data set
    • model.py: build the model
    • nn.py: the layers of the network architecture
    • optimizaiton.py: optimization method
    • utils.py
    • train.py: train a basic BiLSTM-CRF model
    • AttenTrain.py: train a Att-BiLSTM-CRF model
    • tagger.py: tag the document using the BiLSTM-CRF model
    • AttenTrain.py: tag the document using the Att-BiLSTM-CRF model

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.


About

Att-ChemdNER

License:Apache License 2.0


Languages

Language:Python 94.8%Language:Perl 5.2%