amanpatkar
commited on
Commit
•
8119227
1
Parent(s):
bca3f7d
Update README.md
Browse files
README.md
CHANGED
@@ -1,92 +1,130 @@
|
|
1 |
-
---
|
2 |
-
base_model: distilbert-base-cased
|
3 |
-
datasets:
|
4 |
-
- conll2003
|
5 |
-
license:
|
6 |
-
metrics:
|
7 |
-
- precision
|
8 |
-
- recall
|
9 |
-
- f1
|
10 |
-
- accuracy
|
11 |
-
tags:
|
12 |
-
- generated_from_trainer
|
13 |
-
model-index:
|
14 |
-
- name: distilbert-finetuned-ner
|
15 |
-
results:
|
16 |
-
- task:
|
17 |
-
type: token-classification
|
18 |
-
name: Token Classification
|
19 |
-
dataset:
|
20 |
-
name: conll2003
|
21 |
-
type: conll2003
|
22 |
-
config: conll2003
|
23 |
-
split: validation
|
24 |
-
args: conll2003
|
25 |
-
metrics:
|
26 |
-
- type: precision
|
27 |
-
value: 1
|
28 |
-
name: Precision
|
29 |
-
- type: recall
|
30 |
-
value: 1
|
31 |
-
name: Recall
|
32 |
-
- type: f1
|
33 |
-
value: 1
|
34 |
-
name: F1
|
35 |
-
- type: accuracy
|
36 |
-
value: 1
|
37 |
-
name: Accuracy
|
38 |
-
---
|
39 |
-
|
40 |
-
<!-- This model card has been generated automatically according to the information the Trainer had access to. You
|
41 |
-
should probably proofread and complete it, then remove this comment. -->
|
42 |
-
|
43 |
-
# distilbert-finetuned-ner
|
44 |
-
|
45 |
-
This model is a fine-tuned version of [distilbert-base-cased](https://huggingface.co/distilbert-base-cased) on the conll2003 dataset.
|
46 |
-
It achieves the following results on the evaluation set:
|
47 |
-
- Loss: 0.
|
48 |
-
- Precision: 1.0
|
49 |
-
- Recall: 1.0
|
50 |
-
- F1: 1.0
|
51 |
-
- Accuracy: 1.0
|
52 |
-
|
53 |
-
## Model description
|
54 |
-
|
55 |
-
|
56 |
-
|
57 |
-
## Intended
|
58 |
-
|
59 |
-
|
60 |
-
|
61 |
-
|
62 |
-
|
63 |
-
|
64 |
-
|
65 |
-
|
66 |
-
|
67 |
-
|
68 |
-
|
69 |
-
|
70 |
-
|
71 |
-
|
72 |
-
|
73 |
-
|
74 |
-
|
75 |
-
|
76 |
-
|
77 |
-
|
78 |
-
|
79 |
-
|
80 |
-
|
81 |
-
|
82 |
-
|
83 |
-
|
84 |
-
|
85 |
-
|
86 |
-
|
87 |
-
|
88 |
-
|
89 |
-
|
90 |
-
-
|
91 |
-
|
92 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
---
|
2 |
+
base_model: distilbert-base-cased
|
3 |
+
datasets:
|
4 |
+
- conll2003
|
5 |
+
license: mit
|
6 |
+
metrics:
|
7 |
+
- precision
|
8 |
+
- recall
|
9 |
+
- f1
|
10 |
+
- accuracy
|
11 |
+
tags:
|
12 |
+
- generated_from_trainer
|
13 |
+
model-index:
|
14 |
+
- name: distilbert-finetuned-ner
|
15 |
+
results:
|
16 |
+
- task:
|
17 |
+
type: token-classification
|
18 |
+
name: Token Classification
|
19 |
+
dataset:
|
20 |
+
name: conll2003
|
21 |
+
type: conll2003
|
22 |
+
config: conll2003
|
23 |
+
split: validation
|
24 |
+
args: conll2003
|
25 |
+
metrics:
|
26 |
+
- type: precision
|
27 |
+
value: 1
|
28 |
+
name: Precision
|
29 |
+
- type: recall
|
30 |
+
value: 1
|
31 |
+
name: Recall
|
32 |
+
- type: f1
|
33 |
+
value: 1
|
34 |
+
name: F1
|
35 |
+
- type: accuracy
|
36 |
+
value: 1
|
37 |
+
name: Accuracy
|
38 |
+
---
|
39 |
+
|
40 |
+
<!-- This model card has been generated automatically according to the information the Trainer had access to. You
|
41 |
+
should probably proofread and complete it, then remove this comment. -->
|
42 |
+
|
43 |
+
# distilbert-finetuned-ner
|
44 |
+
|
45 |
+
This model is a fine-tuned version of [distilbert-base-cased](https://huggingface.co/distilbert-base-cased) on the conll2003 dataset.
|
46 |
+
It achieves the following results on the evaluation set:
|
47 |
+
- Loss: 0.0711
|
48 |
+
- Precision: 1.0
|
49 |
+
- Recall: 1.0
|
50 |
+
- F1: 1.0
|
51 |
+
- Accuracy: 1.0
|
52 |
+
|
53 |
+
## Model description
|
54 |
+
|
55 |
+
The distilbert-finetuned-ner model is designed for Named Entity Recognition (NER) tasks. It is based on the DistilBERT architecture, which is a smaller, faster, and lighter version of BERT. DistilBERT retains 97% of BERT's language understanding while being 60% faster and 40% smaller, making it efficient for deployment in production systems.
|
56 |
+
|
57 |
+
## Intended Uses & Limitations
|
58 |
+
|
59 |
+
#### How to use
|
60 |
+
|
61 |
+
You can use this model with Transformers *pipeline* for NER.
|
62 |
+
|
63 |
+
```python
|
64 |
+
from transformers import AutoTokenizer, AutoModelForTokenClassification
|
65 |
+
from transformers import pipeline
|
66 |
+
|
67 |
+
tokenizer = AutoTokenizer.from_pretrained("amanpatkar/distilbert-finetuned-ner")
|
68 |
+
model = AutoModelForTokenClassification.from_pretrained("amanpatkar/distilbert-finetuned-ner")
|
69 |
+
|
70 |
+
nlp = pipeline("ner", model=model, tokenizer=tokenizer)
|
71 |
+
example = "My name is Aman Patkar and I live in Gurugram, India."
|
72 |
+
|
73 |
+
ner_results = nlp(example)
|
74 |
+
print(ner_results)
|
75 |
+
```
|
76 |
+
|
77 |
+
### Intended Uses
|
78 |
+
- Named Entity Recognition (NER): Extracting entities such as names, locations, organizations, and miscellaneous entities from text.
|
79 |
+
- Information Extraction: Automatically identifying and classifying key information in documents.
|
80 |
+
- Text Preprocessing: Enhancing text preprocessing for downstream tasks like sentiment analysis and text summarization.
|
81 |
+
|
82 |
+
### limitations
|
83 |
+
- Domain Specificity: The model is trained on the CoNLL-2003 dataset, which primarily consists of newswire data. Performance may degrade on text from different domains.
|
84 |
+
- Language Limitation: This model is trained on English text. It may not perform well on text in other languages.
|
85 |
+
- Precision in Complex Sentences: While the model performs well on standard sentences, complex sentence structures or ambiguous contexts might pose challenges.
|
86 |
+
|
87 |
+
|
88 |
+
## Training and evaluation data
|
89 |
+
|
90 |
+
The model is fine-tuned on the CoNLL-2003 dataset, a widely-used dataset for training and evaluating NER systems. The dataset includes four types of named entities: Persons (PER), Organizations (ORG), Locations (LOC), and Miscellaneous (MISC).
|
91 |
+
Abbreviation|Description
|
92 |
+
-|-
|
93 |
+
O|Outside of a named entity
|
94 |
+
B-MISC |Beginning of a miscellaneous entity right after another miscellaneous entity
|
95 |
+
I-MISC | Miscellaneous entity
|
96 |
+
B-PER |Beginning of a person’s name right after another person’s name
|
97 |
+
I-PER |Person’s name
|
98 |
+
B-ORG |Beginning of an organization right after another organization
|
99 |
+
I-ORG |organization
|
100 |
+
B-LOC |Beginning of a location right after another location
|
101 |
+
I-LOC |Location
|
102 |
+
|
103 |
+
## Training procedure
|
104 |
+
|
105 |
+
### Training hyperparameters
|
106 |
+
|
107 |
+
The following hyperparameters were used during training:
|
108 |
+
- learning_rate: 2e-05
|
109 |
+
- train_batch_size: 8
|
110 |
+
- eval_batch_size: 8
|
111 |
+
- seed: 42
|
112 |
+
- optimizer: Adam with betas=(0.9,0.999) and epsilon=1e-08
|
113 |
+
- lr_scheduler_type: linear
|
114 |
+
- num_epochs: 3
|
115 |
+
|
116 |
+
### Training results
|
117 |
+
|
118 |
+
| Training Loss | Epoch | Step | Validation Loss | Precision | Recall | F1 | Accuracy |
|
119 |
+
|:-------------:|:-----:|:----:|:---------------:|:---------:|:------:|:---:|:--------:|
|
120 |
+
| 0.0908 | 1.0 | 1756 | 0.0887 | 1.0 | 1.0 | 1.0 | 1.0 |
|
121 |
+
| 0.0467 | 2.0 | 3512 | 0.0713 | 1.0 | 1.0 | 1.0 | 1.0 |
|
122 |
+
| 0.0276 | 3.0 | 5268 | 0.0711 | 1.0 | 1.0 | 1.0 | 1.0 |
|
123 |
+
|
124 |
+
|
125 |
+
### Framework versions
|
126 |
+
|
127 |
+
- Transformers 4.41.2
|
128 |
+
- Pytorch 2.3.1
|
129 |
+
- Datasets 2.20.0
|
130 |
+
- Tokenizers 0.19.1
|