Upload multitask artifacts
Browse files- .gitattributes +1 -0
- encoder/README.md +95 -112
- encoder/adapter_config.json +1 -1
- encoder/adapter_model.safetensors +2 -2
- encoder/lora_weights/README.md +2 -2
- encoder/lora_weights/adapter_config.json +1 -1
- encoder/lora_weights/adapter_model.safetensors +2 -2
- encoder/modules.json +0 -6
- encoder/sentence_bert_config.json +1 -1
- encoder/tokenizer.json +0 -0
- encoder/tokenizer_config.json +16 -9
- heads.pt +2 -2
- id2label.json +1 -2
- label2id.json +1 -2
- train_config.json +9 -7
.gitattributes
CHANGED
|
@@ -33,3 +33,4 @@ 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 |
+
encoder/tokenizer.json filter=lfs diff=lfs merge=lfs -text
|
encoder/README.md
CHANGED
|
@@ -1,5 +1,55 @@
|
|
| 1 |
---
|
| 2 |
-
language:
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 3 |
license: apache-2.0
|
| 4 |
library_name: sentence-transformers
|
| 5 |
tags:
|
|
@@ -7,36 +57,22 @@ tags:
|
|
| 7 |
- feature-extraction
|
| 8 |
- sentence-similarity
|
| 9 |
- transformers
|
| 10 |
-
|
| 11 |
-
-
|
| 12 |
-
-
|
| 13 |
-
-
|
| 14 |
-
-
|
| 15 |
-
- yahoo_answers_topics
|
| 16 |
-
- code_search_net
|
| 17 |
-
- search_qa
|
| 18 |
-
- eli5
|
| 19 |
-
- snli
|
| 20 |
-
- multi_nli
|
| 21 |
-
- wikihow
|
| 22 |
-
- natural_questions
|
| 23 |
-
- trivia_qa
|
| 24 |
-
- embedding-data/sentence-compression
|
| 25 |
-
- embedding-data/flickr30k-captions
|
| 26 |
-
- embedding-data/altlex
|
| 27 |
-
- embedding-data/simple-wiki
|
| 28 |
-
- embedding-data/QQP
|
| 29 |
-
- embedding-data/SPECTER
|
| 30 |
-
- embedding-data/PAQ_pairs
|
| 31 |
-
- embedding-data/WikiAnswers
|
| 32 |
pipeline_tag: sentence-similarity
|
| 33 |
---
|
| 34 |
|
|
|
|
| 35 |
|
| 36 |
-
# all-MiniLM-L6-v2
|
| 37 |
This is a [sentence-transformers](https://www.SBERT.net) model: It maps sentences & paragraphs to a 384 dimensional dense vector space and can be used for tasks like clustering or semantic search.
|
| 38 |
|
|
|
|
|
|
|
| 39 |
## Usage (Sentence-Transformers)
|
|
|
|
| 40 |
Using this model becomes easy when you have [sentence-transformers](https://www.SBERT.net) installed:
|
| 41 |
|
| 42 |
```
|
|
@@ -44,24 +80,27 @@ pip install -U sentence-transformers
|
|
| 44 |
```
|
| 45 |
|
| 46 |
Then you can use the model like this:
|
|
|
|
| 47 |
```python
|
| 48 |
from sentence_transformers import SentenceTransformer
|
| 49 |
sentences = ["This is an example sentence", "Each sentence is converted"]
|
| 50 |
|
| 51 |
-
model = SentenceTransformer('sentence-transformers/
|
| 52 |
embeddings = model.encode(sentences)
|
| 53 |
print(embeddings)
|
| 54 |
```
|
| 55 |
|
|
|
|
|
|
|
| 56 |
## Usage (HuggingFace Transformers)
|
| 57 |
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.
|
| 58 |
|
| 59 |
```python
|
| 60 |
from transformers import AutoTokenizer, AutoModel
|
| 61 |
import torch
|
| 62 |
-
import torch.nn.functional as F
|
| 63 |
|
| 64 |
-
|
|
|
|
| 65 |
def mean_pooling(model_output, attention_mask):
|
| 66 |
token_embeddings = model_output[0] #First element of model_output contains all token embeddings
|
| 67 |
input_mask_expanded = attention_mask.unsqueeze(-1).expand(token_embeddings.size()).float()
|
|
@@ -72,8 +111,8 @@ def mean_pooling(model_output, attention_mask):
|
|
| 72 |
sentences = ['This is an example sentence', 'Each sentence is converted']
|
| 73 |
|
| 74 |
# Load model from HuggingFace Hub
|
| 75 |
-
tokenizer = AutoTokenizer.from_pretrained('sentence-transformers/
|
| 76 |
-
model = AutoModel.from_pretrained('sentence-transformers/
|
| 77 |
|
| 78 |
# Tokenize sentences
|
| 79 |
encoded_input = tokenizer(sentences, padding=True, truncation=True, return_tensors='pt')
|
|
@@ -82,92 +121,36 @@ encoded_input = tokenizer(sentences, padding=True, truncation=True, return_tenso
|
|
| 82 |
with torch.no_grad():
|
| 83 |
model_output = model(**encoded_input)
|
| 84 |
|
| 85 |
-
# Perform pooling
|
| 86 |
sentence_embeddings = mean_pooling(model_output, encoded_input['attention_mask'])
|
| 87 |
|
| 88 |
-
# Normalize embeddings
|
| 89 |
-
sentence_embeddings = F.normalize(sentence_embeddings, p=2, dim=1)
|
| 90 |
-
|
| 91 |
print("Sentence embeddings:")
|
| 92 |
print(sentence_embeddings)
|
| 93 |
```
|
| 94 |
|
| 95 |
-
|
| 96 |
-
|
| 97 |
-
##
|
| 98 |
-
|
| 99 |
-
|
| 100 |
-
|
| 101 |
-
|
| 102 |
-
|
| 103 |
-
|
| 104 |
-
|
| 105 |
-
|
| 106 |
-
|
| 107 |
-
|
| 108 |
-
|
| 109 |
-
|
| 110 |
-
|
| 111 |
-
|
| 112 |
-
|
| 113 |
-
|
| 114 |
-
|
| 115 |
-
|
| 116 |
-
|
| 117 |
-
|
| 118 |
-
|
| 119 |
-
|
| 120 |
-
|
| 121 |
-
|
| 122 |
-
### Fine-tuning
|
| 123 |
-
|
| 124 |
-
We fine-tune the model using a contrastive objective. Formally, we compute the cosine similarity from each possible sentence pairs from the batch.
|
| 125 |
-
We then apply the cross entropy loss by comparing with true pairs.
|
| 126 |
-
|
| 127 |
-
#### Hyper parameters
|
| 128 |
-
|
| 129 |
-
We trained our model on a TPU v3-8. We train the model during 100k steps using a batch size of 1024 (128 per TPU core).
|
| 130 |
-
We use a learning rate warm up of 500. The sequence length was limited to 128 tokens. We used the AdamW optimizer with
|
| 131 |
-
a 2e-5 learning rate. The full training script is accessible in this current repository: `train_script.py`.
|
| 132 |
-
|
| 133 |
-
#### Training data
|
| 134 |
-
|
| 135 |
-
We use the concatenation from multiple datasets to fine-tune our model. The total number of sentence pairs is above 1 billion sentences.
|
| 136 |
-
We sampled each dataset given a weighted probability which configuration is detailed in the `data_config.json` file.
|
| 137 |
-
|
| 138 |
-
|
| 139 |
-
| Dataset | Paper | Number of training tuples |
|
| 140 |
-
|--------------------------------------------------------|:----------------------------------------:|:--------------------------:|
|
| 141 |
-
| [Reddit comments (2015-2018)](https://github.com/PolyAI-LDN/conversational-datasets/tree/master/reddit) | [paper](https://arxiv.org/abs/1904.06472) | 726,484,430 |
|
| 142 |
-
| [S2ORC](https://github.com/allenai/s2orc) Citation pairs (Abstracts) | [paper](https://aclanthology.org/2020.acl-main.447/) | 116,288,806 |
|
| 143 |
-
| [WikiAnswers](https://github.com/afader/oqa#wikianswers-corpus) Duplicate question pairs | [paper](https://doi.org/10.1145/2623330.2623677) | 77,427,422 |
|
| 144 |
-
| [PAQ](https://github.com/facebookresearch/PAQ) (Question, Answer) pairs | [paper](https://arxiv.org/abs/2102.07033) | 64,371,441 |
|
| 145 |
-
| [S2ORC](https://github.com/allenai/s2orc) Citation pairs (Titles) | [paper](https://aclanthology.org/2020.acl-main.447/) | 52,603,982 |
|
| 146 |
-
| [S2ORC](https://github.com/allenai/s2orc) (Title, Abstract) | [paper](https://aclanthology.org/2020.acl-main.447/) | 41,769,185 |
|
| 147 |
-
| [Stack Exchange](https://huggingface.co/datasets/flax-sentence-embeddings/stackexchange_xml) (Title, Body) pairs | - | 25,316,456 |
|
| 148 |
-
| [Stack Exchange](https://huggingface.co/datasets/flax-sentence-embeddings/stackexchange_xml) (Title+Body, Answer) pairs | - | 21,396,559 |
|
| 149 |
-
| [Stack Exchange](https://huggingface.co/datasets/flax-sentence-embeddings/stackexchange_xml) (Title, Answer) pairs | - | 21,396,559 |
|
| 150 |
-
| [MS MARCO](https://microsoft.github.io/msmarco/) triplets | [paper](https://doi.org/10.1145/3404835.3462804) | 9,144,553 |
|
| 151 |
-
| [GOOAQ: Open Question Answering with Diverse Answer Types](https://github.com/allenai/gooaq) | [paper](https://arxiv.org/pdf/2104.08727.pdf) | 3,012,496 |
|
| 152 |
-
| [Yahoo Answers](https://www.kaggle.com/soumikrakshit/yahoo-answers-dataset) (Title, Answer) | [paper](https://proceedings.neurips.cc/paper/2015/hash/250cf8b51c773f3f8dc8b4be867a9a02-Abstract.html) | 1,198,260 |
|
| 153 |
-
| [Code Search](https://huggingface.co/datasets/code_search_net) | - | 1,151,414 |
|
| 154 |
-
| [COCO](https://cocodataset.org/#home) Image captions | [paper](https://link.springer.com/chapter/10.1007%2F978-3-319-10602-1_48) | 828,395|
|
| 155 |
-
| [SPECTER](https://github.com/allenai/specter) citation triplets | [paper](https://doi.org/10.18653/v1/2020.acl-main.207) | 684,100 |
|
| 156 |
-
| [Yahoo Answers](https://www.kaggle.com/soumikrakshit/yahoo-answers-dataset) (Question, Answer) | [paper](https://proceedings.neurips.cc/paper/2015/hash/250cf8b51c773f3f8dc8b4be867a9a02-Abstract.html) | 681,164 |
|
| 157 |
-
| [Yahoo Answers](https://www.kaggle.com/soumikrakshit/yahoo-answers-dataset) (Title, Question) | [paper](https://proceedings.neurips.cc/paper/2015/hash/250cf8b51c773f3f8dc8b4be867a9a02-Abstract.html) | 659,896 |
|
| 158 |
-
| [SearchQA](https://huggingface.co/datasets/search_qa) | [paper](https://arxiv.org/abs/1704.05179) | 582,261 |
|
| 159 |
-
| [Eli5](https://huggingface.co/datasets/eli5) | [paper](https://doi.org/10.18653/v1/p19-1346) | 325,475 |
|
| 160 |
-
| [Flickr 30k](https://shannon.cs.illinois.edu/DenotationGraph/) | [paper](https://transacl.org/ojs/index.php/tacl/article/view/229/33) | 317,695 |
|
| 161 |
-
| [Stack Exchange](https://huggingface.co/datasets/flax-sentence-embeddings/stackexchange_xml) Duplicate questions (titles) | | 304,525 |
|
| 162 |
-
| AllNLI ([SNLI](https://nlp.stanford.edu/projects/snli/) and [MultiNLI](https://cims.nyu.edu/~sbowman/multinli/) | [paper SNLI](https://doi.org/10.18653/v1/d15-1075), [paper MultiNLI](https://doi.org/10.18653/v1/n18-1101) | 277,230 |
|
| 163 |
-
| [Stack Exchange](https://huggingface.co/datasets/flax-sentence-embeddings/stackexchange_xml) Duplicate questions (bodies) | | 250,519 |
|
| 164 |
-
| [Stack Exchange](https://huggingface.co/datasets/flax-sentence-embeddings/stackexchange_xml) Duplicate questions (titles+bodies) | | 250,460 |
|
| 165 |
-
| [Sentence Compression](https://github.com/google-research-datasets/sentence-compression) | [paper](https://www.aclweb.org/anthology/D13-1155/) | 180,000 |
|
| 166 |
-
| [Wikihow](https://github.com/pvl/wikihow_pairs_dataset) | [paper](https://arxiv.org/abs/1810.09305) | 128,542 |
|
| 167 |
-
| [Altlex](https://github.com/chridey/altlex/) | [paper](https://aclanthology.org/P16-1135.pdf) | 112,696 |
|
| 168 |
-
| [Quora Question Triplets](https://quoradata.quora.com/First-Quora-Dataset-Release-Question-Pairs) | - | 103,663 |
|
| 169 |
-
| [Simple Wikipedia](https://cs.pomona.edu/~dkauchak/simplification/) | [paper](https://www.aclweb.org/anthology/P11-2117/) | 102,225 |
|
| 170 |
-
| [Natural Questions (NQ)](https://ai.google.com/research/NaturalQuestions) | [paper](https://transacl.org/ojs/index.php/tacl/article/view/1455) | 100,231 |
|
| 171 |
-
| [SQuAD2.0](https://rajpurkar.github.io/SQuAD-explorer/) | [paper](https://aclanthology.org/P18-2124.pdf) | 87,599 |
|
| 172 |
-
| [TriviaQA](https://huggingface.co/datasets/trivia_qa) | - | 73,346 |
|
| 173 |
-
| **Total** | | **1,170,060,424** |
|
|
|
|
| 1 |
---
|
| 2 |
+
language:
|
| 3 |
+
- multilingual
|
| 4 |
+
- ar
|
| 5 |
+
- bg
|
| 6 |
+
- ca
|
| 7 |
+
- cs
|
| 8 |
+
- da
|
| 9 |
+
- de
|
| 10 |
+
- el
|
| 11 |
+
- en
|
| 12 |
+
- es
|
| 13 |
+
- et
|
| 14 |
+
- fa
|
| 15 |
+
- fi
|
| 16 |
+
- fr
|
| 17 |
+
- gl
|
| 18 |
+
- gu
|
| 19 |
+
- he
|
| 20 |
+
- hi
|
| 21 |
+
- hr
|
| 22 |
+
- hu
|
| 23 |
+
- hy
|
| 24 |
+
- id
|
| 25 |
+
- it
|
| 26 |
+
- ja
|
| 27 |
+
- ka
|
| 28 |
+
- ko
|
| 29 |
+
- ku
|
| 30 |
+
- lt
|
| 31 |
+
- lv
|
| 32 |
+
- mk
|
| 33 |
+
- mn
|
| 34 |
+
- mr
|
| 35 |
+
- ms
|
| 36 |
+
- my
|
| 37 |
+
- nb
|
| 38 |
+
- nl
|
| 39 |
+
- pl
|
| 40 |
+
- pt
|
| 41 |
+
- ro
|
| 42 |
+
- ru
|
| 43 |
+
- sk
|
| 44 |
+
- sl
|
| 45 |
+
- sq
|
| 46 |
+
- sr
|
| 47 |
+
- sv
|
| 48 |
+
- th
|
| 49 |
+
- tr
|
| 50 |
+
- uk
|
| 51 |
+
- ur
|
| 52 |
+
- vi
|
| 53 |
license: apache-2.0
|
| 54 |
library_name: sentence-transformers
|
| 55 |
tags:
|
|
|
|
| 57 |
- feature-extraction
|
| 58 |
- sentence-similarity
|
| 59 |
- transformers
|
| 60 |
+
language_bcp47:
|
| 61 |
+
- fr-ca
|
| 62 |
+
- pt-br
|
| 63 |
+
- zh-cn
|
| 64 |
+
- zh-tw
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 65 |
pipeline_tag: sentence-similarity
|
| 66 |
---
|
| 67 |
|
| 68 |
+
# sentence-transformers/paraphrase-multilingual-MiniLM-L12-v2
|
| 69 |
|
|
|
|
| 70 |
This is a [sentence-transformers](https://www.SBERT.net) model: It maps sentences & paragraphs to a 384 dimensional dense vector space and can be used for tasks like clustering or semantic search.
|
| 71 |
|
| 72 |
+
|
| 73 |
+
|
| 74 |
## Usage (Sentence-Transformers)
|
| 75 |
+
|
| 76 |
Using this model becomes easy when you have [sentence-transformers](https://www.SBERT.net) installed:
|
| 77 |
|
| 78 |
```
|
|
|
|
| 80 |
```
|
| 81 |
|
| 82 |
Then you can use the model like this:
|
| 83 |
+
|
| 84 |
```python
|
| 85 |
from sentence_transformers import SentenceTransformer
|
| 86 |
sentences = ["This is an example sentence", "Each sentence is converted"]
|
| 87 |
|
| 88 |
+
model = SentenceTransformer('sentence-transformers/paraphrase-multilingual-MiniLM-L12-v2')
|
| 89 |
embeddings = model.encode(sentences)
|
| 90 |
print(embeddings)
|
| 91 |
```
|
| 92 |
|
| 93 |
+
|
| 94 |
+
|
| 95 |
## Usage (HuggingFace Transformers)
|
| 96 |
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.
|
| 97 |
|
| 98 |
```python
|
| 99 |
from transformers import AutoTokenizer, AutoModel
|
| 100 |
import torch
|
|
|
|
| 101 |
|
| 102 |
+
|
| 103 |
+
# Mean Pooling - Take attention mask into account for correct averaging
|
| 104 |
def mean_pooling(model_output, attention_mask):
|
| 105 |
token_embeddings = model_output[0] #First element of model_output contains all token embeddings
|
| 106 |
input_mask_expanded = attention_mask.unsqueeze(-1).expand(token_embeddings.size()).float()
|
|
|
|
| 111 |
sentences = ['This is an example sentence', 'Each sentence is converted']
|
| 112 |
|
| 113 |
# Load model from HuggingFace Hub
|
| 114 |
+
tokenizer = AutoTokenizer.from_pretrained('sentence-transformers/paraphrase-multilingual-MiniLM-L12-v2')
|
| 115 |
+
model = AutoModel.from_pretrained('sentence-transformers/paraphrase-multilingual-MiniLM-L12-v2')
|
| 116 |
|
| 117 |
# Tokenize sentences
|
| 118 |
encoded_input = tokenizer(sentences, padding=True, truncation=True, return_tensors='pt')
|
|
|
|
| 121 |
with torch.no_grad():
|
| 122 |
model_output = model(**encoded_input)
|
| 123 |
|
| 124 |
+
# Perform pooling. In this case, max pooling.
|
| 125 |
sentence_embeddings = mean_pooling(model_output, encoded_input['attention_mask'])
|
| 126 |
|
|
|
|
|
|
|
|
|
|
| 127 |
print("Sentence embeddings:")
|
| 128 |
print(sentence_embeddings)
|
| 129 |
```
|
| 130 |
|
| 131 |
+
|
| 132 |
+
|
| 133 |
+
## Full Model Architecture
|
| 134 |
+
```
|
| 135 |
+
SentenceTransformer(
|
| 136 |
+
(0): Transformer({'max_seq_length': 128, 'do_lower_case': False}) with Transformer model: BertModel
|
| 137 |
+
(1): Pooling({'word_embedding_dimension': 384, 'pooling_mode_cls_token': False, 'pooling_mode_mean_tokens': True, 'pooling_mode_max_tokens': False, 'pooling_mode_mean_sqrt_len_tokens': False})
|
| 138 |
+
)
|
| 139 |
+
```
|
| 140 |
+
|
| 141 |
+
## Citing & Authors
|
| 142 |
+
|
| 143 |
+
This model was trained by [sentence-transformers](https://www.sbert.net/).
|
| 144 |
+
|
| 145 |
+
If you find this model helpful, feel free to cite our publication [Sentence-BERT: Sentence Embeddings using Siamese BERT-Networks](https://arxiv.org/abs/1908.10084):
|
| 146 |
+
```bibtex
|
| 147 |
+
@inproceedings{reimers-2019-sentence-bert,
|
| 148 |
+
title = "Sentence-BERT: Sentence Embeddings using Siamese BERT-Networks",
|
| 149 |
+
author = "Reimers, Nils and Gurevych, Iryna",
|
| 150 |
+
booktitle = "Proceedings of the 2019 Conference on Empirical Methods in Natural Language Processing",
|
| 151 |
+
month = "11",
|
| 152 |
+
year = "2019",
|
| 153 |
+
publisher = "Association for Computational Linguistics",
|
| 154 |
+
url = "http://arxiv.org/abs/1908.10084",
|
| 155 |
+
}
|
| 156 |
+
```
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
encoder/adapter_config.json
CHANGED
|
@@ -6,7 +6,7 @@
|
|
| 6 |
"base_model_class": "BertModel",
|
| 7 |
"parent_library": "transformers.models.bert.modeling_bert"
|
| 8 |
},
|
| 9 |
-
"base_model_name_or_path": "sentence-transformers/
|
| 10 |
"bias": "none",
|
| 11 |
"corda_config": null,
|
| 12 |
"ensure_weight_tying": false,
|
|
|
|
| 6 |
"base_model_class": "BertModel",
|
| 7 |
"parent_library": "transformers.models.bert.modeling_bert"
|
| 8 |
},
|
| 9 |
+
"base_model_name_or_path": "sentence-transformers/paraphrase-multilingual-MiniLM-L12-v2",
|
| 10 |
"bias": "none",
|
| 11 |
"corda_config": null,
|
| 12 |
"ensure_weight_tying": false,
|
encoder/adapter_model.safetensors
CHANGED
|
@@ -1,3 +1,3 @@
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
-
oid sha256:
|
| 3 |
-
size
|
|
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:b7f81d2c552aff5ed2d3ed2282d22b3746fbaad36e1bbcfe6062917b7335ea85
|
| 3 |
+
size 596240
|
encoder/lora_weights/README.md
CHANGED
|
@@ -1,8 +1,8 @@
|
|
| 1 |
---
|
| 2 |
-
base_model: sentence-transformers/
|
| 3 |
library_name: peft
|
| 4 |
tags:
|
| 5 |
-
- base_model:adapter:sentence-transformers/
|
| 6 |
- lora
|
| 7 |
- transformers
|
| 8 |
---
|
|
|
|
| 1 |
---
|
| 2 |
+
base_model: sentence-transformers/paraphrase-multilingual-MiniLM-L12-v2
|
| 3 |
library_name: peft
|
| 4 |
tags:
|
| 5 |
+
- base_model:adapter:sentence-transformers/paraphrase-multilingual-MiniLM-L12-v2
|
| 6 |
- lora
|
| 7 |
- transformers
|
| 8 |
---
|
encoder/lora_weights/adapter_config.json
CHANGED
|
@@ -6,7 +6,7 @@
|
|
| 6 |
"base_model_class": "BertModel",
|
| 7 |
"parent_library": "transformers.models.bert.modeling_bert"
|
| 8 |
},
|
| 9 |
-
"base_model_name_or_path": "sentence-transformers/
|
| 10 |
"bias": "none",
|
| 11 |
"corda_config": null,
|
| 12 |
"ensure_weight_tying": false,
|
|
|
|
| 6 |
"base_model_class": "BertModel",
|
| 7 |
"parent_library": "transformers.models.bert.modeling_bert"
|
| 8 |
},
|
| 9 |
+
"base_model_name_or_path": "sentence-transformers/paraphrase-multilingual-MiniLM-L12-v2",
|
| 10 |
"bias": "none",
|
| 11 |
"corda_config": null,
|
| 12 |
"ensure_weight_tying": false,
|
encoder/lora_weights/adapter_model.safetensors
CHANGED
|
@@ -1,3 +1,3 @@
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
-
oid sha256:
|
| 3 |
-
size
|
|
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:b7f81d2c552aff5ed2d3ed2282d22b3746fbaad36e1bbcfe6062917b7335ea85
|
| 3 |
+
size 596240
|
encoder/modules.json
CHANGED
|
@@ -10,11 +10,5 @@
|
|
| 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 |
]
|
|
|
|
| 10 |
"name": "1",
|
| 11 |
"path": "1_Pooling",
|
| 12 |
"type": "sentence_transformers.models.Pooling"
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 13 |
}
|
| 14 |
]
|
encoder/sentence_bert_config.json
CHANGED
|
@@ -1,4 +1,4 @@
|
|
| 1 |
{
|
| 2 |
-
"max_seq_length":
|
| 3 |
"do_lower_case": false
|
| 4 |
}
|
|
|
|
| 1 |
{
|
| 2 |
+
"max_seq_length": 128,
|
| 3 |
"do_lower_case": false
|
| 4 |
}
|
encoder/tokenizer.json
CHANGED
|
The diff for this file is too large to render.
See raw diff
|
|
|
encoder/tokenizer_config.json
CHANGED
|
@@ -1,16 +1,23 @@
|
|
| 1 |
{
|
| 2 |
"backend": "tokenizers",
|
| 3 |
-
"
|
| 4 |
-
"
|
| 5 |
"do_lower_case": true,
|
|
|
|
| 6 |
"is_local": false,
|
| 7 |
-
"mask_token": "
|
| 8 |
-
"
|
| 9 |
-
"
|
| 10 |
-
"
|
| 11 |
-
"
|
|
|
|
|
|
|
|
|
|
|
|
|
| 12 |
"strip_accents": null,
|
| 13 |
"tokenize_chinese_chars": true,
|
| 14 |
-
"tokenizer_class": "
|
| 15 |
-
"
|
|
|
|
|
|
|
| 16 |
}
|
|
|
|
| 1 |
{
|
| 2 |
"backend": "tokenizers",
|
| 3 |
+
"bos_token": "<s>",
|
| 4 |
+
"cls_token": "<s>",
|
| 5 |
"do_lower_case": true,
|
| 6 |
+
"eos_token": "</s>",
|
| 7 |
"is_local": false,
|
| 8 |
+
"mask_token": "<mask>",
|
| 9 |
+
"max_length": 128,
|
| 10 |
+
"model_max_length": 128,
|
| 11 |
+
"pad_to_multiple_of": null,
|
| 12 |
+
"pad_token": "<pad>",
|
| 13 |
+
"pad_token_type_id": 0,
|
| 14 |
+
"padding_side": "right",
|
| 15 |
+
"sep_token": "</s>",
|
| 16 |
+
"stride": 0,
|
| 17 |
"strip_accents": null,
|
| 18 |
"tokenize_chinese_chars": true,
|
| 19 |
+
"tokenizer_class": "TokenizersBackend",
|
| 20 |
+
"truncation_side": "right",
|
| 21 |
+
"truncation_strategy": "longest_first",
|
| 22 |
+
"unk_token": "<unk>"
|
| 23 |
}
|
heads.pt
CHANGED
|
@@ -1,3 +1,3 @@
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
-
oid sha256:
|
| 3 |
-
size
|
|
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:5b749e2efcbf0e9cf8ae6fc3904ed56a7e2f09ea5c6a81e0fec20fa79567317f
|
| 3 |
+
size 897371
|
id2label.json
CHANGED
|
@@ -10,7 +10,6 @@
|
|
| 10 |
},
|
| 11 |
"context": {
|
| 12 |
"0": "followup",
|
| 13 |
-
"1": "
|
| 14 |
-
"2": "standalone"
|
| 15 |
}
|
| 16 |
}
|
|
|
|
| 10 |
},
|
| 11 |
"context": {
|
| 12 |
"0": "followup",
|
| 13 |
+
"1": "standalone"
|
|
|
|
| 14 |
}
|
| 15 |
}
|
label2id.json
CHANGED
|
@@ -10,7 +10,6 @@
|
|
| 10 |
},
|
| 11 |
"context": {
|
| 12 |
"followup": 0,
|
| 13 |
-
"
|
| 14 |
-
"standalone": 2
|
| 15 |
}
|
| 16 |
}
|
|
|
|
| 10 |
},
|
| 11 |
"context": {
|
| 12 |
"followup": 0,
|
| 13 |
+
"standalone": 1
|
|
|
|
| 14 |
}
|
| 15 |
}
|
train_config.json
CHANGED
|
@@ -1,19 +1,21 @@
|
|
| 1 |
{
|
| 2 |
-
"model_name": "
|
| 3 |
"max_length": 128,
|
| 4 |
-
"epochs":
|
| 5 |
"batch_size": 16,
|
| 6 |
-
"lr_encoder":
|
| 7 |
-
"lr_heads": 0.
|
| 8 |
"weight_decay": 0.05,
|
| 9 |
"task_weight_macro": 1.0,
|
| 10 |
-
"task_weight_intent": 1.
|
| 11 |
-
"task_weight_context": 0.
|
| 12 |
"device": "cuda",
|
| 13 |
"output_dir": "models\\artifacts",
|
| 14 |
"seed": 42,
|
| 15 |
"use_lora": true,
|
| 16 |
"lora_r": 8,
|
| 17 |
"lora_alpha": 16,
|
| 18 |
-
"lora_dropout": 0.1
|
|
|
|
|
|
|
| 19 |
}
|
|
|
|
| 1 |
{
|
| 2 |
+
"model_name": "paraphrase-multilingual-MiniLM-L12-v2",
|
| 3 |
"max_length": 128,
|
| 4 |
+
"epochs": 20,
|
| 5 |
"batch_size": 16,
|
| 6 |
+
"lr_encoder": 8e-06,
|
| 7 |
+
"lr_heads": 0.0004,
|
| 8 |
"weight_decay": 0.05,
|
| 9 |
"task_weight_macro": 1.0,
|
| 10 |
+
"task_weight_intent": 1.4,
|
| 11 |
+
"task_weight_context": 0.8,
|
| 12 |
"device": "cuda",
|
| 13 |
"output_dir": "models\\artifacts",
|
| 14 |
"seed": 42,
|
| 15 |
"use_lora": true,
|
| 16 |
"lora_r": 8,
|
| 17 |
"lora_alpha": 16,
|
| 18 |
+
"lora_dropout": 0.1,
|
| 19 |
+
"patience": 5,
|
| 20 |
+
"min_delta": 0.001
|
| 21 |
}
|