SenswiseData commited on
Commit
c712d6e
1 Parent(s): fb61478

Upload 8 files

Browse files
README.md ADDED
@@ -0,0 +1,73 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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:488645a9d31fe8f4dd947a0003a1d9d7e01396a4052d83b00caf2d7e31caadcc
3
+ size 134
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:588c1a87288f783f6c29a6d0701f1b68a1a59baed8bd0586d836e14515955e22
3
+ size 129
vocab.txt ADDED
The diff for this file is too large to render. See raw diff