tejasvaidhyadev/NER_Lab_Protocols

Domain-specific BERT representation for Named Entity Recognition of lab protocol

Python

29

8 commits

updated Dec 25, 2020

See the code

README

Domain specific BERT representation for Named Entity Recognition of lab protocol

code for the system that secured 4 runner up at EMNLP 2020 workshop WNUT Shared Task-3

This Repo contains

  • Code for Models.
  • Trained models used in the final submission.
  • Dependencies and steps to replicate results.

Relevant Links: arxiv-pdf | poster

For more detail refer shared task website

Please cite with the following BiBTeX code:

@article{Vaidhya_2020,
   title={IITKGP at W-NUT 2020 Shared Task-1: Domain specific BERT representation for Named Entity Recognition of lab protocol},
   url={http://dx.doi.org/10.18653/v1/2020.wnut-1.34},
   DOI={10.18653/v1/2020.wnut-1.34},
   journal={Proceedings of the Sixth Workshop on Noisy User-generated Text (W-NUT 2020)},
   publisher={Association for Computational Linguistics},
   author={Vaidhya, Tejas and Kaushal, Ayush},
   year={2020}
}

Authors: Tejas Vaidhya and Ayush Kaushal

Overview

Abstract

Supervised models trained to predict properties from representations have been achieving high accuracy on a variety of tasks. For instance, the BERT family seems to work exceptionally well on the downstream task from NER tagging to the range of other linguistic tasks. But the vocabulary used in the medical field contains a lot of different tokens used only in the medical industry such as the name of different diseases, devices, organisms, medicines, etc. that makes it difficult for traditional BERT model to create contextualized embedding. In this paper, we are going to illustrate the System for Named Entity Tagging based on Bio-Bert. Experimental results show that our model gives substantial improvements over the baseline and stood the fourth runner up in terms of F1 score, and first runner up in terms of Recall with just 2.21 F1 score behind the best one.

Dependencies and setup

DependencyVersionInstallation Command
Python3.8conda create --name covid_entities python=3.8 and conda activate covid_entities
PyTorch, cudatoolkit1.5.0, 10.1conda install pytorch==1.5.0 cudatoolkit=10.1 -c pytorch
Transformers (Huggingface)2.9.0pip install transformers==2.9.0
Scikit-learn0.23.1pip install scikit-learn==0.23.1
scipy1.5.0pip install scipy==1.5.0
NLTK3.5`pip install nltk==3.5
`

Model Description

Instruction for training the models

  1. Set up the codebase and requirements -git clone https://github.com/tejasvaidhyadev/W-NUT_2020.git & cd W-NUT_2020.

    • Follow the instructions from the Dependencies and set-up above to install the dependencies.
  2. Setup the dataset : Fllow instruction in ./data/README.md

  3. Recreating the experiment for the final submission: -run python train.py --dataset=proto (BERT model will be automatically chosen (for now Bio-BERT). It will instantiate a model and train it on the training set following the hyper-parameters specified in experiment/proto/params.json. )

    • preprocessing of Dataset for bert input refer ./data/Readme.md

We release the models weights for our final submission.

Model Performance

Model Performance on test set released for final evaluation using organisers script (exact match) On exact matches

EntityPrecisionRecallF1
Action87.8585.286.5
Amount72.2593.7881.62
Concentration84.2791.2187.6
Device65.258.461.61
Generic-Measure28.7440.3433.57
Location62.8971.1466.76
Measure66.7351.358.0
Mention66.4364.1465.26
Method45.9842.5344.19
Modifier73.3346.4356.86
Numerical66.1549.6256.7
Reagent80.4784.1382.26
Seal72.4559.6665.44
Size54.9316.3925.24
Speed87.0192.0889.47
Temperature92.9486.5889.65
Time90.2786.1388.15
pH95.1689.3992.19

**On partial matches **

OverallPrecisionRecallF1
partial matches81.7677.4379.54
exact matches7772.9374.91

Miscellanous

  • You may contact us by opening an issue on this repo. Please allow 2-3 days of time to address the issue.
  • The starter Code Credits: BERT_NER

License

MIT

named-entity-recognition
ner
pytorch

tejasvaidhyadev/NER_Lab_Protocols

Domain-specific BERT representation for Named Entity Recognition of lab protocol

Python

29

8 commits

updated Dec 25, 2020

See the code

README

Domain specific BERT representation for Named Entity Recognition of lab protocol

code for the system that secured 4 runner up at EMNLP 2020 workshop WNUT Shared Task-3

This Repo contains

  • Code for Models.
  • Trained models used in the final submission.
  • Dependencies and steps to replicate results.

Relevant Links: arxiv-pdf | poster

For more detail refer shared task website

Please cite with the following BiBTeX code:

@article{Vaidhya_2020,
   title={IITKGP at W-NUT 2020 Shared Task-1: Domain specific BERT representation for Named Entity Recognition of lab protocol},
   url={http://dx.doi.org/10.18653/v1/2020.wnut-1.34},
   DOI={10.18653/v1/2020.wnut-1.34},
   journal={Proceedings of the Sixth Workshop on Noisy User-generated Text (W-NUT 2020)},
   publisher={Association for Computational Linguistics},
   author={Vaidhya, Tejas and Kaushal, Ayush},
   year={2020}
}

Authors: Tejas Vaidhya and Ayush Kaushal

Overview

Abstract

Supervised models trained to predict properties from representations have been achieving high accuracy on a variety of tasks. For instance, the BERT family seems to work exceptionally well on the downstream task from NER tagging to the range of other linguistic tasks. But the vocabulary used in the medical field contains a lot of different tokens used only in the medical industry such as the name of different diseases, devices, organisms, medicines, etc. that makes it difficult for traditional BERT model to create contextualized embedding. In this paper, we are going to illustrate the System for Named Entity Tagging based on Bio-Bert. Experimental results show that our model gives substantial improvements over the baseline and stood the fourth runner up in terms of F1 score, and first runner up in terms of Recall with just 2.21 F1 score behind the best one.

Dependencies and setup

DependencyVersionInstallation Command
Python3.8conda create --name covid_entities python=3.8 and conda activate covid_entities
PyTorch, cudatoolkit1.5.0, 10.1conda install pytorch==1.5.0 cudatoolkit=10.1 -c pytorch
Transformers (Huggingface)2.9.0pip install transformers==2.9.0
Scikit-learn0.23.1pip install scikit-learn==0.23.1
scipy1.5.0pip install scipy==1.5.0
NLTK3.5`pip install nltk==3.5
`

Model Description

Instruction for training the models

  1. Set up the codebase and requirements -git clone https://github.com/tejasvaidhyadev/W-NUT_2020.git & cd W-NUT_2020.

    • Follow the instructions from the Dependencies and set-up above to install the dependencies.
  2. Setup the dataset : Fllow instruction in ./data/README.md

  3. Recreating the experiment for the final submission: -run python train.py --dataset=proto (BERT model will be automatically chosen (for now Bio-BERT). It will instantiate a model and train it on the training set following the hyper-parameters specified in experiment/proto/params.json. )

    • preprocessing of Dataset for bert input refer ./data/Readme.md

We release the models weights for our final submission.

Model Performance

Model Performance on test set released for final evaluation using organisers script (exact match) On exact matches

EntityPrecisionRecallF1
Action87.8585.286.5
Amount72.2593.7881.62
Concentration84.2791.2187.6
Device65.258.461.61
Generic-Measure28.7440.3433.57
Location62.8971.1466.76
Measure66.7351.358.0
Mention66.4364.1465.26
Method45.9842.5344.19
Modifier73.3346.4356.86
Numerical66.1549.6256.7
Reagent80.4784.1382.26
Seal72.4559.6665.44
Size54.9316.3925.24
Speed87.0192.0889.47
Temperature92.9486.5889.65
Time90.2786.1388.15
pH95.1689.3992.19

**On partial matches **

OverallPrecisionRecallF1
partial matches81.7677.4379.54
exact matches7772.9374.91

Miscellanous

  • You may contact us by opening an issue on this repo. Please allow 2-3 days of time to address the issue.
  • The starter Code Credits: BERT_NER

License

MIT

named-entity-recognition
ner
pytorch