Blablablab/multilingual-style-representation-Llama-3.2
1
Multilingual Style Representation based on meta-llama/Llama-3.2-1B
This is the Style Representation model, presented in `Leveraging Multilingual Training for Authorship Representation: Enhancing Generalization across Languages and Domains`.
The Style Representation model encodes documents written by the same author as nearby vectors in the embedding space. The model can be used for authorship attribution, style similarity, machine-generated text detection, and more.
For training and evaluation code, refer to our repository here.
For the Style Representation model based on XLM-RoBERTa, refer to Blablablab/multilingual-style-representation.
Model Details
- Model Type: Sentence Transformer
- Base model: meta-llama/Llama-3.2-1B <!-- at revision 4e20de362430cd3b72f300e6b0f18e50e7166e08 -->
- Maximum Sequence Length: 131072 tokens
- Output Dimensionality: 2048 dimensions
- Similarity Function: Cosine Similarity
Usage
First install the Sentence Transformers library:
pip install -U sentence-transformersThen you can load this model and run inference.
from sentence_transformers import SentenceTransformer
# Download from the 🤗 Hub
model = SentenceTransformer("Blablablab/multilingual-style-representation-Llama-3.2")
# Run inference
sentences = [
'The weather is lovely today.',
"It's so sunny outside!",
'He drove to the stadium.',
]
embeddings = model.encode(sentences)
print(embeddings.shape)
# [3, 2048]
# Get the similarity scores for the embeddings
similarities = model.similarity(embeddings, embeddings)
print(similarities.shape)
# [3, 3]<!--
Citation
-->
