Sieun Park commited on
Commit
9a35b85
·
1 Parent(s): dbe0eed

Upload . with huggingface_hub

Browse files
.gitattributes CHANGED
@@ -32,3 +32,4 @@ saved_model/**/* filter=lfs diff=lfs merge=lfs -text
32
  *.zip filter=lfs diff=lfs merge=lfs -text
33
  *.zst filter=lfs diff=lfs merge=lfs -text
34
  *tfevents* filter=lfs diff=lfs merge=lfs -text
 
 
32
  *.zip filter=lfs diff=lfs merge=lfs -text
33
  *.zst filter=lfs diff=lfs merge=lfs -text
34
  *tfevents* filter=lfs diff=lfs merge=lfs -text
35
+ tokenizer.json 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 ADDED
@@ -0,0 +1,126 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ pipeline_tag: sentence-similarity
3
+ tags:
4
+ - sentence-transformers
5
+ - feature-extraction
6
+ - sentence-similarity
7
+ - transformers
8
+
9
+ ---
10
+
11
+ # {MODEL_NAME}
12
+
13
+ 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.
14
+
15
+ <!--- Describe your model here -->
16
+
17
+ ## Usage (Sentence-Transformers)
18
+
19
+ Using this model becomes easy when you have [sentence-transformers](https://www.SBERT.net) installed:
20
+
21
+ ```
22
+ pip install -U sentence-transformers
23
+ ```
24
+
25
+ Then you can use the model like this:
26
+
27
+ ```python
28
+ from sentence_transformers import SentenceTransformer
29
+ sentences = ["This is an example sentence", "Each sentence is converted"]
30
+
31
+ model = SentenceTransformer('{MODEL_NAME}')
32
+ embeddings = model.encode(sentences)
33
+ print(embeddings)
34
+ ```
35
+
36
+
37
+
38
+ ## Usage (HuggingFace Transformers)
39
+ Without [sentence-transformers](https://www.SBERT.net), you can use the model like this: First, you pass your input through the transformer model, then you have to apply the right pooling-operation on-top of the contextualized word embeddings.
40
+
41
+ ```python
42
+ from transformers import AutoTokenizer, AutoModel
43
+ import torch
44
+
45
+
46
+ #Mean Pooling - Take attention mask into account for correct averaging
47
+ def mean_pooling(model_output, attention_mask):
48
+ token_embeddings = model_output[0] #First element of model_output contains all token embeddings
49
+ input_mask_expanded = attention_mask.unsqueeze(-1).expand(token_embeddings.size()).float()
50
+ return torch.sum(token_embeddings * input_mask_expanded, 1) / torch.clamp(input_mask_expanded.sum(1), min=1e-9)
51
+
52
+
53
+ # Sentences we want sentence embeddings for
54
+ sentences = ['This is an example sentence', 'Each sentence is converted']
55
+
56
+ # Load model from HuggingFace Hub
57
+ tokenizer = AutoTokenizer.from_pretrained('{MODEL_NAME}')
58
+ model = AutoModel.from_pretrained('{MODEL_NAME}')
59
+
60
+ # Tokenize sentences
61
+ encoded_input = tokenizer(sentences, padding=True, truncation=True, return_tensors='pt')
62
+
63
+ # Compute token embeddings
64
+ with torch.no_grad():
65
+ model_output = model(**encoded_input)
66
+
67
+ # Perform pooling. In this case, mean pooling.
68
+ sentence_embeddings = mean_pooling(model_output, encoded_input['attention_mask'])
69
+
70
+ print("Sentence embeddings:")
71
+ print(sentence_embeddings)
72
+ ```
73
+
74
+
75
+
76
+ ## Evaluation Results
77
+
78
+ <!--- Describe how your model was evaluated -->
79
+
80
+ For an automated evaluation of this model, see the *Sentence Embeddings Benchmark*: [https://seb.sbert.net](https://seb.sbert.net?model_name={MODEL_NAME})
81
+
82
+
83
+ ## Training
84
+ The model was trained with the parameters:
85
+
86
+ **DataLoader**:
87
+
88
+ `torch.utils.data.dataloader.DataLoader` of length 5629 with parameters:
89
+ ```
90
+ {'batch_size': 256, 'sampler': 'torch.utils.data.sampler.RandomSampler', 'batch_sampler': 'torch.utils.data.sampler.BatchSampler'}
91
+ ```
92
+
93
+ **Loss**:
94
+
95
+ `sentence_transformers.losses.MSELoss.MSELoss`
96
+
97
+ Parameters of the fit()-Method:
98
+ ```
99
+ {
100
+ "epochs": 10,
101
+ "evaluation_steps": 5000,
102
+ "evaluator": "sentence_transformers.evaluation.SequentialEvaluator.SequentialEvaluator",
103
+ "max_grad_norm": 1,
104
+ "optimizer_class": "<class 'torch.optim.adamw.AdamW'>",
105
+ "optimizer_params": {
106
+ "lr": 1e-05
107
+ },
108
+ "scheduler": "WarmupLinear",
109
+ "steps_per_epoch": null,
110
+ "warmup_steps": 0,
111
+ "weight_decay": 0.01
112
+ }
113
+ ```
114
+
115
+
116
+ ## Full Model Architecture
117
+ ```
118
+ SentenceTransformer(
119
+ (0): Transformer({'max_seq_length': 128, 'do_lower_case': False}) with Transformer model: XLMRobertaModel
120
+ (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})
121
+ )
122
+ ```
123
+
124
+ ## Citing & Authors
125
+
126
+ <!--- Describe where people can find more information -->
config.json ADDED
@@ -0,0 +1,29 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "_name_or_path": "/content/drive/MyDrive/v1_3/",
3
+ "architectures": [
4
+ "XLMRobertaModel"
5
+ ],
6
+ "attention_probs_dropout_prob": 0.1,
7
+ "bos_token_id": 0,
8
+ "classifier_dropout": null,
9
+ "eos_token_id": 2,
10
+ "gradient_checkpointing": false,
11
+ "hidden_act": "gelu",
12
+ "hidden_dropout_prob": 0.1,
13
+ "hidden_size": 768,
14
+ "initializer_range": 0.02,
15
+ "intermediate_size": 3072,
16
+ "layer_norm_eps": 1e-05,
17
+ "max_position_embeddings": 514,
18
+ "model_type": "xlm-roberta",
19
+ "num_attention_heads": 12,
20
+ "num_hidden_layers": 12,
21
+ "output_past": true,
22
+ "pad_token_id": 1,
23
+ "position_embedding_type": "absolute",
24
+ "torch_dtype": "float32",
25
+ "transformers_version": "4.26.1",
26
+ "type_vocab_size": 1,
27
+ "use_cache": true,
28
+ "vocab_size": 250002
29
+ }
config_sentence_transformers.json ADDED
@@ -0,0 +1,7 @@
 
 
 
 
 
 
 
 
1
+ {
2
+ "__version__": {
3
+ "sentence_transformers": "2.2.2",
4
+ "transformers": "4.26.1",
5
+ "pytorch": "1.13.1+cu116"
6
+ }
7
+ }
eval/mse_evaluation_TED2020-en-ja-dev.tsv.gz_results.csv ADDED
@@ -0,0 +1,21 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ epoch,steps,MSE
2
+ 0,5000,0.07691268692724407
3
+ 0,-1,0.07659784168936312
4
+ 1,5000,0.07561671664007008
5
+ 1,-1,0.07537561468780041
6
+ 2,5000,0.07464137743227184
7
+ 2,-1,0.07426953525282443
8
+ 3,5000,0.07380967726930976
9
+ 3,-1,0.07369623053818941
10
+ 4,5000,0.07318426505662501
11
+ 4,-1,0.0730453000869602
12
+ 5,5000,0.07272141519933939
13
+ 5,-1,0.0727076199837029
14
+ 6,5000,0.07254749652929604
15
+ 6,-1,0.07255459786392748
16
+ 7,5000,0.07214996148832142
17
+ 7,-1,0.07210787734948099
18
+ 8,5000,0.07201439584605396
19
+ 8,-1,0.07204361027106643
20
+ 9,5000,0.07192625780589879
21
+ 9,-1,0.07193719502538443
eval/mse_evaluation_TED2020-en-ko-dev.tsv.gz_results.csv ADDED
@@ -0,0 +1,21 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ epoch,steps,MSE
2
+ 0,5000,0.07377860601991415
3
+ 0,-1,0.07347434875555336
4
+ 1,5000,0.07236491073854268
5
+ 1,-1,0.07207684684544802
6
+ 2,5000,0.07120443042367697
7
+ 2,-1,0.07081329822540283
8
+ 3,5000,0.07022445788607001
9
+ 3,-1,0.07012199494056404
10
+ 4,5000,0.06962649640627205
11
+ 4,-1,0.06940726307220757
12
+ 5,5000,0.06906852941028774
13
+ 5,-1,0.0691152410581708
14
+ 6,5000,0.06885575712658465
15
+ 6,-1,0.06884735194034874
16
+ 7,5000,0.06839782581664622
17
+ 7,-1,0.06838650442659855
18
+ 8,5000,0.06827132892794907
19
+ 8,-1,0.06832123035565019
20
+ 9,5000,0.06816776585765183
21
+ 9,-1,0.06817689863964915
eval/similarity_evaluation_STS.en-en.txt_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,5000,0.8058496824544271,0.8297968348032624,0.8174334725164674,0.8201065821472401,0.815605531816456,0.8178497899958851,0.7620924493486533,0.7789626973030435
3
+ 0,-1,0.8061044416438005,0.8303615133367901,0.8173695980001617,0.8202257450780729,0.815428989612524,0.8171928562900997,0.7631613950433525,0.7808231766102411
4
+ 1,5000,0.8124699355985517,0.8343227197956067,0.8236325421272224,0.8242995797263544,0.8215744837211111,0.821983206109583,0.7730917857434711,0.7913406506441746
5
+ 1,-1,0.8118196986182875,0.832748615918959,0.8229541520590496,0.8222361390401897,0.8207273866828355,0.8195346000792421,0.7706977435211454,0.7865745178074093
6
+ 2,5000,0.8160323057157925,0.8381736044442651,0.8260837321712862,0.8268085360152136,0.824039710401451,0.8225524974017234,0.7798620802971341,0.7997389464920376
7
+ 2,-1,0.8173524236602239,0.8387794134087577,0.8290101557755543,0.83091273799103,0.8270505459691999,0.826835443773789,0.7813529276351607,0.7997085791645027
8
+ 3,5000,0.8176675837249465,0.8394140521145808,0.8303532709696446,0.831759947989597,0.8287062879087163,0.828978454546026,0.7788263288267748,0.7982713204600373
9
+ 3,-1,0.8194653710801287,0.8389204869430018,0.8309676243351617,0.830860844456635,0.8293633589927677,0.828426461098684,0.7858544729921929,0.8042878952774464
10
+ 4,5000,0.8218346968201119,0.8404626859059103,0.8319360774269859,0.8318241422136261,0.8307420339996787,0.8297199554930476,0.788175637434133,0.8080791984606882
11
+ 4,-1,0.8218538206611165,0.84190148219658,0.8318905329210022,0.8312794523007546,0.8305112661429764,0.8297276434240691,0.7901646681887011,0.810287172250057
12
+ 5,5000,0.823378429886499,0.8429512691775629,0.8337320427914859,0.8346452285019578,0.8324433114262023,0.832468006436675,0.7901926522931996,0.8092354632863186
13
+ 5,-1,0.8233312120784968,0.8427679120227006,0.8342533607497408,0.8342493000543516,0.8328566188308405,0.8320482454029025,0.7897656184284972,0.8097816907853946
14
+ 6,5000,0.8242118589427546,0.8440429553826128,0.8332388673570393,0.8340186621237072,0.8321195142661825,0.8313486436799478,0.7961944386166991,0.814578575346246
15
+ 6,-1,0.8250336035074726,0.8432199623667636,0.8342397037969053,0.8345991009158288,0.8331722586642143,0.8326548231604969,0.7945989487682296,0.8109575598351298
16
+ 7,5000,0.8274247908545429,0.8472495914116714,0.8371442302482218,0.8385099514264549,0.8359426360568065,0.8358691471205771,0.7993260596115057,0.8173519964622443
17
+ 7,-1,0.8257564600874887,0.8447344847779948,0.836336285857069,0.8375405033246465,0.8352112022250694,0.8359817753100418,0.7959236427135716,0.8142602950019568
18
+ 8,5000,0.8274728971938476,0.8460445082240547,0.8370489556956594,0.8374962977212731,0.835926020820942,0.8361232332408369,0.7989449274404368,0.8176056981859531
19
+ 8,-1,0.8271991970778428,0.8472580481357951,0.8369609124431712,0.8382108909097192,0.8358389014911632,0.8357803515172789,0.7973294738349457,0.816267998188216
20
+ 9,5000,0.827126400027193,0.8461898101203607,0.837066923558911,0.8379183651343521,0.8359670108444548,0.8361551381545761,0.7973825938798208,0.8158167166372551
21
+ 9,-1,0.8269876448748019,0.8458861368450122,0.8369880252085725,0.837783057548374,0.8358798774570008,0.8358664563447196,0.7972899158614187,0.8156702615512961
eval/translation_evaluation_TED2020-en-ja-dev.tsv.gz_results.csv ADDED
@@ -0,0 +1,21 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ epoch,steps,src2trg,trg2src
2
+ 0,5000,0.906,0.883
3
+ 0,-1,0.902,0.889
4
+ 1,5000,0.904,0.886
5
+ 1,-1,0.908,0.887
6
+ 2,5000,0.909,0.891
7
+ 2,-1,0.908,0.888
8
+ 3,5000,0.904,0.889
9
+ 3,-1,0.908,0.888
10
+ 4,5000,0.911,0.886
11
+ 4,-1,0.91,0.887
12
+ 5,5000,0.911,0.885
13
+ 5,-1,0.909,0.889
14
+ 6,5000,0.91,0.885
15
+ 6,-1,0.911,0.885
16
+ 7,5000,0.91,0.885
17
+ 7,-1,0.912,0.885
18
+ 8,5000,0.911,0.883
19
+ 8,-1,0.912,0.885
20
+ 9,5000,0.912,0.882
21
+ 9,-1,0.912,0.883
eval/translation_evaluation_TED2020-en-ko-dev.tsv.gz_results.csv ADDED
@@ -0,0 +1,21 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ epoch,steps,src2trg,trg2src
2
+ 0,5000,0.955,0.932
3
+ 0,-1,0.953,0.934
4
+ 1,5000,0.953,0.932
5
+ 1,-1,0.954,0.934
6
+ 2,5000,0.954,0.933
7
+ 2,-1,0.952,0.933
8
+ 3,5000,0.953,0.935
9
+ 3,-1,0.953,0.936
10
+ 4,5000,0.954,0.936
11
+ 4,-1,0.952,0.936
12
+ 5,5000,0.952,0.934
13
+ 5,-1,0.952,0.932
14
+ 6,5000,0.954,0.936
15
+ 6,-1,0.954,0.938
16
+ 7,5000,0.953,0.936
17
+ 7,-1,0.954,0.935
18
+ 8,5000,0.952,0.934
19
+ 8,-1,0.954,0.937
20
+ 9,5000,0.953,0.936
21
+ 9,-1,0.953,0.936
modules.json ADDED
@@ -0,0 +1,14 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
+ ]
pytorch_model.bin ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:c8bea356a28ccaa7ec5afbd4a875e1be37d8f6c3e6868dd1b621e04693fad451
3
+ size 1112245805
sentence_bert_config.json ADDED
@@ -0,0 +1,4 @@
 
 
 
 
 
1
+ {
2
+ "max_seq_length": 128,
3
+ "do_lower_case": false
4
+ }
sentencepiece.bpe.model ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:cfc8146abe2a0488e9e2a0c56de7952f7c11ab059eca145a0a727afce0db2865
3
+ size 5069051
special_tokens_map.json ADDED
@@ -0,0 +1,15 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "bos_token": "<s>",
3
+ "cls_token": "<s>",
4
+ "eos_token": "</s>",
5
+ "mask_token": {
6
+ "content": "<mask>",
7
+ "lstrip": true,
8
+ "normalized": false,
9
+ "rstrip": false,
10
+ "single_word": false
11
+ },
12
+ "pad_token": "<pad>",
13
+ "sep_token": "</s>",
14
+ "unk_token": "<unk>"
15
+ }
tokenizer.json ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:b60b6b43406a48bf3638526314f3d232d97058bc93472ff2de930d43686fa441
3
+ size 17082913
tokenizer_config.json ADDED
@@ -0,0 +1,20 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "bos_token": "<s>",
3
+ "cls_token": "<s>",
4
+ "eos_token": "</s>",
5
+ "mask_token": {
6
+ "__type": "AddedToken",
7
+ "content": "<mask>",
8
+ "lstrip": true,
9
+ "normalized": true,
10
+ "rstrip": false,
11
+ "single_word": false
12
+ },
13
+ "model_max_length": 512,
14
+ "name_or_path": "/content/drive/MyDrive/v1_3/",
15
+ "pad_token": "<pad>",
16
+ "sep_token": "</s>",
17
+ "special_tokens_map_file": null,
18
+ "tokenizer_class": "XLMRobertaTokenizer",
19
+ "unk_token": "<unk>"
20
+ }