kwoncho commited on
Commit
7d773c6
·
verified ·
1 Parent(s): 9a6e612

Upload official epoch2 TIMEX model

Browse files
README.md ADDED
@@ -0,0 +1,139 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ language:
3
+ - ko
4
+ license: other
5
+ library_name: transformers
6
+ base_model: jhgan/ko-sroberta-multitask
7
+ tags:
8
+ - token-classification
9
+ - named-entity-recognition
10
+ - timex
11
+ - korean
12
+ metrics:
13
+ - f1
14
+ pipeline_tag: token-classification
15
+ model-index:
16
+ - name: ko-sroberta-korean-time-expression-classifier
17
+ results:
18
+ - task:
19
+ type: token-classification
20
+ name: Korean TIMEX3 Detection
21
+ dataset:
22
+ name: 158.시간 표현 탐지 데이터
23
+ type: private
24
+ split: Validation
25
+ metrics:
26
+ - type: f1
27
+ name: Entity F1
28
+ value: 0.8266074116550786
29
+ - type: precision
30
+ name: Entity Precision
31
+ value: 0.8264533883728931
32
+ - type: recall
33
+ name: Entity Recall
34
+ value: 0.8267614923575464
35
+ ---
36
+
37
+ # Korean Time Expression Classifier
38
+
39
+ This model detects Korean TIMEX3 time expressions with BIO token classification labels.
40
+
41
+ The backbone is [`jhgan/ko-sroberta-multitask`](https://huggingface.co/jhgan/ko-sroberta-multitask), fine-tuned on `158.시간 표현 탐지 데이터` for four TIMEX3 entity types:
42
+
43
+ - `DATE`
44
+ - `TIME`
45
+ - `DURATION`
46
+ - `SET`
47
+
48
+ ## Intended Use
49
+
50
+ Use this model to identify Korean time expressions in sentences or utterances. It predicts token-level BIO labels and can be used through the Hugging Face `token-classification` pipeline.
51
+
52
+ This is an experimental model trained for TIMEX3 span detection. It does not extract EVENT or TLINK annotations.
53
+
54
+ ## Training Data
55
+
56
+ The model was trained on the official `Training` split and evaluated on the official `Validation` split of `158.시간 표현 탐지 데이터`.
57
+
58
+ Training/evaluation preprocessing:
59
+
60
+ - Unsupported, empty, malformed, or unalignable TIMEX3 spans are excluded.
61
+ - Records whose TIMEX3 span would be truncated by `max_length=256` are excluded.
62
+ - TIMEX-free records are retained as negative examples.
63
+ - JSON `text` fields are used as the source text.
64
+
65
+ ## Training Configuration
66
+
67
+ ```bash
68
+ python -m time_expression_classifier.train_token_classifier \
69
+ --data-root "158.시간 표현 탐지 데이터" \
70
+ --model-name jhgan/ko-sroberta-multitask \
71
+ --output-dir outputs/official_epoch2 \
72
+ --split-mode official \
73
+ --epochs 2 \
74
+ --learning-rate 3e-5 \
75
+ --batch-size 16 \
76
+ --max-length 256
77
+ ```
78
+
79
+ Key settings:
80
+
81
+ | setting | value |
82
+ | --- | --- |
83
+ | backbone | `jhgan/ko-sroberta-multitask` |
84
+ | epochs | 2 |
85
+ | learning rate | 3e-5 |
86
+ | batch size | 16 |
87
+ | max length | 256 |
88
+ | weight decay | 0.01 |
89
+ | warmup ratio | 0.06 |
90
+ | seed | 42 |
91
+
92
+ ## Evaluation
93
+
94
+ Metrics are entity-level exact match on the official `Validation` split.
95
+
96
+ | metric | value |
97
+ | --- | ---: |
98
+ | entity precision | 0.8265 |
99
+ | entity recall | 0.8268 |
100
+ | entity F1 | 0.8266 |
101
+ | token accuracy | 0.9899 |
102
+ | eval loss | 0.0350 |
103
+
104
+ Per-label entity-level results:
105
+
106
+ | label | precision | recall | F1 | support |
107
+ | --- | ---: | ---: | ---: | ---: |
108
+ | DATE | 0.8495 | 0.8367 | 0.8430 | 23422 |
109
+ | TIME | 0.7933 | 0.8033 | 0.7983 | 3665 |
110
+ | DURATION | 0.7848 | 0.8247 | 0.8042 | 6810 |
111
+ | SET | 0.7107 | 0.6910 | 0.7007 | 974 |
112
+
113
+ ## Usage
114
+
115
+ ```python
116
+ from transformers import pipeline
117
+
118
+ tagger = pipeline(
119
+ "token-classification",
120
+ model="kwoncho/ko-sroberta-korean-time-expression-classifier",
121
+ aggregation_strategy="simple",
122
+ )
123
+
124
+ text = "매주 토요일 저녁에 회의를 합니다."
125
+ print(tagger(text))
126
+ ```
127
+
128
+ ## Limitations
129
+
130
+ - The model is sensitive to ambiguous time expressions such as `주`, `하루`, `시간`, `한달`, `일주일`, and `매일`.
131
+ - `SET` is the lowest-performing label due to smaller support and ambiguity between repeated events and duration expressions.
132
+ - The model predicts TIMEX3 spans only. Normalization to calendar values is not included.
133
+ - Evaluation uses exact span match, so partial boundary differences count as errors.
134
+
135
+ ## Reproducibility
136
+
137
+ Repository: `git@github.com:hyun2019/ko-sroberta-korean-time-expression-classifier.git`
138
+
139
+ The local release artifact is tracked as `models/official_epoch2` via DVC.
config.json ADDED
@@ -0,0 +1,50 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "architectures": [
3
+ "RobertaForTokenClassification"
4
+ ],
5
+ "attention_probs_dropout_prob": 0.1,
6
+ "bos_token_id": 0,
7
+ "classifier_dropout": null,
8
+ "dtype": "float32",
9
+ "eos_token_id": 2,
10
+ "gradient_checkpointing": false,
11
+ "hidden_act": "gelu",
12
+ "hidden_dropout_prob": 0.1,
13
+ "hidden_size": 768,
14
+ "id2label": {
15
+ "0": "O",
16
+ "1": "B-DATE",
17
+ "2": "I-DATE",
18
+ "3": "B-TIME",
19
+ "4": "I-TIME",
20
+ "5": "B-DURATION",
21
+ "6": "I-DURATION",
22
+ "7": "B-SET",
23
+ "8": "I-SET"
24
+ },
25
+ "initializer_range": 0.02,
26
+ "intermediate_size": 3072,
27
+ "label2id": {
28
+ "B-DATE": 1,
29
+ "B-DURATION": 5,
30
+ "B-SET": 7,
31
+ "B-TIME": 3,
32
+ "I-DATE": 2,
33
+ "I-DURATION": 6,
34
+ "I-SET": 8,
35
+ "I-TIME": 4,
36
+ "O": 0
37
+ },
38
+ "layer_norm_eps": 1e-05,
39
+ "max_position_embeddings": 514,
40
+ "model_type": "roberta",
41
+ "num_attention_heads": 12,
42
+ "num_hidden_layers": 12,
43
+ "pad_token_id": 1,
44
+ "position_embedding_type": "absolute",
45
+ "tokenizer_class": "BertTokenizer",
46
+ "transformers_version": "4.57.0",
47
+ "type_vocab_size": 1,
48
+ "use_cache": true,
49
+ "vocab_size": 32000
50
+ }
eval_metrics.json ADDED
@@ -0,0 +1,27 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "eval_loss": 0.034969817847013474,
3
+ "eval_precision": 0.8264533883728931,
4
+ "eval_recall": 0.8267614923575464,
5
+ "eval_f1": 0.8266074116550786,
6
+ "eval_token_accuracy": 0.9898756337293201,
7
+ "eval_label_date_precision": 0.8494581707845688,
8
+ "eval_label_date_recall": 0.8366919989753223,
9
+ "eval_label_date_f1": 0.8430267572915771,
10
+ "eval_label_date_support": 23422,
11
+ "eval_label_time_precision": 0.7933171651845864,
12
+ "eval_label_time_recall": 0.8032742155525239,
13
+ "eval_label_time_f1": 0.7982646420824295,
14
+ "eval_label_time_support": 3665,
15
+ "eval_label_duration_precision": 0.7847959754052544,
16
+ "eval_label_duration_recall": 0.824669603524229,
17
+ "eval_label_duration_f1": 0.8042388658169841,
18
+ "eval_label_duration_support": 6810,
19
+ "eval_label_set_precision": 0.7106652587117213,
20
+ "eval_label_set_recall": 0.6909650924024641,
21
+ "eval_label_set_f1": 0.7006767308693389,
22
+ "eval_label_set_support": 974,
23
+ "eval_runtime": 98.5723,
24
+ "eval_samples_per_second": 455.422,
25
+ "eval_steps_per_second": 28.466,
26
+ "epoch": 2.0
27
+ }
label_map.json ADDED
@@ -0,0 +1,24 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "label_to_id": {
3
+ "O": 0,
4
+ "B-DATE": 1,
5
+ "I-DATE": 2,
6
+ "B-TIME": 3,
7
+ "I-TIME": 4,
8
+ "B-DURATION": 5,
9
+ "I-DURATION": 6,
10
+ "B-SET": 7,
11
+ "I-SET": 8
12
+ },
13
+ "id_to_label": {
14
+ "0": "O",
15
+ "1": "B-DATE",
16
+ "2": "I-DATE",
17
+ "3": "B-TIME",
18
+ "4": "I-TIME",
19
+ "5": "B-DURATION",
20
+ "6": "I-DURATION",
21
+ "7": "B-SET",
22
+ "8": "I-SET"
23
+ }
24
+ }
model.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:382f64854160157ffd0fca9a33ac26b46d5db8e97aab11f62ef973c101a2fcfc
3
+ size 440161684
special_tokens_map.json ADDED
@@ -0,0 +1,51 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "bos_token": {
3
+ "content": "[CLS]",
4
+ "lstrip": false,
5
+ "normalized": false,
6
+ "rstrip": false,
7
+ "single_word": false
8
+ },
9
+ "cls_token": {
10
+ "content": "[CLS]",
11
+ "lstrip": false,
12
+ "normalized": false,
13
+ "rstrip": false,
14
+ "single_word": false
15
+ },
16
+ "eos_token": {
17
+ "content": "[SEP]",
18
+ "lstrip": false,
19
+ "normalized": false,
20
+ "rstrip": false,
21
+ "single_word": false
22
+ },
23
+ "mask_token": {
24
+ "content": "[MASK]",
25
+ "lstrip": false,
26
+ "normalized": false,
27
+ "rstrip": false,
28
+ "single_word": false
29
+ },
30
+ "pad_token": {
31
+ "content": "[PAD]",
32
+ "lstrip": false,
33
+ "normalized": false,
34
+ "rstrip": false,
35
+ "single_word": false
36
+ },
37
+ "sep_token": {
38
+ "content": "[SEP]",
39
+ "lstrip": false,
40
+ "normalized": false,
41
+ "rstrip": false,
42
+ "single_word": false
43
+ },
44
+ "unk_token": {
45
+ "content": "[UNK]",
46
+ "lstrip": false,
47
+ "normalized": false,
48
+ "rstrip": false,
49
+ "single_word": false
50
+ }
51
+ }
tokenizer.json ADDED
The diff for this file is too large to render. See raw diff
 
tokenizer_config.json ADDED
@@ -0,0 +1,67 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "added_tokens_decoder": {
3
+ "0": {
4
+ "content": "[CLS]",
5
+ "lstrip": false,
6
+ "normalized": false,
7
+ "rstrip": false,
8
+ "single_word": false,
9
+ "special": true
10
+ },
11
+ "1": {
12
+ "content": "[PAD]",
13
+ "lstrip": false,
14
+ "normalized": false,
15
+ "rstrip": false,
16
+ "single_word": false,
17
+ "special": true
18
+ },
19
+ "2": {
20
+ "content": "[SEP]",
21
+ "lstrip": false,
22
+ "normalized": false,
23
+ "rstrip": false,
24
+ "single_word": false,
25
+ "special": true
26
+ },
27
+ "3": {
28
+ "content": "[UNK]",
29
+ "lstrip": false,
30
+ "normalized": false,
31
+ "rstrip": false,
32
+ "single_word": false,
33
+ "special": true
34
+ },
35
+ "4": {
36
+ "content": "[MASK]",
37
+ "lstrip": false,
38
+ "normalized": false,
39
+ "rstrip": false,
40
+ "single_word": false,
41
+ "special": true
42
+ }
43
+ },
44
+ "bos_token": "[CLS]",
45
+ "clean_up_tokenization_spaces": false,
46
+ "cls_token": "[CLS]",
47
+ "do_basic_tokenize": true,
48
+ "do_lower_case": false,
49
+ "eos_token": "[SEP]",
50
+ "extra_special_tokens": {},
51
+ "mask_token": "[MASK]",
52
+ "max_length": 128,
53
+ "model_max_length": 512,
54
+ "never_split": null,
55
+ "pad_to_multiple_of": null,
56
+ "pad_token": "[PAD]",
57
+ "pad_token_type_id": 0,
58
+ "padding_side": "right",
59
+ "sep_token": "[SEP]",
60
+ "stride": 0,
61
+ "strip_accents": null,
62
+ "tokenize_chinese_chars": true,
63
+ "tokenizer_class": "BertTokenizer",
64
+ "truncation_side": "right",
65
+ "truncation_strategy": "longest_first",
66
+ "unk_token": "[UNK]"
67
+ }
train.log ADDED
The diff for this file is too large to render. See raw diff
 
training_args.bin ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:fdf542d0e058e1e436f8de44dbf531267f84de401b3bf7b6fe2ba56108bbd3af
3
+ size 5841
vocab.txt ADDED
The diff for this file is too large to render. See raw diff