Create README.md
Browse files
README.md
ADDED
@@ -0,0 +1,37 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
--
|
2 |
+
language: tr
|
3 |
+
---
|
4 |
+
|
5 |
+
# Turkish Named Entity Recognition (NER) Model
|
6 |
+
|
7 |
+
This model is the fine-tuned model of dbmdz/bert-base-turkish-cased
|
8 |
+
using a reviewed version of well known Turkish NER dataset
|
9 |
+
(https://github.com/stefan-it/turkish-bert/files/4558187/nerdata.txt).
|
10 |
+
|
11 |
+
# Fine-tuning parameters:
|
12 |
+
```
|
13 |
+
task = "ner"
|
14 |
+
model_checkpoint = "dbmdz/bert-base-turkish-cased"
|
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 = 3
|
20 |
+
weight_decay = 0.01
|
21 |
+
```
|
22 |
+
|
23 |
+
# How to use:
|
24 |
+
```
|
25 |
+
model = AutoModelForTokenClassification.from_pretrained("akdeniz27/bert-base-turkish-cased-ner")
|
26 |
+
tokenizer = AutoTokenizer.from_pretrained("akdeniz27/bert-base-turkish-cased-ner")
|
27 |
+
ner = pipeline('ner', model=model, tokenizer=tokenizer, aggregation_strategy="first")
|
28 |
+
NER("text")
|
29 |
+
|
30 |
+
# Pls refer "https://huggingface.co/transformers/_modules/transformers/pipelines/token_classification.html" for entity grouping with aggregation_strategy parameter.
|
31 |
+
```
|
32 |
+
|
33 |
+
# Reference test results:
|
34 |
+
* accuracy: 0.9933935699477056
|
35 |
+
* f1: 0.9592969472710453
|
36 |
+
* precision: 0.9543530277931161
|
37 |
+
* recall: 0.9642923563325274
|