Upload folder using huggingface_hub
Browse files- 1_Pooling/config.json +10 -0
- README.md +198 -0
- config.json +32 -0
- config_sentence_transformers.json +10 -0
- model.safetensors +3 -0
- modules.json +20 -0
- sentence_bert_config.json +4 -0
- special_tokens_map.json +37 -0
- tokenizer.json +0 -0
- tokenizer_config.json +57 -0
- vocab.txt +0 -0
1_Pooling/config.json
ADDED
@@ -0,0 +1,10 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
{
|
2 |
+
"word_embedding_dimension": 1024,
|
3 |
+
"pooling_mode_cls_token": true,
|
4 |
+
"pooling_mode_mean_tokens": false,
|
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 |
+
"include_prompt": true
|
10 |
+
}
|
README.md
ADDED
@@ -0,0 +1,198 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
---
|
2 |
+
base_model: BAAI/bge-large-en
|
3 |
+
datasets: []
|
4 |
+
language: []
|
5 |
+
library_name: sentence-transformers
|
6 |
+
pipeline_tag: sentence-similarity
|
7 |
+
tags:
|
8 |
+
- sentence-transformers
|
9 |
+
- sentence-similarity
|
10 |
+
- feature-extraction
|
11 |
+
- generated_from_trainer
|
12 |
+
- dataset_size:5000
|
13 |
+
- loss:MultipleNegativesRankingLoss
|
14 |
+
widget:
|
15 |
+
- source_sentence: New treatments show promise in fight against antibiotic resistance
|
16 |
+
sentences:
|
17 |
+
- Ancient ruins discovered beneath modern city
|
18 |
+
- Medical researchers develop innovative approaches to combat superbugs
|
19 |
+
- Medical researchers develop innovative approaches to combat superbugs
|
20 |
+
- source_sentence: Breakthrough in artificial intelligence sparks ethical debates
|
21 |
+
sentences:
|
22 |
+
- Health organizations collaborate to end polio worldwide
|
23 |
+
- Ancient manuscript found in Egyptian tomb
|
24 |
+
- AI researchers discuss implications of new advancements
|
25 |
+
- source_sentence: UN condemns forced labor practices in multiple countries
|
26 |
+
sentences:
|
27 |
+
- Marine biologists raise alarm over rising ocean temperatures
|
28 |
+
- Global push for labor rights gains momentum
|
29 |
+
- Record number of endangered species found in protected area
|
30 |
+
- source_sentence: Stock markets plunge amid fears of global recession
|
31 |
+
sentences:
|
32 |
+
- Discovery of ancient shipwreck off Greek coast
|
33 |
+
- Health organizations collaborate to end polio worldwide
|
34 |
+
- Investors react to warning signs of economic downturn
|
35 |
+
- source_sentence: Scientists warn of accelerating ice melt in Antarctica
|
36 |
+
sentences:
|
37 |
+
- AI researchers discuss implications of new advancements
|
38 |
+
- Major breakthrough in AI technology
|
39 |
+
- New research highlights the urgency of addressing climate change
|
40 |
+
---
|
41 |
+
|
42 |
+
# SentenceTransformer based on BAAI/bge-large-en
|
43 |
+
|
44 |
+
This is a [sentence-transformers](https://www.SBERT.net) model finetuned from [BAAI/bge-large-en](https://huggingface.co/BAAI/bge-large-en). It maps sentences & paragraphs to a 1024-dimensional dense vector space and can be used for semantic textual similarity, semantic search, paraphrase mining, text classification, clustering, and more.
|
45 |
+
|
46 |
+
## Model Details
|
47 |
+
|
48 |
+
### Model Description
|
49 |
+
- **Model Type:** Sentence Transformer
|
50 |
+
- **Base model:** [BAAI/bge-large-en](https://huggingface.co/BAAI/bge-large-en) <!-- at revision abe7d9d814b775ca171121fb03f394dc42974275 -->
|
51 |
+
- **Maximum Sequence Length:** 512 tokens
|
52 |
+
- **Output Dimensionality:** 1024 tokens
|
53 |
+
- **Similarity Function:** Cosine Similarity
|
54 |
+
<!-- - **Training Dataset:** Unknown -->
|
55 |
+
<!-- - **Language:** Unknown -->
|
56 |
+
<!-- - **License:** Unknown -->
|
57 |
+
|
58 |
+
### Model Sources
|
59 |
+
|
60 |
+
- **Documentation:** [Sentence Transformers Documentation](https://sbert.net)
|
61 |
+
- **Repository:** [Sentence Transformers on GitHub](https://github.com/UKPLab/sentence-transformers)
|
62 |
+
- **Hugging Face:** [Sentence Transformers on Hugging Face](https://huggingface.co/models?library=sentence-transformers)
|
63 |
+
|
64 |
+
### Full Model Architecture
|
65 |
+
|
66 |
+
```
|
67 |
+
SentenceTransformer(
|
68 |
+
(0): Transformer({'max_seq_length': 512, 'do_lower_case': True}) with Transformer model: BertModel
|
69 |
+
(1): Pooling({'word_embedding_dimension': 1024, 'pooling_mode_cls_token': True, 'pooling_mode_mean_tokens': False, 'pooling_mode_max_tokens': False, 'pooling_mode_mean_sqrt_len_tokens': False, 'pooling_mode_weightedmean_tokens': False, 'pooling_mode_lasttoken': False, 'include_prompt': True})
|
70 |
+
(2): Normalize()
|
71 |
+
)
|
72 |
+
```
|
73 |
+
|
74 |
+
## Usage
|
75 |
+
|
76 |
+
### Direct Usage (Sentence Transformers)
|
77 |
+
|
78 |
+
First install the Sentence Transformers library:
|
79 |
+
|
80 |
+
```bash
|
81 |
+
pip install -U sentence-transformers
|
82 |
+
```
|
83 |
+
|
84 |
+
Then you can load this model and run inference.
|
85 |
+
```python
|
86 |
+
from sentence_transformers import SentenceTransformer
|
87 |
+
|
88 |
+
# Download from the 🤗 Hub
|
89 |
+
model = SentenceTransformer("sentence_transformers_model_id")
|
90 |
+
# Run inference
|
91 |
+
sentences = [
|
92 |
+
'Scientists warn of accelerating ice melt in Antarctica',
|
93 |
+
'New research highlights the urgency of addressing climate change',
|
94 |
+
'Major breakthrough in AI technology',
|
95 |
+
]
|
96 |
+
embeddings = model.encode(sentences)
|
97 |
+
print(embeddings.shape)
|
98 |
+
# [3, 1024]
|
99 |
+
|
100 |
+
# Get the similarity scores for the embeddings
|
101 |
+
similarities = model.similarity(embeddings, embeddings)
|
102 |
+
print(similarities.shape)
|
103 |
+
# [3, 3]
|
104 |
+
```
|
105 |
+
|
106 |
+
<!--
|
107 |
+
### Direct Usage (Transformers)
|
108 |
+
|
109 |
+
<details><summary>Click to see the direct usage in Transformers</summary>
|
110 |
+
|
111 |
+
</details>
|
112 |
+
-->
|
113 |
+
|
114 |
+
<!--
|
115 |
+
### Downstream Usage (Sentence Transformers)
|
116 |
+
|
117 |
+
You can finetune this model on your own dataset.
|
118 |
+
|
119 |
+
<details><summary>Click to expand</summary>
|
120 |
+
|
121 |
+
</details>
|
122 |
+
-->
|
123 |
+
|
124 |
+
<!--
|
125 |
+
### Out-of-Scope Use
|
126 |
+
|
127 |
+
*List how the model may foreseeably be misused and address what users ought not to do with the model.*
|
128 |
+
-->
|
129 |
+
|
130 |
+
<!--
|
131 |
+
## Bias, Risks and Limitations
|
132 |
+
|
133 |
+
*What are the known or foreseeable issues stemming from this model? You could also flag here known failure cases or weaknesses of the model.*
|
134 |
+
-->
|
135 |
+
|
136 |
+
<!--
|
137 |
+
### Recommendations
|
138 |
+
|
139 |
+
*What are recommendations with respect to the foreseeable issues? For example, filtering explicit content.*
|
140 |
+
-->
|
141 |
+
|
142 |
+
## Training Details
|
143 |
+
|
144 |
+
### Framework Versions
|
145 |
+
- Python: 3.10.12
|
146 |
+
- Sentence Transformers: 3.0.1
|
147 |
+
- Transformers: 4.41.2
|
148 |
+
- PyTorch: 2.3.0+cu121
|
149 |
+
- Accelerate: 0.31.0
|
150 |
+
- Datasets: 2.20.0
|
151 |
+
- Tokenizers: 0.19.1
|
152 |
+
|
153 |
+
## Citation
|
154 |
+
|
155 |
+
### BibTeX
|
156 |
+
|
157 |
+
#### Sentence Transformers
|
158 |
+
```bibtex
|
159 |
+
@inproceedings{reimers-2019-sentence-bert,
|
160 |
+
title = "Sentence-BERT: Sentence Embeddings using Siamese BERT-Networks",
|
161 |
+
author = "Reimers, Nils and Gurevych, Iryna",
|
162 |
+
booktitle = "Proceedings of the 2019 Conference on Empirical Methods in Natural Language Processing",
|
163 |
+
month = "11",
|
164 |
+
year = "2019",
|
165 |
+
publisher = "Association for Computational Linguistics",
|
166 |
+
url = "https://arxiv.org/abs/1908.10084",
|
167 |
+
}
|
168 |
+
```
|
169 |
+
|
170 |
+
#### MultipleNegativesRankingLoss
|
171 |
+
```bibtex
|
172 |
+
@misc{henderson2017efficient,
|
173 |
+
title={Efficient Natural Language Response Suggestion for Smart Reply},
|
174 |
+
author={Matthew Henderson and Rami Al-Rfou and Brian Strope and Yun-hsuan Sung and Laszlo Lukacs and Ruiqi Guo and Sanjiv Kumar and Balint Miklos and Ray Kurzweil},
|
175 |
+
year={2017},
|
176 |
+
eprint={1705.00652},
|
177 |
+
archivePrefix={arXiv},
|
178 |
+
primaryClass={cs.CL}
|
179 |
+
}
|
180 |
+
```
|
181 |
+
|
182 |
+
<!--
|
183 |
+
## Glossary
|
184 |
+
|
185 |
+
*Clearly define terms in order to be accessible across audiences.*
|
186 |
+
-->
|
187 |
+
|
188 |
+
<!--
|
189 |
+
## Model Card Authors
|
190 |
+
|
191 |
+
*Lists the people who create the model card, providing recognition and accountability for the detailed work that goes into its construction.*
|
192 |
+
-->
|
193 |
+
|
194 |
+
<!--
|
195 |
+
## Model Card Contact
|
196 |
+
|
197 |
+
*Provides a way for people who have updates to the Model Card, suggestions, or questions, to contact the Model Card authors.*
|
198 |
+
-->
|
config.json
ADDED
@@ -0,0 +1,32 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
{
|
2 |
+
"_name_or_path": "BAAI/bge-large-en",
|
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": 1024,
|
12 |
+
"id2label": {
|
13 |
+
"0": "LABEL_0"
|
14 |
+
},
|
15 |
+
"initializer_range": 0.02,
|
16 |
+
"intermediate_size": 4096,
|
17 |
+
"label2id": {
|
18 |
+
"LABEL_0": 0
|
19 |
+
},
|
20 |
+
"layer_norm_eps": 1e-12,
|
21 |
+
"max_position_embeddings": 512,
|
22 |
+
"model_type": "bert",
|
23 |
+
"num_attention_heads": 16,
|
24 |
+
"num_hidden_layers": 24,
|
25 |
+
"pad_token_id": 0,
|
26 |
+
"position_embedding_type": "absolute",
|
27 |
+
"torch_dtype": "float32",
|
28 |
+
"transformers_version": "4.41.2",
|
29 |
+
"type_vocab_size": 2,
|
30 |
+
"use_cache": true,
|
31 |
+
"vocab_size": 30522
|
32 |
+
}
|
config_sentence_transformers.json
ADDED
@@ -0,0 +1,10 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
{
|
2 |
+
"__version__": {
|
3 |
+
"sentence_transformers": "3.0.1",
|
4 |
+
"transformers": "4.41.2",
|
5 |
+
"pytorch": "2.3.0+cu121"
|
6 |
+
},
|
7 |
+
"prompts": {},
|
8 |
+
"default_prompt_name": null,
|
9 |
+
"similarity_fn_name": null
|
10 |
+
}
|
model.safetensors
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:5987c2fc63633c32b725069c3d3427b679908b866819fe7d2f28451375418803
|
3 |
+
size 1340612432
|
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 |
+
]
|
sentence_bert_config.json
ADDED
@@ -0,0 +1,4 @@
|
|
|
|
|
|
|
|
|
|
|
1 |
+
{
|
2 |
+
"max_seq_length": 512,
|
3 |
+
"do_lower_case": true
|
4 |
+
}
|
special_tokens_map.json
ADDED
@@ -0,0 +1,37 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
{
|
2 |
+
"cls_token": {
|
3 |
+
"content": "[CLS]",
|
4 |
+
"lstrip": false,
|
5 |
+
"normalized": false,
|
6 |
+
"rstrip": false,
|
7 |
+
"single_word": false
|
8 |
+
},
|
9 |
+
"mask_token": {
|
10 |
+
"content": "[MASK]",
|
11 |
+
"lstrip": false,
|
12 |
+
"normalized": false,
|
13 |
+
"rstrip": false,
|
14 |
+
"single_word": false
|
15 |
+
},
|
16 |
+
"pad_token": {
|
17 |
+
"content": "[PAD]",
|
18 |
+
"lstrip": false,
|
19 |
+
"normalized": false,
|
20 |
+
"rstrip": false,
|
21 |
+
"single_word": false
|
22 |
+
},
|
23 |
+
"sep_token": {
|
24 |
+
"content": "[SEP]",
|
25 |
+
"lstrip": false,
|
26 |
+
"normalized": false,
|
27 |
+
"rstrip": false,
|
28 |
+
"single_word": false
|
29 |
+
},
|
30 |
+
"unk_token": {
|
31 |
+
"content": "[UNK]",
|
32 |
+
"lstrip": false,
|
33 |
+
"normalized": false,
|
34 |
+
"rstrip": false,
|
35 |
+
"single_word": false
|
36 |
+
}
|
37 |
+
}
|
tokenizer.json
ADDED
The diff for this file is too large to render.
See raw diff
|
|
tokenizer_config.json
ADDED
@@ -0,0 +1,57 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
{
|
2 |
+
"added_tokens_decoder": {
|
3 |
+
"0": {
|
4 |
+
"content": "[PAD]",
|
5 |
+
"lstrip": false,
|
6 |
+
"normalized": false,
|
7 |
+
"rstrip": false,
|
8 |
+
"single_word": false,
|
9 |
+
"special": true
|
10 |
+
},
|
11 |
+
"100": {
|
12 |
+
"content": "[UNK]",
|
13 |
+
"lstrip": false,
|
14 |
+
"normalized": false,
|
15 |
+
"rstrip": false,
|
16 |
+
"single_word": false,
|
17 |
+
"special": true
|
18 |
+
},
|
19 |
+
"101": {
|
20 |
+
"content": "[CLS]",
|
21 |
+
"lstrip": false,
|
22 |
+
"normalized": false,
|
23 |
+
"rstrip": false,
|
24 |
+
"single_word": false,
|
25 |
+
"special": true
|
26 |
+
},
|
27 |
+
"102": {
|
28 |
+
"content": "[SEP]",
|
29 |
+
"lstrip": false,
|
30 |
+
"normalized": false,
|
31 |
+
"rstrip": false,
|
32 |
+
"single_word": false,
|
33 |
+
"special": true
|
34 |
+
},
|
35 |
+
"103": {
|
36 |
+
"content": "[MASK]",
|
37 |
+
"lstrip": false,
|
38 |
+
"normalized": false,
|
39 |
+
"rstrip": false,
|
40 |
+
"single_word": false,
|
41 |
+
"special": true
|
42 |
+
}
|
43 |
+
},
|
44 |
+
"clean_up_tokenization_spaces": true,
|
45 |
+
"cls_token": "[CLS]",
|
46 |
+
"do_basic_tokenize": true,
|
47 |
+
"do_lower_case": true,
|
48 |
+
"mask_token": "[MASK]",
|
49 |
+
"model_max_length": 512,
|
50 |
+
"never_split": null,
|
51 |
+
"pad_token": "[PAD]",
|
52 |
+
"sep_token": "[SEP]",
|
53 |
+
"strip_accents": null,
|
54 |
+
"tokenize_chinese_chars": true,
|
55 |
+
"tokenizer_class": "BertTokenizer",
|
56 |
+
"unk_token": "[UNK]"
|
57 |
+
}
|
vocab.txt
ADDED
The diff for this file is too large to render.
See raw diff
|
|