AnanthanarayananSeetharaman
commited on
Commit
•
e1a62fc
1
Parent(s):
f510878
Update README.md
Browse files
README.md
CHANGED
@@ -1,11 +1,32 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
# My Custom NER Model
|
2 |
|
3 |
-
This is a custom Named Entity Recognition (NER) model fine-tuned on domain-specific data using a BERT-based architecture
|
4 |
|
5 |
## Entities
|
6 |
-
|
7 |
-
-
|
8 |
-
-
|
|
|
|
|
|
|
9 |
|
10 |
## Example Usage
|
11 |
|
@@ -23,37 +44,3 @@ ner_pipeline = pipeline("ner", model=model, tokenizer=tokenizer)
|
|
23 |
text = "The SALES of BEER and WINE in TTL US is increasing."
|
24 |
entities = ner_pipeline(text)
|
25 |
print(entities)
|
26 |
-
|
27 |
-
## SAmple Output
|
28 |
-
[
|
29 |
-
{"entity": "FACT", "score": 0.98, "start": 4, "end": 9, "word": "SALES"},
|
30 |
-
{"entity": "PRDC_CHAR", "score": 0.95, "start": 13, "end": 17, "word": "BEER"},
|
31 |
-
{"entity": "PRDC_CHAR", "score": 0.94, "start": 22, "end": 26, "word": "WINE"},
|
32 |
-
{"entity": "MRKT_CHAR", "score": 0.96, "start": 30, "end": 36, "word": "TTL US"}
|
33 |
-
]
|
34 |
-
|
35 |
-
|
36 |
-
Training Details
|
37 |
-
|
38 |
-
Base Model: distilbert-base-uncased
|
39 |
-
Dataset: Custom dataset with 200 annotated sentences.
|
40 |
-
Training Epochs: 3
|
41 |
-
Learning Rate: 2e-5
|
42 |
-
|
43 |
-
|
44 |
-
## To use the model
|
45 |
-
`
|
46 |
-
from transformers import AutoTokenizer, AutoModelForTokenClassification, pipeline
|
47 |
-
|
48 |
-
# Load the model and tokenizer from Hugging Face
|
49 |
-
model = AutoModelForTokenClassification.from_pretrained("username/my-custom-ner-model")
|
50 |
-
tokenizer = AutoTokenizer.from_pretrained("username/my-custom-ner-model")
|
51 |
-
|
52 |
-
# Create an NER pipeline
|
53 |
-
ner_pipeline = pipeline("ner", model=model, tokenizer=tokenizer)
|
54 |
-
|
55 |
-
# Test the pipeline
|
56 |
-
text = "The SALES of BEER and WINE in TTL US is increasing."
|
57 |
-
entities = ner_pipeline(text)
|
58 |
-
print(entities)
|
59 |
-
`
|
|
|
1 |
+
---
|
2 |
+
language: en
|
3 |
+
tags:
|
4 |
+
- token-classification
|
5 |
+
- ner
|
6 |
+
- transformers
|
7 |
+
license: apache-2.0
|
8 |
+
datasets:
|
9 |
+
- custom-dataset
|
10 |
+
metrics:
|
11 |
+
- precision
|
12 |
+
- recall
|
13 |
+
- f1
|
14 |
+
model_name: my-custom-ner-model
|
15 |
+
widget:
|
16 |
+
- text: "The SALES of BEER and WINE in TTL US is increasing."
|
17 |
+
---
|
18 |
+
|
19 |
# My Custom NER Model
|
20 |
|
21 |
+
This is a custom **Named Entity Recognition (NER)** model fine-tuned on domain-specific data using a **BERT-based architecture**.
|
22 |
|
23 |
## Entities
|
24 |
+
The model is trained to recognize the following entities:
|
25 |
+
- **`FACT`**: Facts related to sales, revenue, etc.
|
26 |
+
- **`PRDC_CHAR`**: Product characteristics like product names.
|
27 |
+
- **`MRKT_CHAR`**: Market details like regions.
|
28 |
+
|
29 |
+
---
|
30 |
|
31 |
## Example Usage
|
32 |
|
|
|
44 |
text = "The SALES of BEER and WINE in TTL US is increasing."
|
45 |
entities = ner_pipeline(text)
|
46 |
print(entities)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|