🚀 StyleDistance 風格嵌入模型
StyleDistance 是一個 風格嵌入模型,旨在將具有相似寫作風格的文本緊密嵌入,而將不同風格的文本嵌入得相距較遠,且不受內容影響。該模型可用於文本的風格分析、聚類、作者身份識別與驗證任務,以及自動風格遷移評估。
🚀 快速開始
本倉庫包含在 StyleDistance: Stronger Content-Independent Style Embeddings with Synthetic Parallel Examples 中介紹的模型。
✨ 主要特性
StyleDistance 是一種風格嵌入模型,能夠將具有相似寫作風格的文本緊密嵌入,而將不同風格的文本嵌入得相距較遠,不受內容的影響。該模型可用於文本的風格分析、聚類、作者身份識別和驗證任務,以及自動風格遷移評估。
📦 安裝指南
暫未提供安裝步驟相關內容。
💻 使用示例
基礎用法
from sentence_transformers import SentenceTransformer
from sentence_transformers.util import cos_sim
model = SentenceTransformer('StyleDistance/styledistance') # Load model
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))
📚 詳細文檔
模型信息
屬性 |
詳情 |
基礎模型 |
FacebookAI/roberta-base |
數據集 |
SynthSTEL/styledistance_training_triplets、StyleDistance/synthstel |
語言 |
en |
庫名稱 |
sentence-transformers |
許可證 |
mit |
任務類型 |
句子相似度 |
標籤 |
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?
訓練數據和變體
StyleDistance 在 SynthSTEL 上進行了對比訓練,這是一個合成生成的數據集,包含 40 種風格特徵在文本中使用的正例和反例。通過利用這個合成數據集,StyleDistance 比目前其他風格嵌入模型能夠實現更強的內容獨立性。這個特定的模型是使用合成數據集和 [一個利用 Reddit 上的作者身份數據集來訓練風格嵌入的真實數據集](https://aclanthology.org/2022.repl4nlp - 1.26/) 組合訓練的。如需僅使用合成數據訓練的版本,請查看 StyleDistance 的另一個版本。
🔧 技術細節
暫未提供技術細節相關內容。
📄 許可證
本模型使用 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 或美國政府的官方政策,無論是明示還是暗示。美國政府有權為政府目的複製和分發重印本,無論其中的版權聲明如何。