Overparameterized neural networks are often described as lazy (Chizat et al., 2019), which motivates us to design architectures and objectives that are easier to optimize.
eznlp
is a PyTorch
-based package for neural natural language processing, currently supporting the following tasks:
- Text Classification (Experimental Results)
- Named Entity Recognition (Experimental Results)
- Relation Extraction (Experimental Results)
- Attribute Extraction
- Machine Translation
- Image Captioning
This repository also contains code for our published papers:
- See this link for Deep Span Representations for Named Entity Recognition, presented at Findings of ACL 2023.
- See this link for Boundary Smoothing for Named Entity Recognition, presented at ACL 2022.
- See the annotation scheme and HwaMei-500 dataset described in A Unified Framework of Medical Information Annotation and Extraction for Chinese Clinical Text published in Artificial Intelligence in Medicine.
We recommend using Docker. The latest tested image is pytorch/pytorch:2.6.0-cuda12.6-cudnn9-devel
.
$ docker run --rm -it --gpus=all --mount type=bind,source=${PWD},target=/workspace/eznlp --workdir /workspace/eznlp pytorch/pytorch:2.6.0-cuda12.6-cudnn9-devel
Alternatively, you can create a virtual environment. For example:
$ conda create --name eznlp python=3.11
$ conda activate eznlp
If you wish to use eznlp
as a package, install it from PyPI:
$ pip install eznlp
If you plan to develop on this project, install it in editable mode:
$ pip install -e .
$ python scripts/text_classification.py --dataset <dataset> [options]
$ python scripts/entity_recognition.py --dataset <dataset> [options]
$ python scripts/relation_extraction.py --dataset <dataset> [options]
$ python scripts/attribute_extraction.py --dataset <dataset> [options]
If you find our code useful, please cite the following papers:
@inproceedings{zhu2023deep,
title={Deep Span Representations for Named Entity Recognition},
author={Zhu, Enwei and Liu, Yiyang and Li, Jinpeng},
booktitle={Findings of the Association for Computational Linguistics: ACL 2023},
month={jul},
year={2023},
address={Toronto, Canada},
publisher={Association for Computational Linguistics},
url={https://aclanthology.org/2023.findings-acl.672},
doi={10.18653/v1/2023.findings-acl.672},
pages={10565--10582}
}
@inproceedings{zhu2022boundary,
title={Boundary Smoothing for Named Entity Recognition},
author={Zhu, Enwei and Li, Jinpeng},
booktitle={Proceedings of the 60th Annual Meeting of the Association for Computational Linguistics (Volume 1: Long Papers)},
month={may},
year={2022},
address={Dublin, Ireland},
publisher={Association for Computational Linguistics},
url={https://aclanthology.org/2022.acl-long.490},
doi={10.18653/v1/2022.acl-long.490},
pages={7096--7108}
}
@article{zhu2023framework,
title={A unified framework of medical information annotation and extraction for {C}hinese clinical text},
author={Zhu, Enwei and Sheng, Qilin and Yang, Huanwan and Liu, Yiyang and Cai, Ting and Li, Jinpeng},
journal={Artificial Intelligence in Medicine},
volume={142},
pages={102573},
year={2023},
publisher={Elsevier}
}
- Chizat, L., Oyallon, E., and Bach, F. On lazy training in differentiable programming. In NeurIPS 2019.