ashaduzzaman
commited on
Commit
•
559ea6f
1
Parent(s):
b429487
Update README.md
Browse files
README.md
CHANGED
@@ -39,16 +39,18 @@ model-index:
|
|
39 |
type: accuracy
|
40 |
value: 0.9863572143403779
|
41 |
pipeline_tag: token-classification
|
42 |
-
|
|
|
43 |
---
|
44 |
|
45 |
<!-- This model card has been generated automatically according to the information the Trainer had access to. You
|
46 |
should probably proofread and complete it, then remove this comment. -->
|
47 |
|
|
|
48 |
# bert-finetuned-ner
|
49 |
|
50 |
## Model Description
|
51 |
-
This model is a Named Entity Recognition (NER) model built using PyTorch and
|
52 |
|
53 |
## Intended Uses & Limitations
|
54 |
**Intended Uses:**
|
@@ -61,7 +63,7 @@ This model is a Named Entity Recognition (NER) model built using PyTorch and tra
|
|
61 |
- **Error Propagation:** Incorrect predictions may propagate to downstream tasks, affecting overall performance.
|
62 |
|
63 |
## How to Use
|
64 |
-
To use this model, load it
|
65 |
|
66 |
```python
|
67 |
from transformers import AutoTokenizer, AutoModelForTokenClassification
|
@@ -81,6 +83,11 @@ entities = ner_pipeline(text)
|
|
81 |
print(entities)
|
82 |
```
|
83 |
|
|
|
|
|
|
|
|
|
|
|
84 |
## Limitations and Bias
|
85 |
- **Bias in Data:** The model is trained on the CoNLL-2003 dataset, which may contain biases related to the sources of the text. The model might underperform on entities not well represented in the training data.
|
86 |
- **Overfitting:** The model may overfit to the specific entities present in the CoNLL-2003 dataset, affecting its generalization to new entities or text styles.
|
@@ -89,26 +96,23 @@ print(entities)
|
|
89 |
The model was trained on the CoNLL-2003 dataset, a widely used benchmark dataset for NER tasks. The dataset contains annotated text from news articles, with labels for persons, organizations, locations, and miscellaneous entities.
|
90 |
|
91 |
## Training Procedure
|
92 |
-
The model was fine-tuned using
|
93 |
-
- **Optimizer:** AdamW optimizer
|
94 |
-
- **Learning Rate:**
|
95 |
-
- **Batch Size:**
|
96 |
-
- **Epochs:** The model was trained for
|
97 |
-
- **Evaluation:** Model performance was evaluated on a validation set
|
98 |
-
|
99 |
-
### Training
|
100 |
-
|
101 |
-
|
102 |
-
-
|
103 |
-
-
|
104 |
-
-
|
105 |
-
-
|
106 |
-
- optimizer: Adam with betas=(0.9,0.999) and epsilon=1e-08
|
107 |
-
- lr_scheduler_type: linear
|
108 |
-
- num_epochs: 3
|
109 |
|
110 |
## Evaluation Results
|
111 |
-
This model
|
112 |
|
113 |
| Training Loss | Epoch | Step | Validation Loss | Precision | Recall | F1 | Accuracy |
|
114 |
|:-------------:|:-----:|:----:|:---------------:|:---------:|:------:|:------:|:--------:|
|
@@ -116,11 +120,9 @@ This model is a fine-tuned version of [bert-base-cased](https://huggingface.co/b
|
|
116 |
| 0.0359 | 2.0 | 3512 | 0.0693 | 0.9265 | 0.9418 | 0.9341 | 0.9847 |
|
117 |
| 0.0222 | 3.0 | 5268 | 0.0599 | 0.9347 | 0.9512 | 0.9429 | 0.9864 |
|
118 |
|
119 |
-
|
120 |
-
|
121 |
-
|
122 |
-
|
123 |
-
-
|
124 |
-
|
125 |
-
- Datasets 2.21.0
|
126 |
-
- Tokenizers 0.19.1
|
|
|
39 |
type: accuracy
|
40 |
value: 0.9863572143403779
|
41 |
pipeline_tag: token-classification
|
42 |
+
language:
|
43 |
+
- en
|
44 |
---
|
45 |
|
46 |
<!-- This model card has been generated automatically according to the information the Trainer had access to. You
|
47 |
should probably proofread and complete it, then remove this comment. -->
|
48 |
|
49 |
+
|
50 |
# bert-finetuned-ner
|
51 |
|
52 |
## Model Description
|
53 |
+
This model is a Named Entity Recognition (NER) model built using PyTorch and fine-tuned on the CoNLL-2003 dataset. The model is designed to identify and classify named entities in text into categories such as persons (PER), organizations (ORG), locations (LOC), and miscellaneous entities (MISC).
|
54 |
|
55 |
## Intended Uses & Limitations
|
56 |
**Intended Uses:**
|
|
|
63 |
- **Error Propagation:** Incorrect predictions may propagate to downstream tasks, affecting overall performance.
|
64 |
|
65 |
## How to Use
|
66 |
+
To use this model, you can load it using the Hugging Face Transformers library. Below is an example of how to perform inference using the model:
|
67 |
|
68 |
```python
|
69 |
from transformers import AutoTokenizer, AutoModelForTokenClassification
|
|
|
83 |
print(entities)
|
84 |
```
|
85 |
|
86 |
+
### Troubleshooting
|
87 |
+
If the model isn't performing as expected, consider checking the following:
|
88 |
+
- Ensure that the input text is in English, as the model was trained on English data.
|
89 |
+
- Adjust the model's confidence threshold for entity detection to filter out less confident predictions.
|
90 |
+
|
91 |
## Limitations and Bias
|
92 |
- **Bias in Data:** The model is trained on the CoNLL-2003 dataset, which may contain biases related to the sources of the text. The model might underperform on entities not well represented in the training data.
|
93 |
- **Overfitting:** The model may overfit to the specific entities present in the CoNLL-2003 dataset, affecting its generalization to new entities or text styles.
|
|
|
96 |
The model was trained on the CoNLL-2003 dataset, a widely used benchmark dataset for NER tasks. The dataset contains annotated text from news articles, with labels for persons, organizations, locations, and miscellaneous entities.
|
97 |
|
98 |
## Training Procedure
|
99 |
+
The model was fine-tuned using the pre-trained BERT model (`bert-base-cased`) with a token classification head for NER. The training process involved:
|
100 |
+
- **Optimizer:** AdamW optimizer with betas=(0.9, 0.999) and epsilon=1e-08
|
101 |
+
- **Learning Rate:** A linear learning rate scheduler was employed starting from 2e-05
|
102 |
+
- **Batch Size:** 8 for both training and evaluation
|
103 |
+
- **Epochs:** The model was trained for 3 epochs
|
104 |
+
- **Evaluation:** Model performance was evaluated on a validation set with metrics like F1-score, precision, recall, and accuracy.
|
105 |
+
|
106 |
+
### Training Hyperparameters
|
107 |
+
- **Learning Rate:** 2e-05
|
108 |
+
- **Batch Size (train/eval):** 8/8
|
109 |
+
- **Seed:** 42
|
110 |
+
- **Optimizer:** Adam with betas=(0.9, 0.999) and epsilon=1e-08
|
111 |
+
- **LR Scheduler Type:** Linear
|
112 |
+
- **Number of Epochs:** 3
|
|
|
|
|
|
|
113 |
|
114 |
## Evaluation Results
|
115 |
+
This model was evaluated on the CoNLL-2003 test set, with performance measured using standard NER metrics:
|
116 |
|
117 |
| Training Loss | Epoch | Step | Validation Loss | Precision | Recall | F1 | Accuracy |
|
118 |
|:-------------:|:-----:|:----:|:---------------:|:---------:|:------:|:------:|:--------:|
|
|
|
120 |
| 0.0359 | 2.0 | 3512 | 0.0693 | 0.9265 | 0.9418 | 0.9341 | 0.9847 |
|
121 |
| 0.0222 | 3.0 | 5268 | 0.0599 | 0.9347 | 0.9512 | 0.9429 | 0.9864 |
|
122 |
|
123 |
+
## Framework Versions
|
124 |
+
- **Transformers:** 4.42.4
|
125 |
+
- **PyTorch:** 2.3.1+cu121
|
126 |
+
- **Datasets:** 2.21.0
|
127 |
+
- **Tokenizers:** 0.19.1
|
128 |
+
!
|
|
|
|