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.
Log in or Sign Up to review the conditions and access this model content.
xlm-roberta-large-pooled-cap-media2-v2
Model description
An xlm-roberta-large
model finetuned on english training data labelled with
major topic codes from the Comparative Agendas Project.
Furthermore we used the following 18 media codes:
- State and Local Government Administration (24)
- Weather (25)
- Fires, emergencies and natural disasters (26)
- Crime and trials (27)
- Arts, culture, entertainment and history (28)
- Style and fashion (29)
- Food (30)
- Travel (31)
- Wellbeing and learning (32)
- Personal finance and real estate (33)
- Personal technology and popular science (34)
- Churches and Religion (35)
- Celebrities and human interest (36)
- Obituaries and death notices (37)
- Sports (38)
- Crosswords, puzzles, comics (39)
- Media production/internal, letters (40)
- Advertisements (41)
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-media2-v2",
task="text-classification",
tokenizer=tokenizer,
token="<your_hf_read_only_token>"
)
text = "Tapenade, when combined with chopped tomatoes and basil, makes for one of the best simple summer dishes in existence."
pipe(text)
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.
Model performance
The model was evaluated on a test set of 67,681 english examples.
- Accuracy: 0.8.
- Precision: 0.8.
- Recall: 0.8
- Weighted Average F1-score: 0.8
Label | precision | recall | f1-score | support |
---|---|---|---|---|
Macroeconomics (1) | 0.72 | 0.73 | 0.72 | 2471 |
Civil Rights (2) | 0.7 | 0.68 | 0.69 | 1886 |
Health (3) | 0.82 | 0.83 | 0.83 | 2471 |
Agriculture (4) | 0.77 | 0.78 | 0.77 | 811 |
Labor (5) | 0.74 | 0.7 | 0.72 | 1277 |
Education (6) | 0.86 | 0.88 | 0.87 | 2080 |
Environment (7) | 0.77 | 0.8 | 0.78 | 1283 |
Energy (8) | 0.8 | 0.83 | 0.81 | 1370 |
Immigration (9) | 0.73 | 0.79 | 0.76 | 514 |
Transportation (10) | 0.81 | 0.81 | 0.81 | 2375 |
Law and Crime (12) | 0.71 | 0.69 | 0.7 | 2471 |
Social Welfare (13) | 0.66 | 0.67 | 0.67 | 683 |
Housing (14) | 0.72 | 0.72 | 0.72 | 1023 |
Banking, Finance, and Domestic Commerce (15) | 0.72 | 0.69 | 0.71 | 2471 |
Defense (16) | 0.76 | 0.78 | 0.77 | 2471 |
Technology (17) | 0.73 | 0.75 | 0.74 | 1375 |
Foreign Trade (18) | 0.7 | 0.66 | 0.68 | 533 |
International Affairs (19) | 0.69 | 0.67 | 0.68 | 2471 |
Government Operations (20) | 0.72 | 0.66 | 0.69 | 2507 |
Public Lands (21) | 0.64 | 0.66 | 0.65 | 554 |
Culture (23) | 0.74 | 0.76 | 0.75 | 2142 |
State and Local Government Administration (24) | 0.6 | 0.67 | 0.63 | 81 |
Weather (25) | 0.8 | 0.72 | 0.76 | 39 |
Fires, emergencies and natural disasters (26) | 0.96 | 0.97 | 0.97 | 2471 |
Crime and trials (27) | 0.69 | 0.88 | 0.78 | 293 |
Arts, culture, entertainment and history (28) | 0.78 | 0.77 | 0.77 | 2265 |
Style and fashion (29) | 0.81 | 0.69 | 0.74 | 2389 |
Food (30) | 0.79 | 0.84 | 0.81 | 2168 |
Travel (31) | 0.8 | 0.87 | 0.83 | 1999 |
Wellbeing and learning (32) | 0.75 | 0.78 | 0.77 | 1963 |
Personal finance and real estate (33) | 0.86 | 0.85 | 0.86 | 2222 |
Personal technology and popular science (34) | 0.81 | 0.81 | 0.81 | 2054 |
Churches and Religion (35) | 0.7 | 0.62 | 0.66 | 74 |
Celebrities and human interest (36) | 0.69 | 0.75 | 0.72 | 1109 |
Obituaries and death notices (37) | 0.74 | 0.86 | 0.79 | 521 |
Sports (38) | 0.92 | 0.92 | 0.92 | 2220 |
Crosswords, puzzles, comics (39) | 0 | 0 | 0 | 7 |
Media production/internal, letters (40) | 0.91 | 0.92 | 0.91 | 763 |
Advertisements (41) | 1 | 0.99 | 0.99 | 7333 |
No Policy and No Media Content (998) | 0.83 | 0.78 | 0.8 | 2471 |
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.
Cooperation
Model performance can be significantly improved by extending our training sets. We appreciate every submission of CAP-coded corpora (of any domain and language) at poltextlab{at}poltextlab{dot}com or by using the CAP Babel Machine.
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
- 2,928
Model tree for poltextlab/xlm-roberta-large-pooled-cap-media2-v2
Base model
FacebookAI/xlm-roberta-largeSpace using poltextlab/xlm-roberta-large-pooled-cap-media2-v2 1
Collection including poltextlab/xlm-roberta-large-pooled-cap-media2-v2
Evaluation results
- Accuracy on media2_v2_25_05_21_test_ads_api.csvself-reported80.000
- F1-Score on media2_v2_25_05_21_test_ads_api.csvself-reported80.000