Sentence Similarity
sentence-transformers
TensorBoard
Safetensors
mpnet
feature-extraction
Generated from Trainer
dataset_size:32351
loss:TripletLoss
Eval Results (legacy)
text-embeddings-inference
Instructions to use hmm404/tmp_trainer with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- sentence-transformers
How to use hmm404/tmp_trainer with sentence-transformers:
from sentence_transformers import SentenceTransformer model = SentenceTransformer("hmm404/tmp_trainer") sentences = [ "Genetic conditions that cause nutritional deficiencies can prevent a person from removing meat from their diet.", "Ante un estado que no quiere hablar del tema, para Cataluña, solo es posible seguir su propio camino por otras vías.", "Retinol deficiency is a genetically pre-disposed condition that prevents conversion beta-carotene to Vitamin A \\(retinol\\) in humans. Since plants have no retinol \\(only beta-carotene\\), humans with this condition cannot have a vegan diet, only one with animal products.", "People with hemochromatosis \\(a genetic condition\\) can benefit greatly from a vegan diet, due to the lower absorbing non-heme iron in plants \\(compared to heme iron in meat\\)." ] embeddings = model.encode(sentences) similarities = model.similarity(embeddings, embeddings) print(similarities.shape) # [4, 4] - Notebooks
- Google Colab
- Kaggle
End of training
Browse files
README.md
CHANGED
|
@@ -4,52 +4,62 @@ tags:
|
|
| 4 |
- sentence-similarity
|
| 5 |
- feature-extraction
|
| 6 |
- generated_from_trainer
|
| 7 |
-
- dataset_size:
|
| 8 |
- loss:TripletLoss
|
| 9 |
base_model: sentence-transformers/all-mpnet-base-v2
|
| 10 |
widget:
|
| 11 |
-
- source_sentence:
|
| 12 |
-
|
| 13 |
sentences:
|
| 14 |
-
-
|
| 15 |
-
|
| 16 |
-
-
|
| 17 |
-
|
| 18 |
-
|
| 19 |
-
with
|
| 20 |
-
-
|
| 21 |
-
|
| 22 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 23 |
sentences:
|
| 24 |
-
-
|
| 25 |
-
|
| 26 |
-
-
|
| 27 |
-
|
| 28 |
-
|
| 29 |
-
|
| 30 |
-
|
| 31 |
-
|
| 32 |
-
|
|
|
|
| 33 |
sentences:
|
| 34 |
-
-
|
| 35 |
-
-
|
| 36 |
-
-
|
| 37 |
-
|
| 38 |
-
- source_sentence:
|
|
|
|
| 39 |
sentences:
|
| 40 |
-
-
|
| 41 |
-
|
| 42 |
-
-
|
| 43 |
-
|
| 44 |
-
-
|
| 45 |
-
|
| 46 |
-
- source_sentence: The
|
| 47 |
-
|
| 48 |
sentences:
|
| 49 |
-
-
|
| 50 |
-
|
| 51 |
-
-
|
| 52 |
-
|
|
|
|
|
|
|
| 53 |
pipeline_tag: sentence-similarity
|
| 54 |
library_name: sentence-transformers
|
| 55 |
---
|
|
@@ -104,9 +114,9 @@ from sentence_transformers import SentenceTransformer
|
|
| 104 |
model = SentenceTransformer("sentence_transformers_model_id")
|
| 105 |
# Run inference
|
| 106 |
sentences = [
|
| 107 |
-
'The
|
| 108 |
-
'
|
| 109 |
-
'
|
| 110 |
]
|
| 111 |
embeddings = model.encode(sentences)
|
| 112 |
print(embeddings.shape)
|
|
@@ -160,24 +170,24 @@ You can finetune this model on your own dataset.
|
|
| 160 |
|
| 161 |
#### Unnamed Dataset
|
| 162 |
|
| 163 |
-
* Size:
|
| 164 |
* Columns: <code>anchor</code>, <code>positive</code>, and <code>negative</code>
|
| 165 |
* Approximate statistics based on the first 1000 samples:
|
| 166 |
-
| | anchor
|
| 167 |
-
|:--------|:----------------------------------------------------------------------------------|:----------------------------------------------------------------------------------
|
| 168 |
-
| type | string
|
| 169 |
-
| details | <ul><li>min:
|
| 170 |
* Samples:
|
| 171 |
-
| anchor
|
| 172 |
-
|:----------------------------------------------------------------------------------------------------
|
| 173 |
-
| <code>
|
| 174 |
-
| <code>
|
| 175 |
-
| <code>
|
| 176 |
* Loss: [<code>TripletLoss</code>](https://sbert.net/docs/package_reference/sentence_transformer/losses.html#tripletloss) with these parameters:
|
| 177 |
```json
|
| 178 |
{
|
| 179 |
"distance_metric": "TripletDistanceMetric.COSINE",
|
| 180 |
-
"triplet_margin": 0.
|
| 181 |
}
|
| 182 |
```
|
| 183 |
|
|
@@ -305,29 +315,13 @@ You can finetune this model on your own dataset.
|
|
| 305 |
</details>
|
| 306 |
|
| 307 |
### Training Logs
|
| 308 |
-
| Epoch | Step
|
| 309 |
-
|:------:|:----
|
| 310 |
-
| 0.
|
| 311 |
-
| 0.
|
| 312 |
-
| 0.
|
| 313 |
-
| 0.
|
| 314 |
-
| 0.
|
| 315 |
-
| 0.8242 | 3000 | 0.3168 |
|
| 316 |
-
| 0.9615 | 3500 | 0.3003 |
|
| 317 |
-
| 1.0989 | 4000 | 0.263 |
|
| 318 |
-
| 1.2363 | 4500 | 0.2516 |
|
| 319 |
-
| 1.3736 | 5000 | 0.2326 |
|
| 320 |
-
| 1.5110 | 5500 | 0.2405 |
|
| 321 |
-
| 1.6484 | 6000 | 0.2339 |
|
| 322 |
-
| 1.7857 | 6500 | 0.2316 |
|
| 323 |
-
| 1.9231 | 7000 | 0.2302 |
|
| 324 |
-
| 2.0604 | 7500 | 0.1848 |
|
| 325 |
-
| 2.1978 | 8000 | 0.149 |
|
| 326 |
-
| 2.3352 | 8500 | 0.1573 |
|
| 327 |
-
| 2.4725 | 9000 | 0.1528 |
|
| 328 |
-
| 2.6099 | 9500 | 0.1617 |
|
| 329 |
-
| 2.7473 | 10000 | 0.1466 |
|
| 330 |
-
| 2.8846 | 10500 | 0.1459 |
|
| 331 |
|
| 332 |
|
| 333 |
### Framework Versions
|
|
@@ -336,7 +330,7 @@ You can finetune this model on your own dataset.
|
|
| 336 |
- Transformers: 4.48.3
|
| 337 |
- PyTorch: 2.5.1+cu124
|
| 338 |
- Accelerate: 1.3.0
|
| 339 |
-
- Datasets: 3.3.
|
| 340 |
- Tokenizers: 0.21.0
|
| 341 |
|
| 342 |
## Citation
|
|
|
|
| 4 |
- sentence-similarity
|
| 5 |
- feature-extraction
|
| 6 |
- generated_from_trainer
|
| 7 |
+
- dataset_size:32351
|
| 8 |
- loss:TripletLoss
|
| 9 |
base_model: sentence-transformers/all-mpnet-base-v2
|
| 10 |
widget:
|
| 11 |
+
- source_sentence: Genetic conditions that cause nutritional deficiencies can prevent
|
| 12 |
+
a person from removing meat from their diet.
|
| 13 |
sentences:
|
| 14 |
+
- Ante un estado que no quiere hablar del tema, para Cataluña, solo es posible seguir
|
| 15 |
+
su propio camino por otras vías.
|
| 16 |
+
- Retinol deficiency is a genetically pre-disposed condition that prevents conversion
|
| 17 |
+
beta-carotene to Vitamin A \(retinol\) in humans. Since plants have no retinol
|
| 18 |
+
\(only beta-carotene\), humans with this condition cannot have a vegan diet, only
|
| 19 |
+
one with animal products.
|
| 20 |
+
- People with hemochromatosis \(a genetic condition\) can benefit greatly from a
|
| 21 |
+
vegan diet, due to the lower absorbing non-heme iron in plants \(compared to heme
|
| 22 |
+
iron in meat\).
|
| 23 |
+
- source_sentence: 'The definition of veganism is: "A way of living which seeks to
|
| 24 |
+
exclude, as far as is possible and practicable, all forms of exploitation of,
|
| 25 |
+
and cruelty to, animals for food, clothing or any other purpose." In the \(unlikely\)
|
| 26 |
+
case of survival or health concerns, the "as far as possible and practicable"
|
| 27 |
+
clause makes it possible for such persons to be considered vegan as they would
|
| 28 |
+
have no alternative options.'
|
| 29 |
sentences:
|
| 30 |
+
- Veganism is not solely about diet. A person can still choose to live in accordance
|
| 31 |
+
with vegan values, such as by avoiding animal circuses and leather/fur products.
|
| 32 |
+
- It's easier to regulate established companies in a legal market than it is in
|
| 33 |
+
the black market. Any issue would be with bad regulations not legalization.
|
| 34 |
+
- That definition is too vague. There are different definitions of veganism, many
|
| 35 |
+
of which are not compatible with using animals in any circumstances. In a way
|
| 36 |
+
we are all vegan depending on how easy you believe it is to reach all the necessary
|
| 37 |
+
nutrition in your city harming as few animals as possible.
|
| 38 |
+
- source_sentence: Adding coding to the school curriculum means that something else
|
| 39 |
+
must be left out.
|
| 40 |
sentences:
|
| 41 |
+
- Coding skills are much needed in today's job market.
|
| 42 |
+
- Cataluña saldría de la UE con efectos económicos desastrosos.
|
| 43 |
+
- Teaching coding effectively is impossible unless teachers are trained appropriately
|
| 44 |
+
first.
|
| 45 |
+
- source_sentence: Animals have innate, individual rights, which are taken away when
|
| 46 |
+
they are killed or made to suffer.
|
| 47 |
sentences:
|
| 48 |
+
- Animals have a desire to live.
|
| 49 |
+
- Uno de los ejemplos más claros es la falta de inversión reiterada al Corredor
|
| 50 |
+
Mediterráneo \(Algeciras-Valencia-Barcelona-Francia\), prioritario para la UE
|
| 51 |
+
y Catalunya, pero relegado a algo residual por el estado Español.
|
| 52 |
+
- A vegan society would equate humans rights with animal rights, which would make
|
| 53 |
+
society worse off overall.
|
| 54 |
+
- source_sentence: The sorts of people likely to lash out against affirmative action
|
| 55 |
+
policies probably already hold negative views towards racial minorities.
|
| 56 |
sentences:
|
| 57 |
+
- The Far Right movement sees the inequality affirmative action addresses not as
|
| 58 |
+
a problem to be solved, but as an outcome to be desired.
|
| 59 |
+
- There are plenty of people who hold a positive view towards racial minorities
|
| 60 |
+
and still oppose affirmative action.
|
| 61 |
+
- Research has shown that college degrees have less economic utility for people
|
| 62 |
+
from low socio-economic backgrounds.
|
| 63 |
pipeline_tag: sentence-similarity
|
| 64 |
library_name: sentence-transformers
|
| 65 |
---
|
|
|
|
| 114 |
model = SentenceTransformer("sentence_transformers_model_id")
|
| 115 |
# Run inference
|
| 116 |
sentences = [
|
| 117 |
+
'The sorts of people likely to lash out against affirmative action policies probably already hold negative views towards racial minorities.',
|
| 118 |
+
'The Far Right movement sees the inequality affirmative action addresses not as a problem to be solved, but as an outcome to be desired.',
|
| 119 |
+
'There are plenty of people who hold a positive view towards racial minorities and still oppose affirmative action.',
|
| 120 |
]
|
| 121 |
embeddings = model.encode(sentences)
|
| 122 |
print(embeddings.shape)
|
|
|
|
| 170 |
|
| 171 |
#### Unnamed Dataset
|
| 172 |
|
| 173 |
+
* Size: 32,351 training samples
|
| 174 |
* Columns: <code>anchor</code>, <code>positive</code>, and <code>negative</code>
|
| 175 |
* Approximate statistics based on the first 1000 samples:
|
| 176 |
+
| | anchor | positive | negative |
|
| 177 |
+
|:--------|:-----------------------------------------------------------------------------------|:----------------------------------------------------------------------------------|:-----------------------------------------------------------------------------------|
|
| 178 |
+
| type | string | string | string |
|
| 179 |
+
| details | <ul><li>min: 6 tokens</li><li>mean: 30.94 tokens</li><li>max: 160 tokens</li></ul> | <ul><li>min: 6 tokens</li><li>mean: 40.8 tokens</li><li>max: 180 tokens</li></ul> | <ul><li>min: 6 tokens</li><li>mean: 44.95 tokens</li><li>max: 162 tokens</li></ul> |
|
| 180 |
* Samples:
|
| 181 |
+
| anchor | positive | negative |
|
| 182 |
+
|:----------------------------------------------------------------------------------------------------|:-------------------------------------------------------------------------------------------------------------------------|:----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
|
| 183 |
+
| <code>La soberanía y la decisión sobre la unidad de España residen en el conjunto de España.</code> | <code>Apostar por un proceso de secesión es ir en contra de la globalización, la corriente histórica que vivimos.</code> | <code>Los tratados internacionales \(incluido el Tratado de La Unión Europea\) no serían aplicables a Cataluña como estado independiente, por lo que su permanencia en Europa podría verse interrumpida.</code> |
|
| 184 |
+
| <code>La soberanía y la decisión sobre la unidad de España residen en el conjunto de España.</code> | <code>Para sentar un precedente en conflictos de autodeterminación en el mundo.</code> | <code>La independencia de Cataluña afectaría negativamente a la economía de España.</code> |
|
| 185 |
+
| <code>La soberanía y la decisión sobre la unidad de España residen en el conjunto de España.</code> | <code>Para terminar con el trato injusto que recibe Cataluña al ser parte de España.</code> | <code>Por definición, cualquier nacionalismo es malo ya que crea divisiones artificiales y es fuente de conflictos.</code> |
|
| 186 |
* Loss: [<code>TripletLoss</code>](https://sbert.net/docs/package_reference/sentence_transformer/losses.html#tripletloss) with these parameters:
|
| 187 |
```json
|
| 188 |
{
|
| 189 |
"distance_metric": "TripletDistanceMetric.COSINE",
|
| 190 |
+
"triplet_margin": 0.3
|
| 191 |
}
|
| 192 |
```
|
| 193 |
|
|
|
|
| 315 |
</details>
|
| 316 |
|
| 317 |
### Training Logs
|
| 318 |
+
| Epoch | Step | Training Loss |
|
| 319 |
+
|:------:|:----:|:-------------:|
|
| 320 |
+
| 0.1236 | 500 | 0.2178 |
|
| 321 |
+
| 0.2473 | 1000 | 0.1997 |
|
| 322 |
+
| 0.3709 | 1500 | 0.1829 |
|
| 323 |
+
| 0.4946 | 2000 | 0.1716 |
|
| 324 |
+
| 0.6182 | 2500 | 0.1586 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 325 |
|
| 326 |
|
| 327 |
### Framework Versions
|
|
|
|
| 330 |
- Transformers: 4.48.3
|
| 331 |
- PyTorch: 2.5.1+cu124
|
| 332 |
- Accelerate: 1.3.0
|
| 333 |
+
- Datasets: 3.3.2
|
| 334 |
- Tokenizers: 0.21.0
|
| 335 |
|
| 336 |
## Citation
|
model.safetensors
CHANGED
|
@@ -1,3 +1,3 @@
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
-
oid sha256:
|
| 3 |
size 437967672
|
|
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:e790d84a0238f01bdb90713950fd89cd11f509b60431a2890ab0e8a5a5b8400d
|
| 3 |
size 437967672
|
runs/Feb20_20-41-49_11b1a2b4f9ae/events.out.tfevents.1740084114.11b1a2b4f9ae.1333.0
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:8f54e1ba5bca8021379d7c6b9e58d22e26c71895fd403cd13157286e8fcc86cb
|
| 3 |
+
size 5430
|
training_args.bin
CHANGED
|
@@ -1,3 +1,3 @@
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
-
oid sha256:
|
| 3 |
size 5560
|
|
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:c9f972e0b8a2ea0dbf7d2679605e8174627db0bc9a9f15736036d98b3f1b03f5
|
| 3 |
size 5560
|