Added Model
Browse files- 0_Transformer/config.json +47 -0
- 0_Transformer/pytorch_model.bin +3 -0
- 0_Transformer/sentence_bert_config.json +4 -0
- 0_Transformer/special_tokens_map.json +7 -0
- 0_Transformer/tokenizer.json +0 -0
- 0_Transformer/tokenizer_config.json +15 -0
- 0_Transformer/vocab.txt +0 -0
- 1_Pooling/config.json +9 -0
- 2_Dense/config.json +1 -0
- 2_Dense/pytorch_model.bin +3 -0
- README.md +87 -1
- config_sentence_transformers.json +7 -0
- eval/similarity_evaluation_results.csv +21 -0
- modules.json +20 -0
0_Transformer/config.json
ADDED
@@ -0,0 +1,47 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
{
|
2 |
+
"_name_or_path": "indobenchmark/indobert-base-p1",
|
3 |
+
"_num_labels": 5,
|
4 |
+
"architectures": [
|
5 |
+
"BertModel"
|
6 |
+
],
|
7 |
+
"attention_probs_dropout_prob": 0.1,
|
8 |
+
"classifier_dropout": null,
|
9 |
+
"directionality": "bidi",
|
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 |
+
"3": "LABEL_3",
|
18 |
+
"4": "LABEL_4"
|
19 |
+
},
|
20 |
+
"initializer_range": 0.02,
|
21 |
+
"intermediate_size": 3072,
|
22 |
+
"label2id": {
|
23 |
+
"LABEL_0": 0,
|
24 |
+
"LABEL_1": 1,
|
25 |
+
"LABEL_2": 2,
|
26 |
+
"LABEL_3": 3,
|
27 |
+
"LABEL_4": 4
|
28 |
+
},
|
29 |
+
"layer_norm_eps": 1e-12,
|
30 |
+
"max_position_embeddings": 512,
|
31 |
+
"model_type": "bert",
|
32 |
+
"num_attention_heads": 12,
|
33 |
+
"num_hidden_layers": 12,
|
34 |
+
"output_past": true,
|
35 |
+
"pad_token_id": 0,
|
36 |
+
"pooler_fc_size": 768,
|
37 |
+
"pooler_num_attention_heads": 12,
|
38 |
+
"pooler_num_fc_layers": 3,
|
39 |
+
"pooler_size_per_head": 128,
|
40 |
+
"pooler_type": "first_token_transform",
|
41 |
+
"position_embedding_type": "absolute",
|
42 |
+
"torch_dtype": "float32",
|
43 |
+
"transformers_version": "4.29.2",
|
44 |
+
"type_vocab_size": 2,
|
45 |
+
"use_cache": true,
|
46 |
+
"vocab_size": 50000
|
47 |
+
}
|
0_Transformer/pytorch_model.bin
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:ad4564a3774dbe82eeefe962f42daaf170f877615af0986aad2b3cab59aa890b
|
3 |
+
size 497836589
|
0_Transformer/sentence_bert_config.json
ADDED
@@ -0,0 +1,4 @@
|
|
|
|
|
|
|
|
|
|
|
1 |
+
{
|
2 |
+
"max_seq_length": 32,
|
3 |
+
"do_lower_case": false
|
4 |
+
}
|
0_Transformer/special_tokens_map.json
ADDED
@@ -0,0 +1,7 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
{
|
2 |
+
"cls_token": "[CLS]",
|
3 |
+
"mask_token": "[MASK]",
|
4 |
+
"pad_token": "[PAD]",
|
5 |
+
"sep_token": "[SEP]",
|
6 |
+
"unk_token": "[UNK]"
|
7 |
+
}
|
0_Transformer/tokenizer.json
ADDED
The diff for this file is too large to render.
See raw diff
|
|
0_Transformer/tokenizer_config.json
ADDED
@@ -0,0 +1,15 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
{
|
2 |
+
"clean_up_tokenization_spaces": true,
|
3 |
+
"cls_token": "[CLS]",
|
4 |
+
"do_basic_tokenize": true,
|
5 |
+
"do_lower_case": true,
|
6 |
+
"mask_token": "[MASK]",
|
7 |
+
"model_max_length": 1000000000000000019884624838656,
|
8 |
+
"never_split": null,
|
9 |
+
"pad_token": "[PAD]",
|
10 |
+
"sep_token": "[SEP]",
|
11 |
+
"strip_accents": null,
|
12 |
+
"tokenize_chinese_chars": true,
|
13 |
+
"tokenizer_class": "BertTokenizer",
|
14 |
+
"unk_token": "[UNK]"
|
15 |
+
}
|
0_Transformer/vocab.txt
ADDED
The diff for this file is too large to render.
See raw diff
|
|
1_Pooling/config.json
ADDED
@@ -0,0 +1,9 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
{
|
2 |
+
"word_embedding_dimension": 768,
|
3 |
+
"pooling_mode_cls_token": false,
|
4 |
+
"pooling_mode_mean_tokens": true,
|
5 |
+
"pooling_mode_max_tokens": false,
|
6 |
+
"pooling_mode_mean_sqrt_len_tokens": false,
|
7 |
+
"pooling_mode_weightedmean_tokens": false,
|
8 |
+
"pooling_mode_lasttoken": false
|
9 |
+
}
|
2_Dense/config.json
ADDED
@@ -0,0 +1 @@
|
|
|
|
|
1 |
+
{"in_features": 768, "out_features": 768, "bias": true, "activation_function": "torch.nn.modules.activation.Tanh"}
|
2_Dense/pytorch_model.bin
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:4d21d3f20cfb49517328d2a0d9dd2192604f39521ac5695bd327e94b98f047f6
|
3 |
+
size 2363583
|
README.md
CHANGED
@@ -1,3 +1,89 @@
|
|
1 |
---
|
2 |
-
|
|
|
|
|
|
|
|
|
3 |
---
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
---
|
2 |
+
pipeline_tag: sentence-similarity
|
3 |
+
tags:
|
4 |
+
- sentence-transformers
|
5 |
+
- feature-extraction
|
6 |
+
- sentence-similarity
|
7 |
---
|
8 |
+
|
9 |
+
# {MODEL_NAME}
|
10 |
+
|
11 |
+
This is a [sentence-transformers](https://www.SBERT.net) model: It maps sentences & paragraphs to a 768 dimensional dense vector space and can be used for tasks like clustering or semantic search.
|
12 |
+
|
13 |
+
<!--- Describe your model here -->
|
14 |
+
|
15 |
+
## Usage (Sentence-Transformers)
|
16 |
+
|
17 |
+
Using this model becomes easy when you have [sentence-transformers](https://www.SBERT.net) installed:
|
18 |
+
|
19 |
+
```
|
20 |
+
pip install -U sentence-transformers
|
21 |
+
```
|
22 |
+
|
23 |
+
Then you can use the model like this:
|
24 |
+
|
25 |
+
```python
|
26 |
+
from sentence_transformers import SentenceTransformer
|
27 |
+
sentences = ["This is an example sentence", "Each sentence is converted"]
|
28 |
+
|
29 |
+
model = SentenceTransformer('{MODEL_NAME}')
|
30 |
+
embeddings = model.encode(sentences)
|
31 |
+
print(embeddings)
|
32 |
+
```
|
33 |
+
|
34 |
+
|
35 |
+
|
36 |
+
## Evaluation Results
|
37 |
+
|
38 |
+
<!--- Describe how your model was evaluated -->
|
39 |
+
|
40 |
+
For an automated evaluation of this model, see the *Sentence Embeddings Benchmark*: [https://seb.sbert.net](https://seb.sbert.net?model_name={MODEL_NAME})
|
41 |
+
|
42 |
+
|
43 |
+
## Training
|
44 |
+
The model was trained with the parameters:
|
45 |
+
|
46 |
+
**DataLoader**:
|
47 |
+
|
48 |
+
`torch.utils.data.dataloader.DataLoader` of length 6524 with parameters:
|
49 |
+
```
|
50 |
+
{'batch_size': 128, 'sampler': 'torch.utils.data.sampler.RandomSampler', 'batch_sampler': 'torch.utils.data.sampler.BatchSampler'}
|
51 |
+
```
|
52 |
+
|
53 |
+
**Loss**:
|
54 |
+
|
55 |
+
`sentence_transformers_congen.losses.ConGenLoss.ConGenLoss`
|
56 |
+
|
57 |
+
Parameters of the fit()-Method:
|
58 |
+
```
|
59 |
+
{
|
60 |
+
"epochs": 20,
|
61 |
+
"evaluation_steps": 0,
|
62 |
+
"evaluator": "sentence_transformers.evaluation.EmbeddingSimilarityEvaluator.EmbeddingSimilarityEvaluator",
|
63 |
+
"max_grad_norm": 1,
|
64 |
+
"optimizer_class": "<class 'transformers.optimization.AdamW'>",
|
65 |
+
"optimizer_params": {
|
66 |
+
"correct_bias": false,
|
67 |
+
"eps": 1e-06,
|
68 |
+
"lr": 0.0001
|
69 |
+
},
|
70 |
+
"scheduler": "WarmupLinear",
|
71 |
+
"steps_per_epoch": null,
|
72 |
+
"warmup_steps": 13048,
|
73 |
+
"weight_decay": 0.01
|
74 |
+
}
|
75 |
+
```
|
76 |
+
|
77 |
+
|
78 |
+
## Full Model Architecture
|
79 |
+
```
|
80 |
+
SentenceTransformer(
|
81 |
+
(0): Transformer({'max_seq_length': 32, 'do_lower_case': False}) with Transformer model: BertModel
|
82 |
+
(1): Pooling({'word_embedding_dimension': 768, 'pooling_mode_cls_token': False, 'pooling_mode_mean_tokens': True, 'pooling_mode_max_tokens': False, 'pooling_mode_mean_sqrt_len_tokens': False, 'pooling_mode_weightedmean_tokens': False, 'pooling_mode_lasttoken': False})
|
83 |
+
(2): Dense({'in_features': 768, 'out_features': 768, 'bias': True, 'activation_function': 'torch.nn.modules.activation.Tanh'})
|
84 |
+
)
|
85 |
+
```
|
86 |
+
|
87 |
+
## Citing & Authors
|
88 |
+
|
89 |
+
<!--- Describe where people can find more information -->
|
config_sentence_transformers.json
ADDED
@@ -0,0 +1,7 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
{
|
2 |
+
"__version__": {
|
3 |
+
"sentence_transformers": "1.0.0",
|
4 |
+
"transformers": "4.29.2",
|
5 |
+
"pytorch": "2.0.1+cu117"
|
6 |
+
}
|
7 |
+
}
|
eval/similarity_evaluation_results.csv
ADDED
@@ -0,0 +1,21 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
epoch,steps,cosine_pearson,cosine_spearman,euclidean_pearson,euclidean_spearman,manhattan_pearson,manhattan_spearman,dot_pearson,dot_spearman
|
2 |
+
0,-1,0.720948010920777,0.7318347872028519,0.7521264301309405,0.7379601749636464,0.7515344581032484,0.7373706131991906,0.6249902611251258,0.5888321338604097
|
3 |
+
1,-1,0.7494584852913209,0.7646410348252027,0.7844000621213362,0.7732799361034216,0.7840380894151099,0.7731018484823053,0.6005862285785628,0.5735568251570807
|
4 |
+
2,-1,0.7630490563175665,0.7782263077296959,0.7956413251252823,0.7874269928516233,0.7950814737459496,0.7868736501371603,0.5954446290373088,0.5712464805519586
|
5 |
+
3,-1,0.7724226850899856,0.788195861328848,0.8038544538147719,0.7964790437776093,0.8030687977157446,0.7957734555146984,0.6051000455003802,0.5798886330048546
|
6 |
+
4,-1,0.7734833520666474,0.7884292562013986,0.8051303140916412,0.7972042046159638,0.8042873074979789,0.7964505523258834,0.6164511495574725,0.5887004681166509
|
7 |
+
5,-1,0.7798480082967596,0.7931786547628746,0.8097474589708866,0.8020643411351454,0.808622726506574,0.8008546314289889,0.6053765776673794,0.5819081222174566
|
8 |
+
6,-1,0.7820808574669538,0.7938381247495598,0.8098837917401253,0.801175524027307,0.8091300428685745,0.8004698093112456,0.6073181005913465,0.5825225663671806
|
9 |
+
7,-1,0.784512802445834,0.7960490224497195,0.811740451796979,0.8038961008294317,0.8109057516213092,0.8028675244232547,0.6090420752496344,0.5842722491995513
|
10 |
+
8,-1,0.7841913574952999,0.7950928355209703,0.810531869949439,0.8029019875471413,0.8096061803462264,0.8018016423310613,0.6003359865946626,0.5788884937302443
|
11 |
+
9,-1,0.7854179322739016,0.7959824014979426,0.8107917995491101,0.80291754608718,0.8099549442408015,0.8020398820197678,0.5832341159919637,0.5616069787169705
|
12 |
+
10,-1,0.7870223731784464,0.797042884583984,0.8103306921152701,0.8024880639548911,0.8096465935625113,0.8015946573984308,0.5903871445145286,0.5692880088191473
|
13 |
+
11,-1,0.7880653169231259,0.7971274615623877,0.8103035592258525,0.8025793356800125,0.8095856288918871,0.8014464103049795,0.5730872604445766,0.5532918372200876
|
14 |
+
12,-1,0.7893964035391344,0.7994389827242512,0.8108904112412689,0.8035741435162839,0.8101043729755059,0.802566499200977,0.5702460490119903,0.5499339909281133
|
15 |
+
13,-1,0.7916905172471835,0.8012437111611985,0.8118679434652487,0.804785096161694,0.8111121158706343,0.8037354948741517,0.5627458578490886,0.5422816577639485
|
16 |
+
14,-1,0.7937394690799646,0.8021106452997423,0.8113622980096243,0.803717127223244,0.810593483102004,0.8027651058392473,0.5686256530839918,0.5478862871568512
|
17 |
+
15,-1,0.7920850636537244,0.8019166533271469,0.8108750201443482,0.803722180315861,0.8100470623152011,0.8027594853416418,0.5550908241605852,0.5352419484297911
|
18 |
+
16,-1,0.7922715293375887,0.8011840659033443,0.8093208654281385,0.8019829488031568,0.8084330581778969,0.801021175612965,0.5453469514783572,0.5267251026149404
|
19 |
+
17,-1,0.7926030085998763,0.8016325648959185,0.8097730356071076,0.8026289074556568,0.8088918475157226,0.8015106774753351,0.5446859697110119,0.5253315224106989
|
20 |
+
18,-1,0.7926176562203803,0.8018111185752793,0.8095735192458865,0.8023958752525909,0.8086711592192422,0.8012326647815596,0.5427731844840156,0.5235262931623265
|
21 |
+
19,-1,0.79253207984499,0.8017778536856336,0.8091158438750315,0.8019567116367086,0.8082313687629724,0.8008126746828168,0.5440289521546717,0.5246452395466552
|
modules.json
ADDED
@@ -0,0 +1,20 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
[
|
2 |
+
{
|
3 |
+
"idx": 0,
|
4 |
+
"name": "0",
|
5 |
+
"path": "0_Transformer",
|
6 |
+
"type": "sentence_transformers.models.Transformer"
|
7 |
+
},
|
8 |
+
{
|
9 |
+
"idx": 1,
|
10 |
+
"name": "1",
|
11 |
+
"path": "1_Pooling",
|
12 |
+
"type": "sentence_transformers.models.Pooling"
|
13 |
+
},
|
14 |
+
{
|
15 |
+
"idx": 2,
|
16 |
+
"name": "2",
|
17 |
+
"path": "2_Dense",
|
18 |
+
"type": "sentence_transformers.models.Dense"
|
19 |
+
}
|
20 |
+
]
|