SenswiseData
commited on
Commit
•
e807c07
1
Parent(s):
b21eeb3
Upload 9 files
Browse files- .gitattributes +0 -4
- README.md +71 -1
- config.json +43 -0
- pytorch_model.bin +3 -0
- special_tokens_map.json +1 -0
- tokenizer.json +0 -0
- tokenizer_config.json +1 -0
- training_args.bin +3 -0
- vocab.txt +0 -0
.gitattributes
CHANGED
@@ -2,13 +2,11 @@
|
|
2 |
*.arrow filter=lfs diff=lfs merge=lfs -text
|
3 |
*.bin filter=lfs diff=lfs merge=lfs -text
|
4 |
*.bz2 filter=lfs diff=lfs merge=lfs -text
|
5 |
-
*.ckpt filter=lfs diff=lfs merge=lfs -text
|
6 |
*.ftz filter=lfs diff=lfs merge=lfs -text
|
7 |
*.gz filter=lfs diff=lfs merge=lfs -text
|
8 |
*.h5 filter=lfs diff=lfs merge=lfs -text
|
9 |
*.joblib filter=lfs diff=lfs merge=lfs -text
|
10 |
*.lfs.* filter=lfs diff=lfs merge=lfs -text
|
11 |
-
*.mlmodel filter=lfs diff=lfs merge=lfs -text
|
12 |
*.model filter=lfs diff=lfs merge=lfs -text
|
13 |
*.msgpack filter=lfs diff=lfs merge=lfs -text
|
14 |
*.npy filter=lfs diff=lfs merge=lfs -text
|
@@ -22,10 +20,8 @@
|
|
22 |
*.pt filter=lfs diff=lfs merge=lfs -text
|
23 |
*.pth filter=lfs diff=lfs merge=lfs -text
|
24 |
*.rar filter=lfs diff=lfs merge=lfs -text
|
25 |
-
*.safetensors filter=lfs diff=lfs merge=lfs -text
|
26 |
saved_model/**/* filter=lfs diff=lfs merge=lfs -text
|
27 |
*.tar.* filter=lfs diff=lfs merge=lfs -text
|
28 |
-
*.tar filter=lfs diff=lfs merge=lfs -text
|
29 |
*.tflite filter=lfs diff=lfs merge=lfs -text
|
30 |
*.tgz filter=lfs diff=lfs merge=lfs -text
|
31 |
*.wasm filter=lfs diff=lfs merge=lfs -text
|
|
|
2 |
*.arrow filter=lfs diff=lfs merge=lfs -text
|
3 |
*.bin filter=lfs diff=lfs merge=lfs -text
|
4 |
*.bz2 filter=lfs diff=lfs merge=lfs -text
|
|
|
5 |
*.ftz filter=lfs diff=lfs merge=lfs -text
|
6 |
*.gz filter=lfs diff=lfs merge=lfs -text
|
7 |
*.h5 filter=lfs diff=lfs merge=lfs -text
|
8 |
*.joblib filter=lfs diff=lfs merge=lfs -text
|
9 |
*.lfs.* filter=lfs diff=lfs merge=lfs -text
|
|
|
10 |
*.model filter=lfs diff=lfs merge=lfs -text
|
11 |
*.msgpack filter=lfs diff=lfs merge=lfs -text
|
12 |
*.npy filter=lfs diff=lfs merge=lfs -text
|
|
|
20 |
*.pt filter=lfs diff=lfs merge=lfs -text
|
21 |
*.pth filter=lfs diff=lfs merge=lfs -text
|
22 |
*.rar filter=lfs diff=lfs merge=lfs -text
|
|
|
23 |
saved_model/**/* filter=lfs diff=lfs merge=lfs -text
|
24 |
*.tar.* filter=lfs diff=lfs merge=lfs -text
|
|
|
25 |
*.tflite filter=lfs diff=lfs merge=lfs -text
|
26 |
*.tgz filter=lfs diff=lfs merge=lfs -text
|
27 |
*.wasm filter=lfs diff=lfs merge=lfs -text
|
README.md
CHANGED
@@ -1,3 +1,73 @@
|
|
1 |
---
|
2 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
3 |
---
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
---
|
2 |
+
tags:
|
3 |
+
- ner
|
4 |
+
- token-classification
|
5 |
+
- berturk
|
6 |
+
- turkish
|
7 |
+
language: tr
|
8 |
+
datasets:
|
9 |
+
- MilliyetNER
|
10 |
+
widget:
|
11 |
+
- text: "Türkiye'nin başkenti Ankara'dır ve ilk cumhurbaşkanı Mustafa Kemal Atatürk'tür."
|
12 |
---
|
13 |
+
|
14 |
+
# DATASET
|
15 |
+
MilliyetNER dataset was collected from the Turkish Milliyet newspaper articles between 1997-1998. This dataset is presented by [Tür et al. (2003)](https://www.cambridge.org/core/journals/natural-language-engineering/article/abs/statistical-information-extraction-system-for-turkish/7C288FAFC71D5F0763C1F8CE66464017). It was collected from news articles and manually annotated with three different entity types: Person, Location, Organization. The authors did not provide training/validation/test splits for this dataset. Dataset splits used by [Yeniterzi et al. 2011](https://aclanthology.org/P11-3019).
|
16 |
+
For more information: [tdd.ai - MilliyetNER](https://data.tdd.ai/#/effafb5f-ebfc-4e5c-9a63-4f709ec1a135)
|
17 |
+
**Model is only trained using training set. Test set not included during the last training**.
|
18 |
+
|
19 |
+
# USAGE
|
20 |
+
```python
|
21 |
+
from transformers import pipeline, AutoModelForTokenClassification, AutoTokenizer
|
22 |
+
model = AutoModelForTokenClassification.from_pretrained("alierenak/berturk-cased-ner")
|
23 |
+
tokenizer = AutoTokenizer.from_pretrained("alierenak/berturk-cased-ner")
|
24 |
+
ner_pipeline = pipeline('ner', model=model, tokenizer=tokenizer)
|
25 |
+
ner_pipeline("Türkiye'nin başkenti Ankara, ilk cumhurbaşkanı Mustafa Kemal Atatürk'tür.")
|
26 |
+
```
|
27 |
+
|
28 |
+
# RESULT
|
29 |
+
```bash
|
30 |
+
[{'entity': 'B-LOCATION',
|
31 |
+
'score': 0.9966415,
|
32 |
+
'index': 1,
|
33 |
+
'word': 'Türkiye',
|
34 |
+
'start': 0,
|
35 |
+
'end': 7},
|
36 |
+
{'entity': 'B-LOCATION',
|
37 |
+
'score': 0.99456763,
|
38 |
+
'index': 5,
|
39 |
+
'word': 'Ankara',
|
40 |
+
'start': 21,
|
41 |
+
'end': 27},
|
42 |
+
{'entity': 'B-PERSON',
|
43 |
+
'score': 0.9958741,
|
44 |
+
'index': 9,
|
45 |
+
'word': 'Mustafa',
|
46 |
+
'start': 47,
|
47 |
+
'end': 54},
|
48 |
+
{'entity': 'I-PERSON',
|
49 |
+
'score': 0.98833394,
|
50 |
+
'index': 10,
|
51 |
+
'word': 'Kemal',
|
52 |
+
'start': 55,
|
53 |
+
'end': 60},
|
54 |
+
{'entity': 'I-PERSON',
|
55 |
+
'score': 0.9837286,
|
56 |
+
'index': 11,
|
57 |
+
'word': 'Atatürk',
|
58 |
+
'start': 61,
|
59 |
+
'end': 68}]
|
60 |
+
```
|
61 |
+
|
62 |
+
# BENCHMARKING
|
63 |
+
```bash
|
64 |
+
precision recall f1-score support
|
65 |
+
|
66 |
+
LOCATION 0.97 0.96 0.97 960
|
67 |
+
ORGANIZATION 0.95 0.92 0.94 863
|
68 |
+
PERSON 0.97 0.97 0.97 1410
|
69 |
+
|
70 |
+
micro avg 0.97 0.95 0.96 3233
|
71 |
+
macro avg 0.96 0.95 0.96 3233
|
72 |
+
weighted avg 0.97 0.95 0.96 3233
|
73 |
+
```
|
config.json
ADDED
@@ -0,0 +1,43 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
{
|
2 |
+
"_name_or_path": "dbmdz/bert-base-turkish-cased",
|
3 |
+
"architectures": [
|
4 |
+
"BertForTokenClassification"
|
5 |
+
],
|
6 |
+
"attention_probs_dropout_prob": 0.1,
|
7 |
+
"gradient_checkpointing": false,
|
8 |
+
"hidden_act": "gelu",
|
9 |
+
"hidden_dropout_prob": 0.1,
|
10 |
+
"hidden_size": 768,
|
11 |
+
"id2label": {
|
12 |
+
"0": "B-LOCATION",
|
13 |
+
"1": "B-ORGANIZATION",
|
14 |
+
"2": "B-PERSON",
|
15 |
+
"3": "I-LOCATION",
|
16 |
+
"4": "I-ORGANIZATION",
|
17 |
+
"5": "I-PERSON",
|
18 |
+
"6": "O"
|
19 |
+
},
|
20 |
+
"initializer_range": 0.02,
|
21 |
+
"intermediate_size": 3072,
|
22 |
+
"label2id": {
|
23 |
+
"B-LOCATION": 0,
|
24 |
+
"B-ORGANIZATION": 1,
|
25 |
+
"B-PERSON": 2,
|
26 |
+
"I-LOCATION": 3,
|
27 |
+
"I-ORGANIZATION": 4,
|
28 |
+
"I-PERSON": 5,
|
29 |
+
"O": 6
|
30 |
+
},
|
31 |
+
"layer_norm_eps": 1e-12,
|
32 |
+
"max_position_embeddings": 512,
|
33 |
+
"model_type": "bert",
|
34 |
+
"num_attention_heads": 12,
|
35 |
+
"num_hidden_layers": 12,
|
36 |
+
"pad_token_id": 0,
|
37 |
+
"position_embedding_type": "absolute",
|
38 |
+
"torch_dtype": "float32",
|
39 |
+
"transformers_version": "4.9.2",
|
40 |
+
"type_vocab_size": 2,
|
41 |
+
"use_cache": true,
|
42 |
+
"vocab_size": 32000
|
43 |
+
}
|
pytorch_model.bin
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:0d8ebf8e442ab3111024ca2fae2f92c8061b6fa7f4c094112b43ff40b8e49234
|
3 |
+
size 440215056
|
special_tokens_map.json
ADDED
@@ -0,0 +1 @@
|
|
|
|
|
1 |
+
{"unk_token": "[UNK]", "sep_token": "[SEP]", "pad_token": "[PAD]", "cls_token": "[CLS]", "mask_token": "[MASK]"}
|
tokenizer.json
ADDED
The diff for this file is too large to render.
See raw diff
|
|
tokenizer_config.json
ADDED
@@ -0,0 +1 @@
|
|
|
|
|
1 |
+
{"do_lower_case": false, "unk_token": "[UNK]", "sep_token": "[SEP]", "pad_token": "[PAD]", "cls_token": "[CLS]", "mask_token": "[MASK]", "tokenize_chinese_chars": true, "strip_accents": null, "max_len": 512, "special_tokens_map_file": null, "name_or_path": "dbmdz/bert-base-turkish-cased", "do_basic_tokenize": true, "never_split": null, "tokenizer_class": "BertTokenizer"}
|
training_args.bin
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:e5f708e2458bf41fff0ba3f13a4b7fa875d90004240b8db6644c0b8831d21264
|
3 |
+
size 2607
|
vocab.txt
ADDED
The diff for this file is too large to render.
See raw diff
|
|