26hzhang / DATNet

Dual Adversarial Neural Transfer Network

Repository from Github https://github.com26hzhang/DATNetRepository from Github https://github.com26hzhang/DATNet

DATNet

This is TensorFlow implementation for paper (* indicates equal contributions):

overview

Requirements

  • python 3.x with package tensorflow-gpu (1.13.1), tensorflow_hub, ujson, emoji, matplotlib, tqdm, seqeval, scikit-learn

Usage

You can download pre-processed datasets from Box Drive (datasets), and save them to ./datasets/ folder.

Run baseline model on CoNLL-2003 English NER task using adversarial training (--at true). More parameters setting in run_baseline.py.

python run_baseline.py --train true --elmo false --task conll03_en_ner --at true

Run DATNet-P model on CoNLL-2003 English NER (OntoNotes NER as source) using ELMo (--elmo true), adversarial training (--at true), share word embeddings (--share_word true). More parameters setting in run_datnetp.py.

python run_datnetp.py --src_task ontonotes_ner --tgt_task conll03_en_ner --elmo true --at ture \
                      --share_word true

Similarly, run DATNet-F model on CoNLL-2003 English NER (OntoNotes NER as source) using ELMo (--elmo true), adversarial training (--at true), share word embeddings (--share_word true). More parameters setting in run_datnetf.py.

python run_datnetf.py --src_task ontonotes_ner --tgt_task conll03_en_ner --elmo true --at ture \
                      --share_word true

Note: to obtain the main results of Table 2 in "Dual Adversarial Neural Transfer for Low-Resource Named Entity Recognition", you can download the DATNet codes (init version) and trained weights, which are available on Box Drive (DATNet), and following the provided instructions to do evaluations. The pre-trained word embeddings are available here.

Citation

If you feel this project helpful to your research, please cite our work.

@inproceedings{zhou2019dual,
    title = {Dual Adversarial Neural Transfer for Low-Resource Named Entity Recognition},
    author = {Zhou, Joey Tianyi and Zhang, Hao and Jin, Di and Zhu, Hongyuan and Fang, Meng and Goh, Rick Siow Mong and Kwok, Kenneth},
    booktitle = {Proceedings of the 57th Annual Meeting of the Association for Computational Linguistics},
    year = {2019},
    address = {Florence, Italy},
    publisher = {Association for Computational Linguistics},
    url = {https://www.aclweb.org/anthology/P19-1336},
    doi = {10.18653/v1/P19-1336},
    pages = {3461--3471}
}

and

@article{8778733,
  author={J. T. {Zhou} and H. {Zhang} and D. {Jin} and X. {Peng}},
  journal={IEEE Transactions on Pattern Analysis and Machine Intelligence}, 
  title={Dual Adversarial Transfer for Sequence Labeling}, 
  year={2021},
  volume={43},
  number={2},
  pages={434-446},
  doi={10.1109/TPAMI.2019.2931569}
}

About

Dual Adversarial Neural Transfer Network

License:MIT License


Languages

Language:Python 100.0%