🚀 StyleDistanceモデル
StyleDistanceは、文章の内容に関係なく、類似した書き方の文章を近くに、異なるスタイルの文章を遠くに埋め込むことを目的としたスタイル埋め込みモデルです。このモデルは、文章の文体分析、クラスタリング、著者識別と検証タスク、および自動スタイル変換評価に役立つ可能性があります。
🚀 クイックスタート
このリポジトリには、StyleDistance: Stronger Content-Independent Style Embeddings with Synthetic Parallel Examplesで紹介されたモデルが含まれています。
✨ 主な機能
StyleDistanceは、文章のスタイルを内容とは独立して捉えることができるため、文体分析、クラスタリング、著者識別、自動スタイル変換評価などのタスクに役立ちます。
📦 インストール
このモデルはsentence-transformers
ライブラリを使用しています。以下のコマンドでインストールできます。
pip install sentence-transformers
💻 使用例
基本的な使用法
from sentence_transformers import SentenceTransformer
from sentence_transformers.util import cos_sim
model = SentenceTransformer('StyleDistance/styledistance') # モデルの読み込み
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))
📚 ドキュメント
学習データとStyleDistanceのバリエーション
StyleDistanceは、SynthSTELという合成生成されたデータセットで対照的に学習されました。このデータセットは、文章における40のスタイル特徴の正例と負例を含んでいます。この合成データセットを利用することで、StyleDistanceは現在利用可能な他のスタイル埋め込みモデルよりも強力な内容独立性を達成することができます。この特定のモデルは、合成データセットと、Redditの著者データセットを利用した実データセットの組み合わせで学習されています。純粋に合成データで学習されたバージョンについては、StyleDistanceの別のバージョンを参照してください。
モデルの詳細情報
プロパティ |
詳細 |
ベースモデル |
FacebookAI/roberta-base |
データセット |
- SynthSTEL/styledistance_training_triplets - StyleDistance/synthstel |
言語 |
en |
ライブラリ名 |
sentence-transformers |
ライセンス |
mit |
パイプラインタグ |
sentence-similarity |
タグ |
- datadreamer - datadreamer-0.35.0 - synthetic - sentence-transformers - feature-extraction - sentence-similarity |
ウィジェットの例
- 例1
- ソース文章: 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.
- 例2
- ソース文章: You planned the DesignMeets Decades of Design event; you executed it perfectly.
- 比較文章:
- 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.
- 例3
- ソース文章: Did the William Barr maintain a commitment to allow Robert Mueller to finish the inquiry?
- 比較文章:
- 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?
📄 ライセンス
このモデルはMITライセンスの下で公開されています。
🔖 引用
@misc{patel2025styledistancestrongercontentindependentstyle,
title={StyleDistance: Stronger Content-Independent Style Embeddings with Synthetic Parallel Examples},
author={Ajay Patel and Jiacheng Zhu and Justin Qiu and Zachary Horvitz and Marianna Apidianaki and Kathleen McKeown and Chris Callison-Burch},
year={2025},
eprint={2410.12757},
archivePrefix={arXiv},
primaryClass={cs.CL},
url={https://arxiv.org/abs/2410.12757},
}
💰 資金提供の謝辞
この研究は、国家情報局長室(ODNI)、知能先端研究プロジェクト局(IARPA)によるHIATUSプログラム契約 #2022 - 22072200005の一部として支援されています。本稿に含まれる見解や結論は著者のものであり、必ずしもODNI、IARPA、または米国政府の公式政策を代表するものと解釈されるべきではありません。米国政府は、著作権表示に関係なく、政府目的での転載を行うことが許可されています。