Downloads · 30 days
3.8K
0% of all-time downloads
AIDA-UPM/star
star is a feature extraction model from AIDA-UPM. Use it when you need embeddings to search or compare text. It is set up for transformers.
This is the repository for the Style Transformer for Authorship Representations (STAR) model. We present the weights of our model here.
Downloads · 30 days
3.8K
0% of all-time downloads
All-time downloads
1.4M
Public
Repo size
2.8 GB
Likes
7
Public
Click a slice to open those files.
.bin1.4 GB · 100%
From the Hugging Face model README
This is the repository for the Style Transformer for Authorship Representations (STAR) model. We present the weights of our model here.
Also check out our github repo for STAR for replication.
tokenizer = AutoTokenizer.from_pretrained('roberta-large')
model = AutoModel.from_pretrained('AIDA-UPM/star')
examples = ['My text 1', 'This is another text']
def extract_embeddings(texts):
encoded_texts = tokenizer(texts)
with torch.no_grad():
style_embeddings = model(encoded_texts.input_ids,
attention_mask=encoded_texts.attention_mask).pooler_output
return style_embeddings
print(extract_embeddings(examples))
@article{Huertas-Tato2023Oct,
author = {Huertas-Tato, Javier and Martin, Alejandro and Camacho, David},
title = {{Understanding writing style in social media with a supervised contrastively pre-trained transformer}},
journal = {arXiv},
year = {2023},
month = oct,
eprint = {2310.11081},
doi = {10.48550/arXiv.2310.11081}
}