Downloads · 30 days
43
3% of all-time downloads
APauli/Persuasive_language_in_pairs
Persuasive_language_in_pairs is a sentence similarity model from APauli. Use it when you need a score for how close two texts are. It is set up for transformers. The card lists the license as cc-by-nc-4.0.
More info about training, evaluation, and use in paper is here: https://arxiv.org/abs/2406.17753
Downloads · 30 days
43
3% of all-time downloads
All-time downloads
1.3K
Public
Parameters
435M
1.7 GB on disk
Likes
3
Public
Click a slice to open those files.
.safetensors1.7 GB · 99%
From the Hugging Face model README
More info about training, evaluation, and use in paper is here: https://arxiv.org/abs/2406.17753
Python:
from transformers import AutoModelForSequenceClassification,AutoTokenizer
import torch
modelname='APauli/Persuasive_language_in_pairs'
model = AutoModelForSequenceClassification.from_pretrained(modelname)
tokenizer = AutoTokenizer.from_pretrained(modelname)
def predict(textA, textB, model,tokenizer):
encoded_input = tokenizer(textA, textB, padding=True, truncation=True,max_length=256, return_tensors="pt")
with torch.no_grad():
logits = model(**encoded_input).logits
score1=logits.detach().cpu().numpy()
#flipped
encoded_input = tokenizer(textB, textA, padding=True, truncation=True,max_length=256, return_tensors="pt")
with torch.no_grad():
logits = model(**encoded_input).logits
score2=logits.detach().cpu().numpy()*(-1)
score = (score1+score2)/2
return score
If you find our dataset helpful, kindly refer to us in your work using the following citation:
@misc{pauli2024measuringbenchmarkinglargelanguage,
title={Measuring and Benchmarking Large Language Models' Capabilities to Generate Persuasive Language},
author={Amalie Brogaard Pauli and Isabelle Augenstein and Ira Assent},
year={2024},
eprint={2406.17753},
archivePrefix={arXiv},
primaryClass={cs.CL},
url={https://arxiv.org/abs/2406.17753},
}