StyleDistance/mstyledistance
63k
1---2base_model: FacebookAI/xlm-roberta-base3datasets:4- StyleDistance/mstyledistance_training_triplets5library_name: sentence-transformers6pipeline_tag: feature-extraction7license: mit8tags:9- datadreamer10- datadreamer-0.35.011- synthetic12- sentence-transformers13- feature-extraction14- sentence-similarity15widget:16- example_title: Example 117 source_sentence: 彼は技術的な複雑さと格闘し、彼の作品は驚くべき視覚的緊張を生み出した。18 sentences:19 - Serviste mariscos frescos en el condado de Middlesex y áreas circundantes.20 - Él sirvió mariscos frescos en el condado de Middlesex y áreas circundantes.21- example_title: Example 222 source_sentence: Bien sûr, ils termineront la construction du pont en une semaine.23 sentences:24 - Oh, you mean when I single-handedly tackled that bespoke headboard project?25 - Remember when I completed that bespoke headboard project on my own?26- example_title: Example 327 source_sentence: 我将使用有限的色调和小尺寸进行像素艺术的简化和风格化设计。28 sentences:29 - Я ценю ТТ-пистолет за его огневую мощь; его проникающая способность впечатляет30 меня.31 - 你将使用有限的色调和小尺寸进行像素艺术的简化和风格化设计。32---33 34# Model Card35 36This repository contains the model introduced in [mStyleDistance: Multilingual Style Embeddings and their Evaluation](https://hf.co/papers/2502.15168).37 38mStyleDistance is a **multilingual style embedding model** that aims to embed texts with similar writing styles closely and different styles far apart, regardless of content and regardless of language. You may find this model useful for stylistic analysis of multilingual text, clustering, authorship identfication and verification tasks, and automatic style transfer evaluation. The model is described in the paper [StyleDistance/mstyledistance](https://hf.co/papers/2502.15168).39 40This model is an multilingual version of the English-only [StyleDistance](https://huggingface.co/StyleDistance/styledistance) model.41 42## Training Data and Variants of StyleDistance43 44mStyleDistance was contrastively trained on [mSynthSTEL](https://huggingface.co/datasets/StyleDistance/msynthstel), a synthetically generated dataset of positive and negative examples of ~40 style features being used in text in 9 non-English languages. By utilizing this synthetic dataset, mStyleDistance is able to achieve stronger content-independence than other style embedding models currently available and is able to operate on multilingual text.45 46## Example Usage47 48```python349from sentence_transformers import SentenceTransformer50from sentence_transformers.util import cos_sim51 52model = SentenceTransformer('StyleDistance/mstyledistance') # Load model53 54input = model.encode("ÉL TIENE PROBLEMAS PARA LOGRAR LA TEMPERATURA ADECUADA PARA COCINAR LA GALLINA CORNISH.")55others = model.encode(["TOCARÁS LA GUITARRA CON TU AMIGO; SERÁ UNA EXCELENTE OPORTUNIDAD PARA MEJORAR TUS HABILIDADES MUSICALES.", "Él tiene problemas para lograr la temperatura adecuada para cocinar la gallina Cornish."])56print(cos_sim(input, others))57```58 59---60## Citation61 62```latex63@misc{qiu2025mstyledistancemultilingualstyleembeddings,64 title={mStyleDistance: Multilingual Style Embeddings and their Evaluation}, 65 author={Justin Qiu and Jiacheng Zhu and Ajay Patel and Marianna Apidianaki and Chris Callison-Burch},66 year={2025},67 eprint={2502.15168},68 archivePrefix={arXiv},69 primaryClass={cs.CL},70 url={https://arxiv.org/abs/2502.15168}, 71}72```73 74---75## Trained with DataDreamer76 77This model was trained with a synthetic dataset with [DataDreamer 🤖💤](https://datadreamer.dev). The synthetic dataset card and model card can be found [here](datadreamer.json). The training arguments can be found [here](training_args.json).78 79---80#### Funding Acknowledgements81 82<small> This research is supported in part by the Office of the Director of National Intelligence (ODNI), Intelligence Advanced Research Projects Activity (IARPA), via the HIATUS Program contract #2022-22072200005. The views and conclusions contained herein are those of the authors and should not be interpreted as necessarily representing the official policies, either expressed or implied, of ODNI, IARPA, or the U.S. Government. The U.S. Government is authorized to reproduce and distribute reprints for governmental purposes notwithstanding any copyright annotation therein. </small>