File size: 2,077 Bytes
cc3271f
 
033e928
 
 
 
 
 
 
 
 
 
8b91bbe
 
 
 
 
 
abbced3
 
 
 
8b91bbe
 
d35edd6
 
abbced3
 
 
 
8b91bbe
 
 
 
 
abbced3
8b91bbe
 
 
84cf34f
 
 
 
8b91bbe
 
 
 
abbced3
8b91bbe
 
 
 
 
 
abbced3
 
69635eb
8b91bbe
abbced3
 
8b91bbe
69635eb
 
 
 
 
abbced3
8b91bbe
abbced3
8b91bbe
 
 
abbced3
8b91bbe
7267fb8
abbced3
 
 
 
 
7267fb8
8b91bbe
 
 
abbced3
8b91bbe
 
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
82
83
84
85
86
87
88
---
license: apache-2.0
datasets:
- conll2003
- ai4privacy/pii-masking-200k
language:
- en
metrics:
- accuracy
- f1
library_name: transformers
pipeline_tag: token-classification
---

## Model Details

### Model Description

This model is electra-small finetuned for NER prediction task. The model currently predicts three entities which are given below.
1. Location
2. Person
3. Organization


- **Developed by:**    
விபின் (Vipin)
- **Model type:** Google's electra small discriminator
- **Language(s) (NLP):** English
- **License:** Apache 2.0
- **Finetuned from model [optional]:** Google's electra small discriminator

### Model Sources [optional]

<!-- Provide the basic links for the model. -->

- **Repository:** https://huggingface.co/google/electra-small-discriminator

## Uses

This model uses tokenizer that is from distilbert family. So the model may predict wrong entities for same word (different sub word). Use 'aggregation_strategy' to "max" when using transformer's pipeline.
for example 'ashwin ::"
    ash" => Person 
    win  => Location


### Out-of-Scope Use

May not work well for some long sentences. 


## How to Get Started with the Model

Use the code below to get started with the model.

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

model = AutoModelForTokenClassification.from_pretrained("rv2307/electra-small-ner")
tokenizer = AutoTokenizer.from_pretrained("rv2307/electra-small-ner")

nlp = pipeline("ner",
              model=model,
              tokenizer=tokenizer,device="cpu",
              aggregation_strategy = "max")

```

## Training Details

### Training Procedure

This model is trained for 6 epoch in 3e-4 lr. 

```
 [39168/39168 41:18, Epoch 6/6]
Step	Training Loss	Validation Loss	Precision	Recall	F1	Accuracy
10000	0.086300	0.088625	0.863476	0.876271	0.869827	0.972581
20000	0.059800	0.079611	0.894612	0.884521	0.889538	0.976563
30000	0.050400	0.074552	0.895812	0.902591	0.899188	0.978380
```

## Evaluation

Validation loss is 0.07 for this model