Sentence Similarity
sentence-transformers
Safetensors
English
roberta
datadreamer
datadreamer-0.35.0
Synthetic
feature-extraction
text-embeddings-inference
Instructions to use StyleDistance/styledistance_synthetic_only with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- sentence-transformers
How to use StyleDistance/styledistance_synthetic_only with sentence-transformers:
from sentence_transformers import SentenceTransformer model = SentenceTransformer("StyleDistance/styledistance_synthetic_only") sentences = [ "Did you hear about the Wales wing? He'll h8 2 withdraw due 2 injuries from future competitions.", "We're raising funds 2 improve our school's storage facilities and add new playground equipment!", "Did you hear about the Wales wing? He'll hate to withdraw due to injuries from future competitions." ] embeddings = model.encode(sentences) similarities = model.similarity(embeddings, embeddings) print(similarities.shape) # [3, 3] - Notebooks
- Google Colab
- Kaggle
Update README.md
Browse files1234456785 unmodified lines14151616171718192019202122212223242526272425282930312728293233343536313738394033344142434445464748495051523853545556575859601 unmodified line62636446656648496768697071---base_model: FacebookAI/roberta-basedatasets:- SynthSTEL/styledistance_training_triplets_v2- SynthSTEL/styledistance_training_triplets- StyleDistance/synthstellibrary_name: sentence-transformerspipeline_tag: sentence-similaritytags:5 unmodified lines- sentence-similaritywidget:- example_title: Example 1 source_sentence: "The Harley School will thrive\uD83D\uDE00; so many future leaders\uD83C\ \uDF93 will emerge from its doors\uD83D\uDEAA." source_sentence: >- Did you hear about the Wales wing? He'll h8 2 withdraw due 2 injuries from future competitions. sentences: - "To avoid extra attorney fees\uD83D\uDCB0, they kept the entity's minutes updated⏱️;\ \ it proved a wise decision\uD83D\uDC4D." - To avoid extra attorney fees, they kept the entity's minutes updated; it proved a wise decision. - >- We're raising funds 2 improve our school's storage facilities and add new playground equipment! - >- Did you hear about the Wales wing? He'll hate to withdraw due to injuries from future competitions.- example_title: Example 2 source_sentence: In Segovia, I will shoulder the duty of raising suckling pigs; their care will be my responsibility too. source_sentence: >- You planned the DesignMeets Decades of Design event; you executed it perfectly. sentences: - Despite facing routine criticism, I continue to support the display of religious texts in public buildings. - I'll raise suckling pigs in Segovia; I'll care for them as well. - We'll find it hard to prove the thief didn't face a real threat! - >- You orchestrated the DesignMeets Decades of Design gathering; you actualized it flawlessly.- example_title: Example 3 source_sentence: You'll play Far Cry 2 on Xbox; I prefer Far Cry 3 on PlayStation. source_sentence: >- Did the William Barr maintain a commitment to allow Robert Mueller to finish the inquiry? sentences: - I endured significant challenges when my partner was in prison. - They'll play Far Cry 2 on Xbox; they prefer Far Cry 3 on PlayStation. - >- Will the artist be compiling a music album, or will there be a different focus in the future? - >- Did William Barr maintain commitment to allow Robert Mueller to finish inquiry?license: mitlanguage:- en---# Model Card
[Add more information here](https://huggingface.co/templates/model-card-example)StyleDistance is a **style embedding model** that aims to embed texts with similar writing styles closely and different styles far apart, regardless of content. You may find this model useful for stylistic analysis of text, clustering, authorship identfication and verification tasks, and automatic style transfer evaluation.
## Training Data and Variants of StyleDistance
StyleDistance was contrastively trained on [SynthSTEL](https://huggingface.co/datasets/StyleDistance/synthstel), a synthetically generated dataset of positive and negative examples of 40 style features being used in text. By utilizing this synthetic dataset, StyleDistance is able to achieve stronger content-independence than other style embeddding models currently available. This particular model was purely trained on synthetic data. For a version that is trained using a combination of the synthetic dataset and a [real dataset that makes use of authorship datasets from Reddit to train style embeddings](https://aclanthology.org/2022.repl4nlp-1.26/), see this other version of [StyleDistance](https://huggingface.co/StyleDistance/styledistance).
## Example Usage
1 unmodified linefrom sentence_transformers import SentenceTransformerfrom sentence_transformers.util import cos_sim
model = SentenceTransformer('SynthSTEL/styledistance_synthetic_only_full_v2') # Load modelmodel = SentenceTransformer('SynthSTEL/styledistance_synth_only') # Load model
input = model.encode('The Harley School will thrive😀; so many future leaders🎓 will emerge from its doors🚪.')others = model.encode(["To avoid extra attorney fees💰, they kept the entity's minutes updated⏱️; it proved a wise decision👍.", "To avoid extra attorney fees, they kept the entity's minutes updated; it proved a wise decision."])input = model.encode("Did you hear about the Wales wing? He'll h8 2 withdraw due 2 injuries from future competitions.")others = model.encode(["We're raising funds 2 improve our school's storage facilities and add new playground equipment!", "Did you hear about the Wales wing? He'll hate to withdraw due to injuries from future competitions."])print(cos_sim(input, others))```
README.md+38-19