Views
No views yet
seqeval:| Entity | Precision | Recall | F1-Score | Support |
|---|---|---|---|---|
| CARDINAL | 0.7310 | 0.7572 | 0.7439 | 1005 |
| DATE | 0.7970 | 0.8309 | 0.8136 | 1786 |
| EVENT | 0.6180 | 0.6471 | 0.6322 | 85 |
| FAC | 0.5678 | 0.4497 | 0.5019 | 149 |
| GPE | 0.8621 | 0.8818 | 0.8718 | 2546 |
| LOC | 0.6491 | 0.6884 | 0.6682 | 215 |
| MONEY | 0.8575 | 0.8648 | 0.8612 | 355 |
| NORP | 0.8734 | 0.8778 | 0.8756 | 990 |
| ORG | 0.8195 | 0.8232 | 0.8213 | 2002 |
| PERSON | 0.8707 | 0.8454 | 0.8578 | 2134 |
| micro avg | 0.8099 | 0.8201 | 0.8150 | 12585 |
| macro avg | 0.7040 | 0.7073 | 0.7046 | 12585 |
| weighted avg | 0.8103 | 0.8201 | 0.8148 | 12585 |
| Asset | File | Description |
|---|---|---|
| Model Weights | bilstm_crf_model.bin | PyTorch state dictionary (~85.8 MB). |
| Vocabulary | vocab.pth | Pickled word-to-index mapping. |
| Label List | label_list.pth | Pickled NER tag list (BIO format). |
| Documentation | README.md | Model card and usage instructions. |
lr=1e-3, weight_decay=0.01)1import torch
2from model import BiLSTM_CRF # Ensure class definition is accessible
3
4device = torch.device("cuda" if torch.cuda.is_available() else "cpu")
5
6# 1. Load mappings
7vocab = torch.load("vocab.pth")
8label_list = torch.load("label_list.pth")
9
10# 2. Initialize and Load Weights
11model = BiLSTM_CRF(
12 v_size=len(vocab),
13 t_size=len(label_list),
14 e_dim=300,
15 h_dim=512,
16 w_matrix=torch.zeros(len(vocab), 300)
17)
18
19state_dict = torch.load("best_bilstm_crf_ddp.pth", map_location=device)
20# Standardize keys (remove 'module.' from DDP training)
21new_state_dict = {k.replace('module.', ''): v for k, v in state_dict.items()}
22model.load_state_dict(new_state_dict)
23model.to(device).eval()