Downloads · 30 days
102
29% of all-time downloads
jacobmorrier/political-answer-quality
political-answer-quality is a sentence similarity model from jacobmorrier. Use it when you need a score for how close two texts are. It is set up for sentence-transformers. The card lists the license as mit.
This Sentence-BERT model maps sentences and paragraphs to a 768-dimensional dense vector space. It was fine-tuned for semantic search using the multi-qa-mpnet-base-cos-v1 model as a base on 2,917 question-answer pairs…
Downloads · 30 days
102
29% of all-time downloads
All-time downloads
349
Public
Parameters
109M
438 MB on disk
Likes
0
Public
Click a slice to open those files.
.safetensors438 MB · 100%
From the Hugging Face model README
This Sentence-BERT model maps sentences and paragraphs to a 768-dimensional dense vector space. It was fine-tuned for semantic search using the multi-qa-mpnet-base-cos-v1 model as a base on 2,917 question-answer pairs observed during the Question Period in the Canadian House of Commons from the 39<sup>th</sup> to the 43<sup>rd</sup> legislatures. The model can be used to evaluate the quality of responses in political Q&A sessions, including parliamentary questions.
multi-qa-mpnet-base-cos-v1The model identifies the most relevant answer to a question and evaluates the quality of responses in political Q&A sessions.
Our article discusses the model’s biases, risks, and limitations, along with its application in evaluating the quality of responses in political Q&A settings. In particular, we emphasize the need for caution when applying the model outside the original context of the Question Period, due to potential domain drift.
Inference with this model is straightforward using the sentence-transformers library. You can use the following code to compute the cosine similarity between questions and answers:
from sentence_transformers import SentenceTransformer, util
model = SentenceTransformer('jacobmorrier/political-answer-quality')
questions_emb = model.encode(questions)
answers_emb = model.encode(answers)
cos_sim = util.cos_sim(questions_emb, answers_emb).cpu()
The training data consists of 2,917 question-answer pairs from the Question Period in the Canadian House of Commons collected between the 39<sup>th</sup> and 43<sup>rd</sup> legislatures, spanning fifteen years from the January 23, 2006, election to the September 20, 2021, election.
| Parameter | Value |
|---|---|
| Loss Function | Multiple Negatives Ranking Loss (with questions as anchors) |
| Epochs | 10 |
| Batch Size | 8 |
| Optimizer | AdamW |
| Learning Rate | 2e-5 |
| Learning Rate Scheduler | Warm-up Linear |
| Warm-up Steps | 10,000 |
| Weight Decay | 0.01 |
| Maximum Gradient Norm | 1 |
Alvarez, R. Michael and Jacob Morrier (2025). Measuring the Quality of Answers in Political Q&As with Large Language Models. https://doi.org/10.48550/arXiv.2404.08816