Sentence Similarity
sentence-transformers
Safetensors
bert
feature-extraction
Generated from Trainer
dataset_size:4122
loss:MultipleNegativesRankingLoss
Eval Results (legacy)
text-embeddings-inference
Instructions to use jmroth/nlp-biencoder-finetuned with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- sentence-transformers
How to use jmroth/nlp-biencoder-finetuned with sentence-transformers:
from sentence_transformers import SentenceTransformer model = SentenceTransformer("jmroth/nlp-biencoder-finetuned") sentences = [ "Environment Minister Greg Hunt the Coalition's emissions reduction fund, at $13.95 per tonne of carbon, is around 1 per cent of the cost of reducing carbon under the former Labor government's carbon pricing scheme, which he cost $1,300 a tonne.", "Sirius's heliacal rising, just before the start of the Nile flood, gave Sopdet a close connection with the flood and the resulting growth of plants.", "The proposal would have set an emissions price of NZ$15 per tonne of CO2-equivalent.", "\"More recently, evaporation over lakes has steadily been increasing, largely due to increases in water surface temperature,\" Gronewold said." ] embeddings = model.encode(sentences) similarities = model.similarity(embeddings, embeddings) print(similarities.shape) # [4, 4] - Notebooks
- Google Colab
- Kaggle
Add new SentenceTransformer model
Browse files- 1_Pooling/config.json +5 -0
- README.md +523 -0
- config.json +30 -0
- config_sentence_transformers.json +14 -0
- model.safetensors +3 -0
- modules.json +20 -0
- sentence_bert_config.json +10 -0
- tokenizer.json +0 -0
- tokenizer_config.json +16 -0
1_Pooling/config.json
ADDED
|
@@ -0,0 +1,5 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"embedding_dimension": 384,
|
| 3 |
+
"pooling_mode": "mean",
|
| 4 |
+
"include_prompt": true
|
| 5 |
+
}
|
README.md
ADDED
|
@@ -0,0 +1,523 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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- feature-extraction
|
| 6 |
+
- generated_from_trainer
|
| 7 |
+
- dataset_size:4122
|
| 8 |
+
- loss:MultipleNegativesRankingLoss
|
| 9 |
+
base_model: sentence-transformers/all-MiniLM-L6-v2
|
| 10 |
+
widget:
|
| 11 |
+
- source_sentence: Environment Minister Greg Hunt the Coalition's emissions reduction
|
| 12 |
+
fund, at $13.95 per tonne of carbon, is around 1 per cent of the cost of reducing
|
| 13 |
+
carbon under the former Labor government's carbon pricing scheme, which he cost
|
| 14 |
+
$1,300 a tonne.
|
| 15 |
+
sentences:
|
| 16 |
+
- Sirius's heliacal rising, just before the start of the Nile flood, gave Sopdet
|
| 17 |
+
a close connection with the flood and the resulting growth of plants.
|
| 18 |
+
- The proposal would have set an emissions price of NZ$15 per tonne of CO2-equivalent.
|
| 19 |
+
- '"More recently, evaporation over lakes has steadily been increasing, largely
|
| 20 |
+
due to increases in water surface temperature," Gronewold said.'
|
| 21 |
+
- source_sentence: “In 2013 the level of U.S. farm output was about 2.7 times its
|
| 22 |
+
1948 level, and productivity was growing at an average annual rate of 1.52%.
|
| 23 |
+
sentences:
|
| 24 |
+
- As the concentration of carbon dioxide increases in the atmosphere, the increased
|
| 25 |
+
uptake of carbon dioxide into the oceans is causing a measurable decrease in the
|
| 26 |
+
pH of the oceans, which is referred to as ocean acidification.
|
| 27 |
+
- The IPCC was tasked with reviewing peer-reviewed scientific literature and other
|
| 28 |
+
relevant publications to provide information on the state of knowledge about climate
|
| 29 |
+
change.
|
| 30 |
+
- Private sector productivity growth, measured as real output per hour of all persons,
|
| 31 |
+
increased at an average rate of 1.9% during Reagan's eight years, compared to
|
| 32 |
+
an average 1.3% during the preceding eight years.
|
| 33 |
+
- source_sentence: '''Phil Jones said that for the past 15 years there has been no
|
| 34 |
+
"statistically significant" warming.'
|
| 35 |
+
sentences:
|
| 36 |
+
- From this, he concluded that "The post-1980 global warming trend from surface
|
| 37 |
+
thermometers is not credible.
|
| 38 |
+
- Fox News has widely been described as a major platform for climate change denial.
|
| 39 |
+
- In comparison to the extended record, the sea-ice extent in the polar region by
|
| 40 |
+
September 2007 was only half the recorded mass that had been estimated to exist
|
| 41 |
+
within the 1950–1970 period.
|
| 42 |
+
- source_sentence: '"NASA satellite data from the years 2000 through 2011 show the
|
| 43 |
+
Earth''s atmosphere is allowing far more heat to be released into space than alarmist
|
| 44 |
+
computer models have predicted, reports a new study in the peer-reviewed science
|
| 45 |
+
journal Remote Sensing.'
|
| 46 |
+
sentences:
|
| 47 |
+
- The Lamont–Doherty Earth Observatory at Columbia University is one of the world's
|
| 48 |
+
leading research centers developing fundamental knowledge about the origin, evolution
|
| 49 |
+
and future of the natural world.
|
| 50 |
+
- Mann said, "Ten years ago, the availability of data became quite sparse by the
|
| 51 |
+
time you got back to 1,000 AD, and what we had then was weighted towards tree-ring
|
| 52 |
+
data; but now you can go back 1,300 years without using tree-ring data at all
|
| 53 |
+
and still get a verifiable conclusion."
|
| 54 |
+
- This premature announcement came from a preliminary news release about a study
|
| 55 |
+
which had not yet been peer reviewed.
|
| 56 |
+
- source_sentence: '...there [is] anecdotal and other evidence suggesting similar
|
| 57 |
+
melts from 1938-43 and on other occasions.'
|
| 58 |
+
sentences:
|
| 59 |
+
- They were formed by the melting of sulfur deposits at temperatures as low as 113 °C
|
| 60 |
+
(235 °F).
|
| 61 |
+
- For example, in the study of the origin of the earth, one can reasonably model
|
| 62 |
+
earth's mass, temperature, and rate of rotation, as a function of time allowing
|
| 63 |
+
one to extrapolate forward or backward in time and so predict future or prior
|
| 64 |
+
events.
|
| 65 |
+
- Consequently, summers are 2.3 °C (4 °F) warmer in the Northern Hemisphere than
|
| 66 |
+
in the Southern Hemisphere under similar conditions.
|
| 67 |
+
pipeline_tag: sentence-similarity
|
| 68 |
+
library_name: sentence-transformers
|
| 69 |
+
metrics:
|
| 70 |
+
- cosine_accuracy@1
|
| 71 |
+
- cosine_accuracy@3
|
| 72 |
+
- cosine_accuracy@5
|
| 73 |
+
- cosine_accuracy@10
|
| 74 |
+
- cosine_precision@1
|
| 75 |
+
- cosine_precision@3
|
| 76 |
+
- cosine_precision@5
|
| 77 |
+
- cosine_precision@10
|
| 78 |
+
- cosine_recall@1
|
| 79 |
+
- cosine_recall@3
|
| 80 |
+
- cosine_recall@5
|
| 81 |
+
- cosine_recall@10
|
| 82 |
+
- cosine_ndcg@10
|
| 83 |
+
- cosine_mrr@10
|
| 84 |
+
- cosine_map@100
|
| 85 |
+
model-index:
|
| 86 |
+
- name: SentenceTransformer based on sentence-transformers/all-MiniLM-L6-v2
|
| 87 |
+
results:
|
| 88 |
+
- task:
|
| 89 |
+
type: information-retrieval
|
| 90 |
+
name: Information Retrieval
|
| 91 |
+
dataset:
|
| 92 |
+
name: claims dev
|
| 93 |
+
type: claims-dev
|
| 94 |
+
metrics:
|
| 95 |
+
- type: cosine_accuracy@1
|
| 96 |
+
value: 0.24025974025974026
|
| 97 |
+
name: Cosine Accuracy@1
|
| 98 |
+
- type: cosine_accuracy@3
|
| 99 |
+
value: 0.44155844155844154
|
| 100 |
+
name: Cosine Accuracy@3
|
| 101 |
+
- type: cosine_accuracy@5
|
| 102 |
+
value: 0.5454545454545454
|
| 103 |
+
name: Cosine Accuracy@5
|
| 104 |
+
- type: cosine_accuracy@10
|
| 105 |
+
value: 0.6818181818181818
|
| 106 |
+
name: Cosine Accuracy@10
|
| 107 |
+
- type: cosine_precision@1
|
| 108 |
+
value: 0.24025974025974026
|
| 109 |
+
name: Cosine Precision@1
|
| 110 |
+
- type: cosine_precision@3
|
| 111 |
+
value: 0.19047619047619044
|
| 112 |
+
name: Cosine Precision@3
|
| 113 |
+
- type: cosine_precision@5
|
| 114 |
+
value: 0.15454545454545457
|
| 115 |
+
name: Cosine Precision@5
|
| 116 |
+
- type: cosine_precision@10
|
| 117 |
+
value: 0.10714285714285714
|
| 118 |
+
name: Cosine Precision@10
|
| 119 |
+
- type: cosine_recall@1
|
| 120 |
+
value: 0.09577922077922078
|
| 121 |
+
name: Cosine Recall@1
|
| 122 |
+
- type: cosine_recall@3
|
| 123 |
+
value: 0.21482683982683978
|
| 124 |
+
name: Cosine Recall@3
|
| 125 |
+
- type: cosine_recall@5
|
| 126 |
+
value: 0.27532467532467536
|
| 127 |
+
name: Cosine Recall@5
|
| 128 |
+
- type: cosine_recall@10
|
| 129 |
+
value: 0.36612554112554113
|
| 130 |
+
name: Cosine Recall@10
|
| 131 |
+
- type: cosine_ndcg@10
|
| 132 |
+
value: 0.2932326612195408
|
| 133 |
+
name: Cosine Ndcg@10
|
| 134 |
+
- type: cosine_mrr@10
|
| 135 |
+
value: 0.3742553081838797
|
| 136 |
+
name: Cosine Mrr@10
|
| 137 |
+
- type: cosine_map@100
|
| 138 |
+
value: 0.23004915088757852
|
| 139 |
+
name: Cosine Map@100
|
| 140 |
+
---
|
| 141 |
+
|
| 142 |
+
# SentenceTransformer based on sentence-transformers/all-MiniLM-L6-v2
|
| 143 |
+
|
| 144 |
+
This is a [sentence-transformers](https://www.SBERT.net) model finetuned from [sentence-transformers/all-MiniLM-L6-v2](https://huggingface.co/sentence-transformers/all-MiniLM-L6-v2). It maps sentences & paragraphs to a 384-dimensional dense vector space and can be used for retrieval.
|
| 145 |
+
|
| 146 |
+
## Model Details
|
| 147 |
+
|
| 148 |
+
### Model Description
|
| 149 |
+
- **Model Type:** Sentence Transformer
|
| 150 |
+
- **Base model:** [sentence-transformers/all-MiniLM-L6-v2](https://huggingface.co/sentence-transformers/all-MiniLM-L6-v2) <!-- at revision c9745ed1d9f207416be6d2e6f8de32d1f16199bf -->
|
| 151 |
+
- **Maximum Sequence Length:** 256 tokens
|
| 152 |
+
- **Output Dimensionality:** 384 dimensions
|
| 153 |
+
- **Similarity Function:** Cosine Similarity
|
| 154 |
+
- **Supported Modality:** Text
|
| 155 |
+
<!-- - **Training Dataset:** Unknown -->
|
| 156 |
+
<!-- - **Language:** Unknown -->
|
| 157 |
+
<!-- - **License:** Unknown -->
|
| 158 |
+
|
| 159 |
+
### Model Sources
|
| 160 |
+
|
| 161 |
+
- **Documentation:** [Sentence Transformers Documentation](https://sbert.net)
|
| 162 |
+
- **Repository:** [Sentence Transformers on GitHub](https://github.com/huggingface/sentence-transformers)
|
| 163 |
+
- **Hugging Face:** [Sentence Transformers on Hugging Face](https://huggingface.co/models?library=sentence-transformers)
|
| 164 |
+
|
| 165 |
+
### Full Model Architecture
|
| 166 |
+
|
| 167 |
+
```
|
| 168 |
+
SentenceTransformer(
|
| 169 |
+
(0): Transformer({'transformer_task': 'feature-extraction', 'modality_config': {'text': {'method': 'forward', 'method_output_name': 'last_hidden_state'}}, 'module_output_name': 'token_embeddings', 'architecture': 'BertModel'})
|
| 170 |
+
(1): Pooling({'embedding_dimension': 384, 'pooling_mode': 'mean', 'include_prompt': True})
|
| 171 |
+
(2): Normalize({})
|
| 172 |
+
)
|
| 173 |
+
```
|
| 174 |
+
|
| 175 |
+
## Usage
|
| 176 |
+
|
| 177 |
+
### Direct Usage (Sentence Transformers)
|
| 178 |
+
|
| 179 |
+
First install the Sentence Transformers library:
|
| 180 |
+
|
| 181 |
+
```bash
|
| 182 |
+
pip install -U sentence-transformers
|
| 183 |
+
```
|
| 184 |
+
Then you can load this model and run inference.
|
| 185 |
+
```python
|
| 186 |
+
from sentence_transformers import SentenceTransformer
|
| 187 |
+
|
| 188 |
+
# Download from the 🤗 Hub
|
| 189 |
+
model = SentenceTransformer("jmroth/my-awesome-model")
|
| 190 |
+
# Run inference
|
| 191 |
+
sentences = [
|
| 192 |
+
'...there [is] anecdotal and other evidence suggesting similar melts from 1938-43 and on other occasions.',
|
| 193 |
+
'They were formed by the melting of sulfur deposits at temperatures as low as 113\xa0°C (235\xa0°F).',
|
| 194 |
+
'Consequently, summers are 2.3\xa0°C (4\xa0°F) warmer in the Northern Hemisphere than in the Southern Hemisphere under similar conditions.',
|
| 195 |
+
]
|
| 196 |
+
embeddings = model.encode(sentences)
|
| 197 |
+
print(embeddings.shape)
|
| 198 |
+
# [3, 384]
|
| 199 |
+
|
| 200 |
+
# Get the similarity scores for the embeddings
|
| 201 |
+
similarities = model.similarity(embeddings, embeddings)
|
| 202 |
+
print(similarities)
|
| 203 |
+
# tensor([[1.0000, 0.4966, 0.1535],
|
| 204 |
+
# [0.4966, 1.0000, 0.3254],
|
| 205 |
+
# [0.1535, 0.3254, 1.0000]])
|
| 206 |
+
```
|
| 207 |
+
<!--
|
| 208 |
+
### Direct Usage (Transformers)
|
| 209 |
+
|
| 210 |
+
<details><summary>Click to see the direct usage in Transformers</summary>
|
| 211 |
+
|
| 212 |
+
</details>
|
| 213 |
+
-->
|
| 214 |
+
|
| 215 |
+
<!--
|
| 216 |
+
### Downstream Usage (Sentence Transformers)
|
| 217 |
+
|
| 218 |
+
You can finetune this model on your own dataset.
|
| 219 |
+
|
| 220 |
+
<details><summary>Click to expand</summary>
|
| 221 |
+
|
| 222 |
+
</details>
|
| 223 |
+
-->
|
| 224 |
+
|
| 225 |
+
<!--
|
| 226 |
+
### Out-of-Scope Use
|
| 227 |
+
|
| 228 |
+
*List how the model may foreseeably be misused and address what users ought not to do with the model.*
|
| 229 |
+
-->
|
| 230 |
+
|
| 231 |
+
## Evaluation
|
| 232 |
+
|
| 233 |
+
### Metrics
|
| 234 |
+
|
| 235 |
+
#### Information Retrieval
|
| 236 |
+
|
| 237 |
+
* Dataset: `claims-dev`
|
| 238 |
+
* Evaluated with [<code>InformationRetrievalEvaluator</code>](https://sbert.net/docs/package_reference/sentence_transformer/evaluation.html#sentence_transformers.sentence_transformer.evaluation.InformationRetrievalEvaluator)
|
| 239 |
+
|
| 240 |
+
| Metric | Value |
|
| 241 |
+
|:--------------------|:-----------|
|
| 242 |
+
| cosine_accuracy@1 | 0.2403 |
|
| 243 |
+
| cosine_accuracy@3 | 0.4416 |
|
| 244 |
+
| cosine_accuracy@5 | 0.5455 |
|
| 245 |
+
| cosine_accuracy@10 | 0.6818 |
|
| 246 |
+
| cosine_precision@1 | 0.2403 |
|
| 247 |
+
| cosine_precision@3 | 0.1905 |
|
| 248 |
+
| cosine_precision@5 | 0.1545 |
|
| 249 |
+
| cosine_precision@10 | 0.1071 |
|
| 250 |
+
| cosine_recall@1 | 0.0958 |
|
| 251 |
+
| cosine_recall@3 | 0.2148 |
|
| 252 |
+
| cosine_recall@5 | 0.2753 |
|
| 253 |
+
| cosine_recall@10 | 0.3661 |
|
| 254 |
+
| **cosine_ndcg@10** | **0.2932** |
|
| 255 |
+
| cosine_mrr@10 | 0.3743 |
|
| 256 |
+
| cosine_map@100 | 0.23 |
|
| 257 |
+
|
| 258 |
+
<!--
|
| 259 |
+
## Bias, Risks and Limitations
|
| 260 |
+
|
| 261 |
+
*What are the known or foreseeable issues stemming from this model? You could also flag here known failure cases or weaknesses of the model.*
|
| 262 |
+
-->
|
| 263 |
+
|
| 264 |
+
<!--
|
| 265 |
+
### Recommendations
|
| 266 |
+
|
| 267 |
+
*What are recommendations with respect to the foreseeable issues? For example, filtering explicit content.*
|
| 268 |
+
-->
|
| 269 |
+
|
| 270 |
+
## Training Details
|
| 271 |
+
|
| 272 |
+
### Training Dataset
|
| 273 |
+
|
| 274 |
+
#### Unnamed Dataset
|
| 275 |
+
|
| 276 |
+
* Size: 4,122 training samples
|
| 277 |
+
* Columns: <code>anchor</code> and <code>positive</code>
|
| 278 |
+
* Approximate statistics based on the first 1000 samples:
|
| 279 |
+
| | anchor | positive |
|
| 280 |
+
|:--------|:----------------------------------------------------------------------------------|:-----------------------------------------------------------------------------------|
|
| 281 |
+
| type | string | string |
|
| 282 |
+
| details | <ul><li>min: 8 tokens</li><li>mean: 26.75 tokens</li><li>max: 65 tokens</li></ul> | <ul><li>min: 7 tokens</li><li>mean: 38.71 tokens</li><li>max: 256 tokens</li></ul> |
|
| 283 |
+
* Samples:
|
| 284 |
+
| anchor | positive |
|
| 285 |
+
|:----------------------------------------------------------------------------------------------------------------------------------------------------------------------|:----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
|
| 286 |
+
| <code>Not only is there no scientific evidence that CO2 is a pollutant, higher CO2 concentrations actually help ecosystems support more plant and animal life.</code> | <code>At very high concentrations (100 times atmospheric concentration, or greater), carbon dioxide can be toxic to animal life, so raising the concentration to 10,000 ppm (1%) or higher for several hours will eliminate pests such as whiteflies and spider mites in a greenhouse.</code> |
|
| 287 |
+
| <code>Not only is there no scientific evidence that CO2 is a pollutant, higher CO2 concentrations actually help ecosystems support more plant and animal life.</code> | <code>Plants can grow as much as 50 percent faster in concentrations of 1,000 ppm CO 2 when compared with ambient conditions, though this assumes no change in climate and no limitation on other nutrients.</code> |
|
| 288 |
+
| <code>Not only is there no scientific evidence that CO2 is a pollutant, higher CO2 concentrations actually help ecosystems support more plant and animal life.</code> | <code>Higher carbon dioxide concentrations will favourably affect plant growth and demand for water.</code> |
|
| 289 |
+
* Loss: [<code>MultipleNegativesRankingLoss</code>](https://sbert.net/docs/package_reference/sentence_transformer/losses.html#multiplenegativesrankingloss) with these parameters:
|
| 290 |
+
```json
|
| 291 |
+
{
|
| 292 |
+
"scale": 20.0,
|
| 293 |
+
"similarity_fct": "cos_sim",
|
| 294 |
+
"gather_across_devices": false,
|
| 295 |
+
"directions": [
|
| 296 |
+
"query_to_doc"
|
| 297 |
+
],
|
| 298 |
+
"partition_mode": "joint",
|
| 299 |
+
"hardness_mode": null,
|
| 300 |
+
"hardness_strength": 0.0
|
| 301 |
+
}
|
| 302 |
+
```
|
| 303 |
+
|
| 304 |
+
### Training Hyperparameters
|
| 305 |
+
#### Non-Default Hyperparameters
|
| 306 |
+
|
| 307 |
+
- `per_device_train_batch_size`: 32
|
| 308 |
+
- `per_device_eval_batch_size`: 128
|
| 309 |
+
- `learning_rate`: 2e-05
|
| 310 |
+
- `weight_decay`: 0.01
|
| 311 |
+
- `warmup_steps`: 0.1
|
| 312 |
+
- `fp16`: True
|
| 313 |
+
- `load_best_model_at_end`: True
|
| 314 |
+
- `push_to_hub`: True
|
| 315 |
+
- `hub_model_id`: jmroth/nlp-biencoder-finetuned
|
| 316 |
+
- `hub_strategy`: end
|
| 317 |
+
- `batch_sampler`: no_duplicates
|
| 318 |
+
|
| 319 |
+
#### All Hyperparameters
|
| 320 |
+
<details><summary>Click to expand</summary>
|
| 321 |
+
|
| 322 |
+
- `do_predict`: False
|
| 323 |
+
- `prediction_loss_only`: True
|
| 324 |
+
- `per_device_train_batch_size`: 32
|
| 325 |
+
- `per_device_eval_batch_size`: 128
|
| 326 |
+
- `gradient_accumulation_steps`: 1
|
| 327 |
+
- `eval_accumulation_steps`: None
|
| 328 |
+
- `torch_empty_cache_steps`: None
|
| 329 |
+
- `learning_rate`: 2e-05
|
| 330 |
+
- `weight_decay`: 0.01
|
| 331 |
+
- `adam_beta1`: 0.9
|
| 332 |
+
- `adam_beta2`: 0.999
|
| 333 |
+
- `adam_epsilon`: 1e-08
|
| 334 |
+
- `max_grad_norm`: 1.0
|
| 335 |
+
- `num_train_epochs`: 3
|
| 336 |
+
- `max_steps`: -1
|
| 337 |
+
- `lr_scheduler_type`: linear
|
| 338 |
+
- `lr_scheduler_kwargs`: None
|
| 339 |
+
- `warmup_ratio`: None
|
| 340 |
+
- `warmup_steps`: 0.1
|
| 341 |
+
- `log_level`: passive
|
| 342 |
+
- `log_level_replica`: warning
|
| 343 |
+
- `log_on_each_node`: True
|
| 344 |
+
- `logging_nan_inf_filter`: True
|
| 345 |
+
- `enable_jit_checkpoint`: False
|
| 346 |
+
- `save_on_each_node`: False
|
| 347 |
+
- `save_only_model`: False
|
| 348 |
+
- `restore_callback_states_from_checkpoint`: False
|
| 349 |
+
- `use_cpu`: False
|
| 350 |
+
- `seed`: 42
|
| 351 |
+
- `data_seed`: None
|
| 352 |
+
- `bf16`: False
|
| 353 |
+
- `fp16`: True
|
| 354 |
+
- `bf16_full_eval`: False
|
| 355 |
+
- `fp16_full_eval`: False
|
| 356 |
+
- `tf32`: None
|
| 357 |
+
- `local_rank`: -1
|
| 358 |
+
- `ddp_backend`: None
|
| 359 |
+
- `debug`: []
|
| 360 |
+
- `dataloader_drop_last`: False
|
| 361 |
+
- `dataloader_num_workers`: 0
|
| 362 |
+
- `dataloader_prefetch_factor`: None
|
| 363 |
+
- `disable_tqdm`: False
|
| 364 |
+
- `remove_unused_columns`: True
|
| 365 |
+
- `label_names`: None
|
| 366 |
+
- `load_best_model_at_end`: True
|
| 367 |
+
- `ignore_data_skip`: False
|
| 368 |
+
- `fsdp`: []
|
| 369 |
+
- `fsdp_config`: {'min_num_params': 0, 'xla': False, 'xla_fsdp_v2': False, 'xla_fsdp_grad_ckpt': False}
|
| 370 |
+
- `accelerator_config`: {'split_batches': False, 'dispatch_batches': None, 'even_batches': True, 'use_seedable_sampler': True, 'non_blocking': False, 'gradient_accumulation_kwargs': None}
|
| 371 |
+
- `parallelism_config`: None
|
| 372 |
+
- `deepspeed`: None
|
| 373 |
+
- `label_smoothing_factor`: 0.0
|
| 374 |
+
- `optim`: adamw_torch_fused
|
| 375 |
+
- `optim_args`: None
|
| 376 |
+
- `group_by_length`: False
|
| 377 |
+
- `length_column_name`: length
|
| 378 |
+
- `project`: huggingface
|
| 379 |
+
- `trackio_space_id`: trackio
|
| 380 |
+
- `ddp_find_unused_parameters`: None
|
| 381 |
+
- `ddp_bucket_cap_mb`: None
|
| 382 |
+
- `ddp_broadcast_buffers`: False
|
| 383 |
+
- `dataloader_pin_memory`: True
|
| 384 |
+
- `dataloader_persistent_workers`: False
|
| 385 |
+
- `skip_memory_metrics`: True
|
| 386 |
+
- `push_to_hub`: True
|
| 387 |
+
- `resume_from_checkpoint`: None
|
| 388 |
+
- `hub_model_id`: jmroth/nlp-biencoder-finetuned
|
| 389 |
+
- `hub_strategy`: end
|
| 390 |
+
- `hub_private_repo`: None
|
| 391 |
+
- `hub_always_push`: False
|
| 392 |
+
- `hub_revision`: None
|
| 393 |
+
- `gradient_checkpointing`: False
|
| 394 |
+
- `gradient_checkpointing_kwargs`: None
|
| 395 |
+
- `include_for_metrics`: []
|
| 396 |
+
- `eval_do_concat_batches`: True
|
| 397 |
+
- `auto_find_batch_size`: False
|
| 398 |
+
- `full_determinism`: False
|
| 399 |
+
- `ddp_timeout`: 1800
|
| 400 |
+
- `torch_compile`: False
|
| 401 |
+
- `torch_compile_backend`: None
|
| 402 |
+
- `torch_compile_mode`: None
|
| 403 |
+
- `include_num_input_tokens_seen`: no
|
| 404 |
+
- `neftune_noise_alpha`: None
|
| 405 |
+
- `optim_target_modules`: None
|
| 406 |
+
- `batch_eval_metrics`: False
|
| 407 |
+
- `eval_on_start`: False
|
| 408 |
+
- `use_liger_kernel`: False
|
| 409 |
+
- `liger_kernel_config`: None
|
| 410 |
+
- `eval_use_gather_object`: False
|
| 411 |
+
- `average_tokens_across_devices`: True
|
| 412 |
+
- `use_cache`: False
|
| 413 |
+
- `prompts`: None
|
| 414 |
+
- `batch_sampler`: no_duplicates
|
| 415 |
+
- `multi_dataset_batch_sampler`: proportional
|
| 416 |
+
- `router_mapping`: {}
|
| 417 |
+
- `learning_rate_mapping`: {}
|
| 418 |
+
|
| 419 |
+
</details>
|
| 420 |
+
|
| 421 |
+
### Training Logs
|
| 422 |
+
| Epoch | Step | Training Loss | claims-dev_cosine_ndcg@10 |
|
| 423 |
+
|:----------:|:-------:|:-------------:|:-------------------------:|
|
| 424 |
+
| 0.0775 | 10 | 1.4212 | - |
|
| 425 |
+
| 0.1550 | 20 | 1.4229 | - |
|
| 426 |
+
| 0.2326 | 30 | 1.1129 | - |
|
| 427 |
+
| 0.3101 | 40 | 0.9966 | - |
|
| 428 |
+
| 0.3876 | 50 | 0.9207 | 0.2829 |
|
| 429 |
+
| 0.4651 | 60 | 0.8326 | - |
|
| 430 |
+
| 0.5426 | 70 | 0.8989 | - |
|
| 431 |
+
| 0.6202 | 80 | 0.9630 | - |
|
| 432 |
+
| 0.6977 | 90 | 0.8394 | - |
|
| 433 |
+
| 0.7752 | 100 | 0.8764 | 0.2893 |
|
| 434 |
+
| 0.8527 | 110 | 0.8208 | - |
|
| 435 |
+
| 0.9302 | 120 | 0.7684 | - |
|
| 436 |
+
| 1.0078 | 130 | 0.7049 | - |
|
| 437 |
+
| 1.0853 | 140 | 0.7378 | - |
|
| 438 |
+
| 1.1628 | 150 | 0.6265 | 0.2941 |
|
| 439 |
+
| 1.2403 | 160 | 0.6832 | - |
|
| 440 |
+
| 1.3178 | 170 | 0.6365 | - |
|
| 441 |
+
| 1.3953 | 180 | 0.5991 | - |
|
| 442 |
+
| 1.4729 | 190 | 0.5456 | - |
|
| 443 |
+
| **1.5504** | **200** | **0.6355** | **0.2943** |
|
| 444 |
+
| 1.6279 | 210 | 0.5927 | - |
|
| 445 |
+
| 1.7054 | 220 | 0.7117 | - |
|
| 446 |
+
| 1.7829 | 230 | 0.5096 | - |
|
| 447 |
+
| 1.8605 | 240 | 0.6036 | - |
|
| 448 |
+
| 1.9380 | 250 | 0.6768 | 0.2896 |
|
| 449 |
+
| 2.0155 | 260 | 0.6589 | - |
|
| 450 |
+
| 2.0930 | 270 | 0.5436 | - |
|
| 451 |
+
| 2.1705 | 280 | 0.5173 | - |
|
| 452 |
+
| 2.2481 | 290 | 0.5544 | - |
|
| 453 |
+
| 2.3256 | 300 | 0.5583 | 0.2911 |
|
| 454 |
+
| 2.4031 | 310 | 0.5903 | - |
|
| 455 |
+
| 2.4806 | 320 | 0.5265 | - |
|
| 456 |
+
| 2.5581 | 330 | 0.5107 | - |
|
| 457 |
+
| 2.6357 | 340 | 0.6144 | - |
|
| 458 |
+
| 2.7132 | 350 | 0.5175 | 0.2932 |
|
| 459 |
+
| 2.7907 | 360 | 0.5805 | - |
|
| 460 |
+
| 2.8682 | 370 | 0.5299 | - |
|
| 461 |
+
| 2.9457 | 380 | 0.5621 | - |
|
| 462 |
+
|
| 463 |
+
* The bold row denotes the saved checkpoint.
|
| 464 |
+
|
| 465 |
+
### Training Time
|
| 466 |
+
- **Training**: 32.6 minutes
|
| 467 |
+
|
| 468 |
+
### Framework Versions
|
| 469 |
+
- Python: 3.12.13
|
| 470 |
+
- Sentence Transformers: 5.4.1
|
| 471 |
+
- Transformers: 5.0.0
|
| 472 |
+
- PyTorch: 2.10.0+cu128
|
| 473 |
+
- Accelerate: 1.13.0
|
| 474 |
+
- Datasets: 4.0.0
|
| 475 |
+
- Tokenizers: 0.22.2
|
| 476 |
+
|
| 477 |
+
## Citation
|
| 478 |
+
|
| 479 |
+
### BibTeX
|
| 480 |
+
|
| 481 |
+
#### Sentence Transformers
|
| 482 |
+
```bibtex
|
| 483 |
+
@inproceedings{reimers-2019-sentence-bert,
|
| 484 |
+
title = "Sentence-BERT: Sentence Embeddings using Siamese BERT-Networks",
|
| 485 |
+
author = "Reimers, Nils and Gurevych, Iryna",
|
| 486 |
+
booktitle = "Proceedings of the 2019 Conference on Empirical Methods in Natural Language Processing",
|
| 487 |
+
month = "11",
|
| 488 |
+
year = "2019",
|
| 489 |
+
publisher = "Association for Computational Linguistics",
|
| 490 |
+
url = "https://arxiv.org/abs/1908.10084",
|
| 491 |
+
}
|
| 492 |
+
```
|
| 493 |
+
|
| 494 |
+
#### MultipleNegativesRankingLoss
|
| 495 |
+
```bibtex
|
| 496 |
+
@misc{oord2019representationlearningcontrastivepredictive,
|
| 497 |
+
title={Representation Learning with Contrastive Predictive Coding},
|
| 498 |
+
author={Aaron van den Oord and Yazhe Li and Oriol Vinyals},
|
| 499 |
+
year={2019},
|
| 500 |
+
eprint={1807.03748},
|
| 501 |
+
archivePrefix={arXiv},
|
| 502 |
+
primaryClass={cs.LG},
|
| 503 |
+
url={https://arxiv.org/abs/1807.03748},
|
| 504 |
+
}
|
| 505 |
+
```
|
| 506 |
+
|
| 507 |
+
<!--
|
| 508 |
+
## Glossary
|
| 509 |
+
|
| 510 |
+
*Clearly define terms in order to be accessible across audiences.*
|
| 511 |
+
-->
|
| 512 |
+
|
| 513 |
+
<!--
|
| 514 |
+
## Model Card Authors
|
| 515 |
+
|
| 516 |
+
*Lists the people who create the model card, providing recognition and accountability for the detailed work that goes into its construction.*
|
| 517 |
+
-->
|
| 518 |
+
|
| 519 |
+
<!--
|
| 520 |
+
## Model Card Contact
|
| 521 |
+
|
| 522 |
+
*Provides a way for people who have updates to the Model Card, suggestions, or questions, to contact the Model Card authors.*
|
| 523 |
+
-->
|
config.json
ADDED
|
@@ -0,0 +1,30 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"add_cross_attention": false,
|
| 3 |
+
"architectures": [
|
| 4 |
+
"BertModel"
|
| 5 |
+
],
|
| 6 |
+
"attention_probs_dropout_prob": 0.1,
|
| 7 |
+
"bos_token_id": null,
|
| 8 |
+
"classifier_dropout": null,
|
| 9 |
+
"dtype": "float32",
|
| 10 |
+
"eos_token_id": null,
|
| 11 |
+
"gradient_checkpointing": false,
|
| 12 |
+
"hidden_act": "gelu",
|
| 13 |
+
"hidden_dropout_prob": 0.1,
|
| 14 |
+
"hidden_size": 384,
|
| 15 |
+
"initializer_range": 0.02,
|
| 16 |
+
"intermediate_size": 1536,
|
| 17 |
+
"is_decoder": false,
|
| 18 |
+
"layer_norm_eps": 1e-12,
|
| 19 |
+
"max_position_embeddings": 512,
|
| 20 |
+
"model_type": "bert",
|
| 21 |
+
"num_attention_heads": 12,
|
| 22 |
+
"num_hidden_layers": 6,
|
| 23 |
+
"pad_token_id": 0,
|
| 24 |
+
"position_embedding_type": "absolute",
|
| 25 |
+
"tie_word_embeddings": true,
|
| 26 |
+
"transformers_version": "5.0.0",
|
| 27 |
+
"type_vocab_size": 2,
|
| 28 |
+
"use_cache": true,
|
| 29 |
+
"vocab_size": 30522
|
| 30 |
+
}
|
config_sentence_transformers.json
ADDED
|
@@ -0,0 +1,14 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"__version__": {
|
| 3 |
+
"pytorch": "2.10.0+cu128",
|
| 4 |
+
"sentence_transformers": "5.4.1",
|
| 5 |
+
"transformers": "5.0.0"
|
| 6 |
+
},
|
| 7 |
+
"default_prompt_name": null,
|
| 8 |
+
"model_type": "SentenceTransformer",
|
| 9 |
+
"prompts": {
|
| 10 |
+
"document": "",
|
| 11 |
+
"query": ""
|
| 12 |
+
},
|
| 13 |
+
"similarity_fn_name": "cosine"
|
| 14 |
+
}
|
model.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:298040f67ce76b454d35d3da23791f7f7637c68573d7ffba0a17472a37e72984
|
| 3 |
+
size 90864176
|
modules.json
ADDED
|
@@ -0,0 +1,20 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
[
|
| 2 |
+
{
|
| 3 |
+
"idx": 0,
|
| 4 |
+
"name": "0",
|
| 5 |
+
"path": "",
|
| 6 |
+
"type": "sentence_transformers.base.modules.transformer.Transformer"
|
| 7 |
+
},
|
| 8 |
+
{
|
| 9 |
+
"idx": 1,
|
| 10 |
+
"name": "1",
|
| 11 |
+
"path": "1_Pooling",
|
| 12 |
+
"type": "sentence_transformers.sentence_transformer.modules.pooling.Pooling"
|
| 13 |
+
},
|
| 14 |
+
{
|
| 15 |
+
"idx": 2,
|
| 16 |
+
"name": "2",
|
| 17 |
+
"path": "2_Normalize",
|
| 18 |
+
"type": "sentence_transformers.sentence_transformer.modules.normalize.Normalize"
|
| 19 |
+
}
|
| 20 |
+
]
|
sentence_bert_config.json
ADDED
|
@@ -0,0 +1,10 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"transformer_task": "feature-extraction",
|
| 3 |
+
"modality_config": {
|
| 4 |
+
"text": {
|
| 5 |
+
"method": "forward",
|
| 6 |
+
"method_output_name": "last_hidden_state"
|
| 7 |
+
}
|
| 8 |
+
},
|
| 9 |
+
"module_output_name": "token_embeddings"
|
| 10 |
+
}
|
tokenizer.json
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|
tokenizer_config.json
ADDED
|
@@ -0,0 +1,16 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"backend": "tokenizers",
|
| 3 |
+
"cls_token": "[CLS]",
|
| 4 |
+
"do_basic_tokenize": true,
|
| 5 |
+
"do_lower_case": true,
|
| 6 |
+
"is_local": false,
|
| 7 |
+
"mask_token": "[MASK]",
|
| 8 |
+
"model_max_length": 256,
|
| 9 |
+
"never_split": null,
|
| 10 |
+
"pad_token": "[PAD]",
|
| 11 |
+
"sep_token": "[SEP]",
|
| 12 |
+
"strip_accents": null,
|
| 13 |
+
"tokenize_chinese_chars": true,
|
| 14 |
+
"tokenizer_class": "BertTokenizer",
|
| 15 |
+
"unk_token": "[UNK]"
|
| 16 |
+
}
|