You need to agree to share your contact information to access this model
This repository is publicly accessible, but you have to accept the conditions to access its files and content.
Our models are intended for academic use only. If you are not affiliated with an academic institution, please provide a rationale for using our models. Please allow us a few business days to manually review subscriptions.
If you use our models for your work or research, please cite this paper: Sebők, M., Máté, Á., Ring, O., Kovács, V., & Lehoczki, R. (2024). Leveraging Open Large Language Models for Multilingual Policy Topic Classification: The Babel Machine Approach. Social Science Computer Review, 0(0). https://doi.org/10.1177/08944393241259434
Log in or Sign Up to review the conditions and access this model content.
xlm-roberta-large-pooled-cap-v3
Model description
An xlm-roberta-large benchmark model finetuned on training data containing texts labelled with major topic codes from the Comparative Agendas Project.
Classification Report
Overall Performance:
- Accuracy: 82.1%
- Macro Avg: Precision: 0.80, Recall: 0.80, F1-score: 0.80
- Weighted Avg: Precision: 0.82, Recall: 0.82, F1-score: 0.82
Per-Class Metrics:
| Label | Precision | Recall | F1-score | Support |
|---|---|---|---|---|
| (1) Macroeconomics | 0.74 | 0.78 | 0.76 | 34,802 |
| (2) Civil Rights | 0.74 | 0.64 | 0.68 | 14,687 |
| (3) Health | 0.85 | 0.88 | 0.86 | 27,158 |
| (4) Agriculture | 0.82 | 0.85 | 0.83 | 15,708 |
| (5) Labor | 0.77 | 0.74 | 0.76 | 18,803 |
| (6) Education | 0.85 | 0.90 | 0.87 | 23,547 |
| (7) Environment | 0.82 | 0.81 | 0.81 | 14,474 |
| (8) Energy | 0.87 | 0.80 | 0.83 | 11,549 |
| (9) Immigration | 0.78 | 0.77 | 0.77 | 8,310 |
| (10) Transportation | 0.88 | 0.81 | 0.84 | 22,611 |
| (12) Law and Crime | 0.80 | 0.83 | 0.81 | 36,014 |
| (13) Social Welfare | 0.80 | 0.77 | 0.78 | 17,322 |
| (14) Housing | 0.77 | 0.76 | 0.77 | 11,784 |
| (15) Banking, Finance, and Domestic Commerce | 0.79 | 0.77 | 0.78 | 25,184 |
| (16) Defense | 0.83 | 0.80 | 0.81 | 24,929 |
| (17) Technology | 0.82 | 0.81 | 0.82 | 12,578 |
| (18) Foreign Trade | 0.79 | 0.77 | 0.78 | 10,066 |
| (19) International Affairs | 0.76 | 0.78 | 0.77 | 33,759 |
| (20) Government Operations | 0.79 | 0.79 | 0.79 | 57,340 |
| (21) Public Lands | 0.79 | 0.83 | 0.81 | 18,803 |
| (23) Culture | 0.72 | 0.81 | 0.76 | 11,569 |
| (999) No Policy Content | 0.94 | 0.94 | 0.94 | 87,862 |
Gated access
Due to the gated access, you must pass the token parameter when loading the model. In earlier versions of the Transformers package, you may need to use the use_auth_token parameter instead.
How to use the model
from transformers import AutoTokenizer, pipeline
tokenizer = AutoTokenizer.from_pretrained("xlm-roberta-large")
pipe = pipeline(
model="poltextlab/xlm-roberta-large-pooled-cap-v3",
task="text-classification",
tokenizer=tokenizer,
use_fast=False,
token="<your_hf_read_only_token>"
)
text = "We will place an immediate 6-month halt on the finance driven closure of beds and wards, and set up an independent audit of needs and facilities."
pipe(text)
Inference platform
This model is used by the CAP Babel Machine, an open-source and free natural language processing tool, designed to simplify and speed up projects for comparative research.
Debugging and issues
This architecture uses the sentencepiece tokenizer. In order to run the model before transformers==4.27 you need to install it manually.
If you encounter a RuntimeError when loading the model using the from_pretrained() method, adding ignore_mismatched_sizes=True should solve the issue.
- Downloads last month
- 1,297
Collection including poltextlab/xlm-roberta-large-pooled-cap-v3
Evaluation results
- Accuracyself-reported82%
- F1-Scoreself-reported82%