Views
No views yet
1from transformers import pipeline
2
3texts = [
4 'Afghanistan - Warum die Taliban Frauenrechte immer mehr einschränken\nhttps://t.co/rhwOdNoJUx',
5 '#Münster #G7 oder "Ab jetzt außen rumfahren". https://t.co/Goj5vtrnst',
6 'Interessantes Trio.\nDie eine hat eine Wahl vergeigt, die andere kungelt mit Putin und die Dritte hat die Hilfe nach der Flutkatastrophe nicht auf die Reihe bekommen. \nMehr Frauen an die Macht!',
7 'Wie kann man sich #AnneWill betrachten ohne das übertragende Gerät zu zerschmettern. Eben 20 sec. dem #FDP Watschengesicht beim Quaken zugehört. Du lieber Himmel, wie weltfremd geht´s denn noch.'
8 ]
9checkpoint = "Sami92/XLM-R-Large-Polarization-Classifier"
10tokenizer_kwargs = {'padding':True,'truncation':True,'max_length':512}
11polarization_classifier = pipeline("text-classification", model = checkpoint, tokenizer =checkpoint, **tokenizer_kwargs, device="cuda")
12polarization_classifier(texts)| Category | Precision | Recall | F1-Score | Support |
|---|---|---|---|---|
| non-polarization | 0.89 | 0.89 | 0.89 | 1350 |
| polarization | 0.67 | 0.67 | 0.67 | 463 |
| Accuracy | 0.83 | 1813 | ||
| Macro avg | 0.78 | 0.78 | 0.78 | 1813 |
| Weighted avg | 0.83 | 0.83 | 0.83 | 1813 |
1
2@inproceedings{ashraf_defakts_2024,
3 address = {Torino, Italia},
4 title = {{DeFaktS}: {A} {German} {Dataset} for {Fine}-{Grained} {Disinformation} {Detection} through {Social} {Media} {Framing}},
5 shorttitle = {{DeFaktS}},
6 url = {https://aclanthology.org/2024.lrec-main.409},
7 booktitle = {Proceedings of the 2024 {Joint} {International} {Conference} on {Computational} {Linguistics}, {Language} {Resources} and {Evaluation} ({LREC}-{COLING} 2024)},
8 publisher = {ELRA and ICCL},
9 author = {Ashraf, Shaina and Bezzaoui, Isabel and Andone, Ionut and Markowetz, Alexander and Fegert, Jonas and Flek, Lucie},
10 editor = {Calzolari, Nicoletta and Kan, Min-Yen and Hoste, Veronique and Lenci, Alessandro and Sakti, Sakriani and Xue, Nianwen},
11 year = {2024},
12}