File size: 2,686 Bytes
67c3f68
 
 
 
 
 
 
 
 
 
 
 
 
 
 
7b6d659
67c3f68
997f64c
7b6d659
67c3f68
 
 
7b6d659
5d676da
da53580
7b6d659
 
9284394
41dfe0e
67c3f68
12581f0
c347597
 
 
 
 
 
 
 
 
 
 
 
 
 
12581f0
67c3f68
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
---
license: apache-2.0
base_model: distilroberta-base
tags:
- generated_from_trainer
metrics:
- f1
model-index:
- name: distilroberta-ConLL2003
  results: []
---

<!-- This model card has been generated automatically according to the information the Trainer had access to. You
should probably proofread and complete it, then remove this comment. -->

# Model Description

This model is a fine-tuned version of [distilroberta-base](https://huggingface.co/distilroberta-base) on [ConLL2003 dataset](https://huggingface.co/datasets/conll2003).
It achieves the following results on the evaluation set in Named Entity Recognition (NER)/Token Classification task:
- Loss: 0.0585
- F1: 0.9536

# Model Performance
- 1st Place: This fine-tuned model is topped on the best scores ( F1: 94.6%) from [Named Entity Recognition (NER) on CoNLL 2003 (English)]((https://paperswithcode.com/sota/named-entity-recognition-ner-on-conll-2003)).
- 6th Place: This fine-tuned model is ranked in the 6th place from the [Token Classification on conll2003 leaderboard](https://paperswithcode.com/sota/token-classification-on-conll2003)



## Model Usage

```python
from transformers import AutoTokenizer, AutoModelForTokenClassification
from transformers import pipeline

tokenizer = AutoTokenizer.from_pretrained("jinhybr/distilroberta-ConLL2003")
model = AutoModelForTokenClassification.from_pretrained("jinhybr/distilroberta-ConLL2003")

nlp = pipeline("ner", model=model, tokenizer=tokenizer, grouped_entities=True)
example = "My name is Tao Jin and live in Canada"
ner_results = nlp(example)
print(ner_results)

[{'entity_group': 'PER', 'score': 0.99686015, 'word': ' Tao Jin', 'start': 11, 'end': 18}, {'entity_group': 'LOC', 'score': 0.9996836, 'word': ' Canada', 'start': 31, 'end': 37}]


```



## Training procedure

### Training hyperparameters

The following hyperparameters were used during training:
- learning_rate: 5e-05
- train_batch_size: 32
- eval_batch_size: 16
- seed: 24
- optimizer: Adam with betas=(0.9,0.999) and epsilon=1e-08
- lr_scheduler_type: linear
- num_epochs: 6.0

### Training results

| Training Loss | Epoch | Step | Validation Loss | F1     |
|:-------------:|:-----:|:----:|:---------------:|:------:|
| 0.1666        | 1.0   | 439  | 0.0621          | 0.9345 |
| 0.0499        | 2.0   | 878  | 0.0564          | 0.9391 |
| 0.0273        | 3.0   | 1317 | 0.0553          | 0.9469 |
| 0.0167        | 4.0   | 1756 | 0.0553          | 0.9492 |
| 0.0103        | 5.0   | 2195 | 0.0572          | 0.9516 |
| 0.0068        | 6.0   | 2634 | 0.0585          | 0.9536 |


### Framework versions

- Transformers 4.35.2
- Pytorch 2.1.0+cu121
- Datasets 2.17.0
- Tokenizers 0.15.1