Upload folder using huggingface_hub
Browse files- .gitattributes +2 -0
- 1_Pooling/config.json +7 -0
- README.md +88 -3
- config.json +26 -0
- config_sentence_transformers.json +7 -0
- eval/similarity_evaluation_results.csv +31 -0
- modules.json +20 -0
- pytorch_model.bin +3 -0
- sentence_bert_config.json +4 -0
- special_tokens_map.json +7 -0
- test.csv +3 -0
- tokenizer.json +0 -0
- tokenizer_config.json +15 -0
- train.csv +3 -0
- vocab.txt +0 -0
.gitattributes
CHANGED
@@ -33,3 +33,5 @@ saved_model/**/* filter=lfs diff=lfs merge=lfs -text
|
|
33 |
*.zip filter=lfs diff=lfs merge=lfs -text
|
34 |
*.zst filter=lfs diff=lfs merge=lfs -text
|
35 |
*tfevents* filter=lfs diff=lfs merge=lfs -text
|
|
|
|
|
|
33 |
*.zip filter=lfs diff=lfs merge=lfs -text
|
34 |
*.zst filter=lfs diff=lfs merge=lfs -text
|
35 |
*tfevents* filter=lfs diff=lfs merge=lfs -text
|
36 |
+
test.csv filter=lfs diff=lfs merge=lfs -text
|
37 |
+
train.csv filter=lfs diff=lfs merge=lfs -text
|
1_Pooling/config.json
ADDED
@@ -0,0 +1,7 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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 |
+
}
|
README.md
CHANGED
@@ -1,3 +1,88 @@
|
|
1 |
-
---
|
2 |
-
|
3 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
---
|
2 |
+
pipeline_tag: sentence-similarity
|
3 |
+
tags:
|
4 |
+
- sentence-transformers
|
5 |
+
- feature-extraction
|
6 |
+
- sentence-similarity
|
7 |
+
|
8 |
+
---
|
9 |
+
|
10 |
+
# {MODEL_NAME}
|
11 |
+
|
12 |
+
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.
|
13 |
+
|
14 |
+
<!--- Describe your model here -->
|
15 |
+
|
16 |
+
## Usage (Sentence-Transformers)
|
17 |
+
|
18 |
+
Using this model becomes easy when you have [sentence-transformers](https://www.SBERT.net) installed:
|
19 |
+
|
20 |
+
```
|
21 |
+
pip install -U sentence-transformers
|
22 |
+
```
|
23 |
+
|
24 |
+
Then you can use the model like this:
|
25 |
+
|
26 |
+
```python
|
27 |
+
from sentence_transformers import SentenceTransformer
|
28 |
+
sentences = ["This is an example sentence", "Each sentence is converted"]
|
29 |
+
|
30 |
+
model = SentenceTransformer('{MODEL_NAME}')
|
31 |
+
embeddings = model.encode(sentences)
|
32 |
+
print(embeddings)
|
33 |
+
```
|
34 |
+
|
35 |
+
|
36 |
+
|
37 |
+
## Evaluation Results
|
38 |
+
|
39 |
+
<!--- Describe how your model was evaluated -->
|
40 |
+
|
41 |
+
For an automated evaluation of this model, see the *Sentence Embeddings Benchmark*: [https://seb.sbert.net](https://seb.sbert.net?model_name={MODEL_NAME})
|
42 |
+
|
43 |
+
|
44 |
+
## Training
|
45 |
+
The model was trained with the parameters:
|
46 |
+
|
47 |
+
**DataLoader**:
|
48 |
+
|
49 |
+
`torch.utils.data.dataloader.DataLoader` of length 296 with parameters:
|
50 |
+
```
|
51 |
+
{'batch_size': 32, 'sampler': 'torch.utils.data.sampler.RandomSampler', 'batch_sampler': 'torch.utils.data.sampler.BatchSampler'}
|
52 |
+
```
|
53 |
+
|
54 |
+
**Loss**:
|
55 |
+
|
56 |
+
`sentence_transformers.losses.CosineSimilarityLoss.CosineSimilarityLoss`
|
57 |
+
|
58 |
+
Parameters of the fit()-Method:
|
59 |
+
```
|
60 |
+
{
|
61 |
+
"epochs": 10,
|
62 |
+
"evaluation_steps": 100,
|
63 |
+
"evaluator": "sentence_transformers.evaluation.EmbeddingSimilarityEvaluator.EmbeddingSimilarityEvaluator",
|
64 |
+
"max_grad_norm": 1,
|
65 |
+
"optimizer_class": "<class 'torch.optim.adamw.AdamW'>",
|
66 |
+
"optimizer_params": {
|
67 |
+
"lr": 2e-05
|
68 |
+
},
|
69 |
+
"scheduler": "WarmupLinear",
|
70 |
+
"steps_per_epoch": null,
|
71 |
+
"warmup_steps": 296,
|
72 |
+
"weight_decay": 0.01
|
73 |
+
}
|
74 |
+
```
|
75 |
+
|
76 |
+
|
77 |
+
## Full Model Architecture
|
78 |
+
```
|
79 |
+
SentenceTransformer(
|
80 |
+
(0): Transformer({'max_seq_length': 514, 'do_lower_case': False}) with Transformer model: BertModel
|
81 |
+
(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})
|
82 |
+
(2): Normalize()
|
83 |
+
)
|
84 |
+
```
|
85 |
+
|
86 |
+
## Citing & Authors
|
87 |
+
|
88 |
+
<!--- Describe where people can find more information -->
|
config.json
ADDED
@@ -0,0 +1,26 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
{
|
2 |
+
"_name_or_path": "../../models/SentSecBert_10k/",
|
3 |
+
"architectures": [
|
4 |
+
"BertModel"
|
5 |
+
],
|
6 |
+
"attention_probs_dropout_prob": 0.1,
|
7 |
+
"classifier_dropout": null,
|
8 |
+
"gradient_checkpointing": false,
|
9 |
+
"hidden_act": "gelu",
|
10 |
+
"hidden_dropout_prob": 0.1,
|
11 |
+
"hidden_size": 768,
|
12 |
+
"initializer_range": 0.02,
|
13 |
+
"intermediate_size": 3072,
|
14 |
+
"layer_norm_eps": 1e-12,
|
15 |
+
"max_position_embeddings": 514,
|
16 |
+
"model_type": "bert",
|
17 |
+
"num_attention_heads": 12,
|
18 |
+
"num_hidden_layers": 6,
|
19 |
+
"pad_token_id": 0,
|
20 |
+
"position_embedding_type": "absolute",
|
21 |
+
"torch_dtype": "float32",
|
22 |
+
"transformers_version": "4.28.1",
|
23 |
+
"type_vocab_size": 1,
|
24 |
+
"use_cache": true,
|
25 |
+
"vocab_size": 52000
|
26 |
+
}
|
config_sentence_transformers.json
ADDED
@@ -0,0 +1,7 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
{
|
2 |
+
"__version__": {
|
3 |
+
"sentence_transformers": "2.2.2",
|
4 |
+
"transformers": "4.28.1",
|
5 |
+
"pytorch": "2.0.1"
|
6 |
+
}
|
7 |
+
}
|
eval/similarity_evaluation_results.csv
ADDED
@@ -0,0 +1,31 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
epoch,steps,cosine_pearson,cosine_spearman,euclidean_pearson,euclidean_spearman,manhattan_pearson,manhattan_spearman,dot_pearson,dot_spearman
|
2 |
+
0,100,0.7767165296976706,0.7825528385894479,0.7722803478792969,0.7825528385894479,0.7717405275291487,0.7821055391719218,0.7767165256168398,0.7825528385518995
|
3 |
+
0,200,0.7921398127977428,0.7938857413991663,0.7935166762405468,0.7938857414372585,0.7934722509182599,0.793777105237588,0.7921398152683232,0.7938859613103474
|
4 |
+
0,-1,0.817672720878249,0.80569101338735,0.8160408596971968,0.80569101338735,0.8155512402445846,0.8056721010644293,0.8176727236015884,0.8056910133486914
|
5 |
+
1,100,0.8269388173519301,0.8136174919615351,0.8289767040437148,0.8136174920005742,0.8284016396078292,0.8134415631337184,0.8269388156358446,0.8136174920005742
|
6 |
+
1,200,0.8377112278237773,0.818250580804218,0.8378772576670477,0.8182505808434793,0.8374931789796534,0.8181604171806868,0.8377112275722225,0.8182505807649567
|
7 |
+
1,-1,0.8485055754141746,0.8217568445977179,0.843786555759838,0.8217568446371475,0.8435382862056614,0.8218294153269257,0.8485055765498164,0.821756844676577
|
8 |
+
2,100,0.8472687737940862,0.8188843647890193,0.8376910156119721,0.8188843647890193,0.8373942723912529,0.8187928816983753,0.8472687787620491,0.8188843647890193
|
9 |
+
2,200,0.8524454263912835,0.8206568489484323,0.8446270730670355,0.8206568489484323,0.8444596551928384,0.8205754818114043,0.8524454247600131,0.8206568489484323
|
10 |
+
2,-1,0.850857561334697,0.821881314365676,0.8473673163624467,0.821881314365676,0.8469431465737933,0.8216636022963416,0.8508575610214818,0.8218813143262406
|
11 |
+
3,100,0.8514365916254149,0.8193373818221799,0.8426546565015118,0.8193373817828664,0.8421336441953314,0.8189019576835108,0.8514365901452959,0.8193373818221799
|
12 |
+
3,200,0.8555724237155002,0.8219318939373397,0.8461787158808152,0.8219318938979017,0.845831874861548,0.8217198995981426,0.8555724240717741,0.8219318940162155
|
13 |
+
3,-1,0.8591605522948231,0.8225450063498418,0.8440867186397281,0.8225450063498418,0.8436843245471843,0.8222375704791325,0.8591605515675516,0.8225450062709072
|
14 |
+
4,100,0.8569069635045521,0.8209563678983851,0.8447241832873182,0.8209563680165585,0.8442307824782811,0.8204989526809926,0.8569069632147116,0.8209563679377762
|
15 |
+
4,200,0.8539244648046733,0.8179051003386211,0.8418073744832226,0.8179053202498022,0.8415078520475464,0.8177109188048953,0.8539244665916373,0.8179048803489505
|
16 |
+
4,-1,0.8535630545471954,0.8181617366870307,0.8406542588134209,0.8181617366870307,0.8402956857354933,0.8177672160280359,0.8535630538972292,0.8181617366477737
|
17 |
+
5,100,0.8531654928661945,0.8171730160165512,0.838365383973362,0.8171730160165512,0.8378914933685018,0.8164354338757781,0.8531654889049933,0.8171730160557609
|
18 |
+
5,200,0.8516811164690643,0.8157532693918633,0.8361600962301626,0.8157530494806823,0.8357657162535961,0.8151581898530214,0.8516811162184573,0.8157532693918633
|
19 |
+
5,-1,0.850645402630859,0.8166056451691674,0.8409800925597333,0.8166056451299851,0.8407424275971783,0.8164662214411386,0.8506454013649966,0.8166056450908027
|
20 |
+
6,100,0.8479752173613797,0.8131064184546054,0.8341299563935005,0.8131064183765765,0.8338750932416426,0.8128126170385797,0.8479752212393277,0.813106418415591
|
21 |
+
6,200,0.849920837286756,0.8143106520435462,0.835990622204247,0.8143106520435462,0.8356380452332411,0.81383740318172,0.8499208385019955,0.8143106520435462
|
22 |
+
6,-1,0.8508729394328989,0.8151533516505847,0.8362178227317338,0.8151533516505847,0.8358512290585075,0.8146070923157308,0.8508729377113814,0.8151533516505847
|
23 |
+
7,100,0.8490710228232873,0.813288944695942,0.8347706750903306,0.813288944695942,0.8345251988420637,0.8130197734102195,0.8490710215185728,0.8132889446569189
|
24 |
+
7,200,0.8481477396217937,0.8132075775979375,0.8353909391871244,0.8132075776369568,0.835121440953439,0.8128517613068262,0.8481477375817182,0.8132075775589181
|
25 |
+
7,-1,0.8460978103907613,0.8113581245254808,0.8324593098591324,0.8113581245644114,0.8322705017907741,0.8112103442117508,0.8460978109627689,0.8113581244865503
|
26 |
+
8,100,0.8453171173065693,0.8108914729601809,0.8317433167318551,0.8108914730379974,0.8315887130825804,0.8105761203653259,0.8453171179415402,0.8108914730379974
|
27 |
+
8,200,0.8469921731033707,0.81207195629741,0.8340925992596693,0.8120719562194805,0.8338235612540428,0.8117504460336957,0.8469921712547479,0.8120719562584452
|
28 |
+
8,-1,0.8460002218987764,0.8112138627906491,0.8315596485028064,0.8112138627517254,0.8312735381658762,0.8107357758439371,0.8460002221463571,0.8112140827018303
|
29 |
+
9,100,0.8456311253832645,0.8108760792164089,0.8312416341039841,0.8108760792942239,0.8309784004582101,0.8104582480888939,0.8456311255171476,0.8108760792164089
|
30 |
+
9,200,0.8454572597962404,0.8108114253680563,0.8318181416948303,0.810811425329152,0.8315887709240848,0.8104274604457572,0.8454572605660785,0.810811425329152
|
31 |
+
9,-1,0.8454518591198237,0.8107089467965368,0.8316193923446009,0.8107089467576374,0.8313967752970463,0.8103724826115848,0.8454518563012295,0.8107089467187379
|
modules.json
ADDED
@@ -0,0 +1,20 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
[
|
2 |
+
{
|
3 |
+
"idx": 0,
|
4 |
+
"name": "0",
|
5 |
+
"path": "",
|
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_Normalize",
|
18 |
+
"type": "sentence_transformers.models.Normalize"
|
19 |
+
}
|
20 |
+
]
|
pytorch_model.bin
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:295fce88c7848ceb7b918c5e03fae0aefe2585c0f2197e98c0c6eac522f8879b
|
3 |
+
size 333842221
|
sentence_bert_config.json
ADDED
@@ -0,0 +1,4 @@
|
|
|
|
|
|
|
|
|
|
|
1 |
+
{
|
2 |
+
"max_seq_length": 514,
|
3 |
+
"do_lower_case": false
|
4 |
+
}
|
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 |
+
}
|
test.csv
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:fcddac2e3086d6ad4880595b150e3b42f2ce4cafe7248434be06f90683ed6ed1
|
3 |
+
size 29517597
|
tokenizer.json
ADDED
The diff for this file is too large to render.
See raw diff
|
|
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 |
+
}
|
train.csv
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:1e34c47c63ebb63e7c36a489488747244db894fd1cf8d1cafbd3ef73af88f0be
|
3 |
+
size 70753576
|
vocab.txt
ADDED
The diff for this file is too large to render.
See raw diff
|
|