Create README.md
Browse files
README.md
ADDED
@@ -0,0 +1,33 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
---
|
2 |
+
language: tr
|
3 |
+
widget:
|
4 |
+
- text: "Mustafa Kemal Atatürk 19 Mayıs 1919'da Samsun'a çıktı."
|
5 |
+
---
|
6 |
+
# Turkish Named Entity Recognition (NER) Model
|
7 |
+
This model is the fine-tuned version of "mDeBERTa-v3-base"
|
8 |
+
(a multilingual version of DeBERTa V3)
|
9 |
+
using a reviewed version of well known Turkish NER dataset
|
10 |
+
(https://github.com/stefan-it/turkish-bert/files/4558187/nerdata.txt).
|
11 |
+
# Fine-tuning parameters:
|
12 |
+
```
|
13 |
+
task = "ner"
|
14 |
+
model_checkpoint = "xlm-roberta-base"
|
15 |
+
batch_size = 8
|
16 |
+
label_list = ['O', 'B-PER', 'I-PER', 'B-ORG', 'I-ORG', 'B-LOC', 'I-LOC']
|
17 |
+
max_length = 512
|
18 |
+
learning_rate = 2e-5
|
19 |
+
num_train_epochs = 2
|
20 |
+
weight_decay = 0.01
|
21 |
+
```
|
22 |
+
# How to use:
|
23 |
+
```
|
24 |
+
model = AutoModelForTokenClassification.from_pretrained("akdeniz27/mDeBERTa-v3-base-turkish-ner")
|
25 |
+
tokenizer = AutoTokenizer.from_pretrained("akdeniz27/mDeBERTa-v3-base-turkish-ner")
|
26 |
+
ner = pipeline('ner', model=model, tokenizer=tokenizer, aggregation_strategy="simple")
|
27 |
+
ner("<your text here>")
|
28 |
+
```
|
29 |
+
Pls refer "https://huggingface.co/transformers/_modules/transformers/pipelines/token_classification.html" for entity grouping with aggregation_strategy parameter.
|
30 |
+
# Reference test results:
|
31 |
+
* f1: 0.95
|
32 |
+
* precision: 0.94
|
33 |
+
* recall: 0.96
|