DLH Final Project Team 82 - [email protected], [email protected]
Attention-Based Bidirectional Long Short-Term Memory Networks for Relation Classification (Zhou et al., ACL 2016)
Peng Zhou, Wei Shi, Jun Tian, Zhenyu Qi, Bingchen Li, Hongwei Hao, and Bo Xu. 2016. Attention-Based Bidirectional Long Short-Term Memory Networks for Relation Classification. In Proceedings of the 54th Annual Meeting of the Association for Computational Linguistics (Volume 2: Short Papers), pages 207โ212, Berlin, Germany. Association for Computational Linguistics.
We used an open-source implementation of the aforemnetioned paper that can be found at this link.
The original README for this repository can be found at the end of this file.
- Create a python virtual environment in this directory
- Install dependencies using:
pip3 install -r requirements.txt
This repository includes the data used in our experiment in the concept_assertion_relation_training_data
folder.
The data can also be obtained from the Harvard Department of Medical Informatics n2c2 research portal.
The pre-processing code lives in the data_formatting.py
file. To pre-process out data, run:
python3 data_formatting.py
Our training and evaluation code lives in the train.py
file. The hyperparameters associated with the training can be modified in the get_args.py
file.
By default, our training model runs for 25 epochs and print the following statistics in the console:
- Loss
- Accuracy
- F-1 scores for each label
- Recall scores for each label
- Precision scores for each label
Training can be run using the following command:
python3 train.py
We used a 70-30 split on our dataset for our train-test split. We used a random word embedding for our sentences and used the following hyperparameters:
embedding dimension
- 100LSTM combine
- 'add'embbeding dropout
- 0.5
We achieved the following results:
Pytorch implementation of ACL 2016 paper, Attention-Based Bidirectional Long Short-Term Memory Networks for Relation Classification (Zhou et al., 2016)
- Dataset: Relation Extraction Challenge(SemEval-2010 Task #8: Multi-Way Classification of Semantic Relations Between Pairs of Nominals)
- Performance: This code repo approached 71% F1. Please feel free to fork and refine it and get the paper's reported 84%.
- Model Structure: Attention-based BiLSTM
- Attention-Based Bidirectional Long Short-Term Memory Networks for Relation Classification (ACL 2016), P Zhou et al.
- SeoSangwoo's Tensorflow implementation