Views
No views yet
1from transformers import pipeline
2
3classifier = pipeline("text-classification", model="mattdr/cross-domain-frame-classifier")
4
5text = "The new policy will cost taxpayers millions of dollars while providing few benefits."
6result = classifier(text)
7print(result)
8# [{'label': 'Economic', 'score': 0.89}]
9
10examples = [
11 "The economy of the country is improving steadily.",
12 "The public strongly supports this initiative according to recent polls.",
13 "We must protect our children from these dangerous substances."
14]
15
16for text in examples:
17 result = classifier(text)
18 print(f"Text: {text}")
19 print(f"Frame: {result[0]['label']} (confidence: {result[0]['score']:.2f})")
20 print()1@misc{guida2025retainreframecomputationalframework,
2 title={Retain or Reframe? A Computational Framework for the Analysis of Framing in News Articles and Reader Comments},
3 author={Matteo Guida and Yulia Otmakhova and Eduard Hovy and Lea Frermann},
4 year={2025},
5 eprint={2507.04612},
6 archivePrefix={arXiv},
7 primaryClass={cs.CL},
8 url={https://arxiv.org/abs/2507.04612},
9}
10