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 files12345675 unmodified lines13141516171819202122232425262728293031323334353637383940411 unmodified line43444546474849505152---base_model: FacebookAI/roberta-basedatasets:- SynthSTEL/styledistance_training_triplets_v2library_name: sentence-transformerspipeline_tag: sentence-similaritytags:5 unmodified lines- sentence-similaritywidget:- example_title: Example 1source_sentence: "The Harley School will thrive\uD83D\uDE00; so many future leaders\uD83C\\uDF93 will emerge from its doors\uD83D\uDEAA."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 proveda wise decision.- example_title: Example 2source_sentence: In Segovia, I will shoulder the duty of raising suckling pigs;their care will be my responsibility too.sentences:- Despite facing routine criticism, I continue to support the display of religioustexts in public buildings.- I'll raise suckling pigs in Segovia; I'll care for them as well.- example_title: Example 3source_sentence: You'll play Far Cry 2 on Xbox; I prefer Far Cry 3 on PlayStation.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.---# Model Card[Add more information here](https://huggingface.co/templates/model-card-example)## Example Usage1 unmodified linefrom sentence_transformers import SentenceTransformerfrom sentence_transformers.util import cos_simmodel = SentenceTransformer('SynthSTEL/styledistance_synthetic_only_full_v2') # Load modelinput = 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."])print(cos_sim(input, others))```123456785 unmodified lines14151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859601 unmodified line62636465666768697071---base_model: FacebookAI/roberta-basedatasets:- SynthSTEL/styledistance_training_triplets- StyleDistance/synthstellibrary_name: sentence-transformerspipeline_tag: sentence-similaritytags:5 unmodified lines- sentence-similaritywidget:- example_title: Example 1source_sentence: >-Did you hear about the Wales wing? He'll h8 2 withdraw due 2 injuries fromfuture competitions.sentences:- >-We're raising funds 2 improve our school's storage facilities and add newplayground equipment!- >-Did you hear about the Wales wing? He'll hate to withdraw due to injuriesfrom future competitions.- example_title: Example 2source_sentence: >-You planned the DesignMeets Decades of Design event; you executed itperfectly.sentences:- We'll find it hard to prove the thief didn't face a real threat!- >-You orchestrated the DesignMeets Decades of Design gathering; you actualizedit flawlessly.- example_title: Example 3source_sentence: >-Did the William Barr maintain a commitment to allow Robert Mueller to finishthe inquiry?sentences:- >-Will the artist be compiling a music album, or will there be a differentfocus in the future?- >-Did William Barr maintain commitment to allow Robert Mueller to finishinquiry?license: mitlanguage:- en---# Model CardStyleDistance 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 StyleDistanceStyleDistance 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 Usage1 unmodified linefrom sentence_transformers import SentenceTransformerfrom sentence_transformers.util import cos_simmodel = SentenceTransformer('SynthSTEL/styledistance_synth_only') # Load modelinput = 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