fabhiansan commited on
Commit
75422ac
·
verified ·
1 Parent(s): 36abe96

Upload Indo RoBERTa Base for NLI for Indonesian NLI

Browse files
README.md ADDED
@@ -0,0 +1,73 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ language: id
3
+ license: mit
4
+ tags:
5
+ - indonesian
6
+ - nli
7
+ - natural-language-inference
8
+ - text-classification
9
+ - afaji--indonli
10
+ datasets:
11
+ - afaji/indonli
12
+ ---
13
+ # Unknown for Indonesian Natural Language Inference
14
+
15
+ This model is fine-tuned on the [IndoNLI dataset](afaji/indonli) for natural language inference in Indonesian.
16
+
17
+ ## Model Description
18
+
19
+ - **Model Type:** Unknown
20
+ - **Task:** Natural Language Inference (Textual Entailment)
21
+ - **Language:** Indonesian
22
+ - **License:** MIT
23
+
24
+ ## Training Procedure
25
+
26
+ ## Dataset
27
+
28
+ This model was trained on the [IndoNLI dataset](afaji/indonli), which contains 10k sentence pairs as a benchmark for natural language inference (NLI) in Indonesian.
29
+
30
+ The dataset is split into:
31
+ - Training set: 10k pairs
32
+ - Validation set: 2.5k pairs
33
+ - Test set (lay): 2.5k pairs
34
+ - Test set (expert): 2.5k pairs
35
+
36
+ ## Usage
37
+
38
+ ```python
39
+ from transformers import AutoTokenizer, AutoModelForSequenceClassification
40
+
41
+ tokenizer = AutoTokenizer.from_pretrained("fabhiansan/indo-roberta-nli")
42
+ model = AutoModelForSequenceClassification.from_pretrained("fabhiansan/indo-roberta-nli")
43
+
44
+ # Prepare the input
45
+ premise = "Seorang wanita sedang makan di restoran."
46
+ hypothesis = "Seorang wanita sedang berada di luar ruangan."
47
+
48
+ # Tokenize the input
49
+ inputs = tokenizer(premise, hypothesis, return_tensors="pt")
50
+
51
+ # Get the prediction
52
+ outputs = model(**inputs)
53
+ predictions = outputs.logits.argmax(dim=1)
54
+
55
+ # Map predictions to labels
56
+ id2label = {0: "entailment", 1: "neutral", 2: "contradiction"}
57
+ predicted_label = id2label[predictions.item()]
58
+ print(f"Predicted label: {predicted_label}")
59
+ ```
60
+
61
+ ## Citation
62
+
63
+ If you use this model, please cite the IndoNLI paper:
64
+
65
+ ```bibtex
66
+ @inproceedings{mahendra-etal-2021-indonli,
67
+ title = {IndoNLI: A Natural Language Inference Dataset for Indonesian},
68
+ author = {Mahendra, Rahmad and Aji, Alham Fikri and Louvan, Samuel and Rahman, Fahrurrozi and Vania, Clara},
69
+ booktitle = {Proceedings of the 2021 Conference on Empirical Methods in Natural Language Processing},
70
+ year = {2021},
71
+ publisher = {Association for Computational Linguistics},
72
+ }
73
+ ```
config.json ADDED
@@ -0,0 +1,38 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "architectures": [
3
+ "RobertaForSequenceClassification"
4
+ ],
5
+ "attention_probs_dropout_prob": 0.1,
6
+ "bos_token_id": 0,
7
+ "classifier_dropout": null,
8
+ "eos_token_id": 2,
9
+ "gradient_checkpointing": false,
10
+ "hidden_act": "gelu",
11
+ "hidden_dropout_prob": 0.1,
12
+ "hidden_size": 768,
13
+ "id2label": {
14
+ "0": "LABEL_0",
15
+ "1": "LABEL_1",
16
+ "2": "LABEL_2"
17
+ },
18
+ "initializer_range": 0.02,
19
+ "intermediate_size": 3072,
20
+ "label2id": {
21
+ "LABEL_0": 0,
22
+ "LABEL_1": 1,
23
+ "LABEL_2": 2
24
+ },
25
+ "layer_norm_eps": 1e-05,
26
+ "max_position_embeddings": 514,
27
+ "model_type": "roberta",
28
+ "num_attention_heads": 12,
29
+ "num_hidden_layers": 12,
30
+ "pad_token_id": 1,
31
+ "position_embedding_type": "absolute",
32
+ "problem_type": "single_label_classification",
33
+ "torch_dtype": "float32",
34
+ "transformers_version": "4.50.0",
35
+ "type_vocab_size": 1,
36
+ "use_cache": true,
37
+ "vocab_size": 50265
38
+ }
merges.txt ADDED
The diff for this file is too large to render. See raw diff
 
model.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:fcc33e96a8115f3ed8a6ef50313eb4ec1056cd6eeeacce8fd6e5ba0203f6a036
3
+ size 498615900
pretrained_model_name.txt ADDED
@@ -0,0 +1 @@
 
 
1
+ flax-community/indonesian-roberta-base
special_tokens_map.json ADDED
@@ -0,0 +1,51 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "bos_token": {
3
+ "content": "<s>",
4
+ "lstrip": false,
5
+ "normalized": false,
6
+ "rstrip": false,
7
+ "single_word": false
8
+ },
9
+ "cls_token": {
10
+ "content": "<s>",
11
+ "lstrip": false,
12
+ "normalized": false,
13
+ "rstrip": false,
14
+ "single_word": false
15
+ },
16
+ "eos_token": {
17
+ "content": "</s>",
18
+ "lstrip": false,
19
+ "normalized": false,
20
+ "rstrip": false,
21
+ "single_word": false
22
+ },
23
+ "mask_token": {
24
+ "content": "<mask>",
25
+ "lstrip": true,
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": "</s>",
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,58 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "add_prefix_space": false,
3
+ "added_tokens_decoder": {
4
+ "0": {
5
+ "content": "<s>",
6
+ "lstrip": false,
7
+ "normalized": false,
8
+ "rstrip": false,
9
+ "single_word": false,
10
+ "special": true
11
+ },
12
+ "1": {
13
+ "content": "<pad>",
14
+ "lstrip": false,
15
+ "normalized": false,
16
+ "rstrip": false,
17
+ "single_word": false,
18
+ "special": true
19
+ },
20
+ "2": {
21
+ "content": "</s>",
22
+ "lstrip": false,
23
+ "normalized": false,
24
+ "rstrip": false,
25
+ "single_word": false,
26
+ "special": true
27
+ },
28
+ "3": {
29
+ "content": "<unk>",
30
+ "lstrip": false,
31
+ "normalized": false,
32
+ "rstrip": false,
33
+ "single_word": false,
34
+ "special": true
35
+ },
36
+ "4": {
37
+ "content": "<mask>",
38
+ "lstrip": true,
39
+ "normalized": false,
40
+ "rstrip": false,
41
+ "single_word": false,
42
+ "special": true
43
+ }
44
+ },
45
+ "bos_token": "<s>",
46
+ "clean_up_tokenization_spaces": false,
47
+ "cls_token": "<s>",
48
+ "eos_token": "</s>",
49
+ "errors": "replace",
50
+ "extra_special_tokens": {},
51
+ "mask_token": "<mask>",
52
+ "model_max_length": 1000000000000000019884624838656,
53
+ "pad_token": "<pad>",
54
+ "sep_token": "</s>",
55
+ "tokenizer_class": "RobertaTokenizer",
56
+ "trim_offsets": true,
57
+ "unk_token": "<unk>"
58
+ }
vocab.json ADDED
The diff for this file is too large to render. See raw diff