https://github.com/runtime-error786/ner-with-bert-lstm
NER with BERT and LSTM
https://github.com/runtime-error786/ner-with-bert-lstm
Last synced: 10 months ago
JSON representation
NER with BERT and LSTM
- Host: GitHub
- URL: https://github.com/runtime-error786/ner-with-bert-lstm
- Owner: runtime-error786
- Created: 2025-01-07T20:42:46.000Z (about 1 year ago)
- Default Branch: main
- Last Pushed: 2025-01-08T14:36:47.000Z (about 1 year ago)
- Last Synced: 2025-01-29T02:48:37.260Z (12 months ago)
- Language: Jupyter Notebook
- Homepage:
- Size: 6.84 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# NER with LSTM:
A custom NER model built with PyTorch that leverages an LSTM (Long Short-Term Memory) network for sequence labeling. The dataset is tokenized, padded, and encoded into word indices, and the LSTM processes these word embeddings to predict NER tags. Training is done using cross-entropy loss, and evaluation involves generating classification metrics like precision, recall, and F1-score. The LSTM model is lightweight and designed for those learning to build sequence models from scratch.
# NER with BERT:
A more advanced approach using a pre-trained BERT model fine-tuned for token classification. The transformers library is used for tokenization and model loading. Tokens and NER labels are aligned to handle subwords, and the model is fine-tuned using the Trainer API for efficient training and evaluation. This approach leverages BERT's ability to understand contextual word representations, yielding better performance compared to traditional LSTMs.