Views
No views yet
including references to both political figures, policies, elections, news events (e.g., impeachment inquiry, the primaries) as well as issues such as climate change, immigration, healthcare, gun control, sexual assault, racial, gender, sexual, ethnic, and religious minorities, the regulation of large tech companies, and crimes involving guns.
| F1(political) | F1(other) |
|---|---|
| 0.889 | 0.907 |
1from transformers import pipeline
2
3classifier = pipeline("text-classification", "sztal/erc-newsuse-political")1political_texts = [
2 'Greene recently chased Ocasio-Cortez down a hallway as the two left the House chamber, shouted at her, and accused her of supporting terrorists.',
3 'The ex-president will make his first big speech since leaving the White House at the conference.',
4 'Employers continue to fight to retain workers amid a tight labor market and growing Omicron coronavirus variant concerns.'
5]
6
7classifier(political_texts)
8# [{'label': 'POLITICAL', 'score': 0.9945843815803528},
9# {'label': 'POLITICAL', 'score': 0.9939272403717041},
10# {'label': 'POLITICAL', 'score': 0.9750990271568298}]1other_texts = [
2 'A dental surgery student has turned heads for her viral video claiming that she and other dentists known when women are pregnant by the state of their teeth and gums.',
3 '"I was right at her door, about to leave. And for some reason, she just asked me to stay." Resident of collapsed Florida building says he\'s alive only because girlfriend persuaded him to stay with her',
4 'I am destroyed. I do not feel good," Hamilton said after finishing third in Sunday\'s Abu Dhabi Grand Prix.',
5]
6
7classifier(other_texts)
8# [{'label': 'OTHER', 'score': 0.8563344478607178},
9# {'label': 'OTHER', 'score': 0.9842121005058289},
10# {'label': 'OTHER', 'score': 0.9840729832649231}]1# Here is a borderline text that gets classified as 'POLITICAL', but with low certainty
2borderline_text = "As the race for three casino licenses in the New York City region kicks off in earnest this year, developers have launched charm offensives to gain public support. Here are their proposals and the most likely casino sites."
3classifier(borderline_text)
4# [{'label': 'POLITICAL', 'score': 0.5392860174179077}]