PyTorch code for Named Entity Recognition (NER) using pretrained BERT
Top 93.5% on sourcepulse
This repository provides a PyTorch implementation for Named Entity Recognition (NER) using BERT, aiming to reproduce research findings that BERT models achieve strong NER performance without complex prediction-conditioned algorithms. It is targeted at researchers and practitioners interested in applying BERT to sequence labeling tasks.
How It Works
The project implements two approaches: a feature-based method leveraging BERT embeddings with additional RNN layers, and a fine-tuning approach where BERT's weights are directly updated. This allows for direct comparison of BERT's inherent capabilities versus its fine-tuned performance on NER.
Quick Start & Requirements
pip install pytorch==1.0 pytorch_pretrained_bert==0.6.1 numpy>=1.15.4
bash download.sh
.python train.py --logdir checkpoints/feature --batch_size 128 --top_rnns --lr 1e-4 --n_epochs 30
python train.py --logdir checkpoints/finetuning --finetuning --batch_size 32 --lr 5e-5 --n_epochs 3
Highlighted Details
checkpoints
directory.Maintenance & Community
The repository is maintained by Kyubyong. No specific community channels or roadmap are indicated in the README.
Licensing & Compatibility
The README does not explicitly state a license. Compatibility for commercial use or closed-source linking is not specified.
Limitations & Caveats
The project requires PyTorch 1.0 and pytorch_pretrained_bert
0.6.1, which are older versions and may present compatibility issues with current PyTorch ecosystems. The fine-tuning approach is limited to 3 epochs, which might be insufficient for optimal convergence.
5 years ago
Inactive