Views
No views yet
FacebookAI/xlm-roberta-large para a tarefa de Detecção de Notícias Falsas (Fake News) em português brasileiro, treinado no dataset HenriqueLz/fakerecogna2-extrativa-elections.0.9905| ID | Label | Descrição |
|---|---|---|
0 | VERDADEIRA | Notícia factual / verdadeira |
1 | FALSA | Notícia falsa / desinformação |
pipeline:1from transformers import pipeline
2
3classifier = pipeline(
4 "text-classification",
5 model="HenriqueLz/xlm-roberta-large-fakerecogna2-extrativa-elections",
6 tokenizer="HenriqueLz/xlm-roberta-large-fakerecogna2-extrativa-elections",
7)
8
9texto = "Ministério da Saúde divulga calendário oficial de vacinação para o próximo ano."
10resultado = classifier(texto)
11print(resultado)
12# Output: [{'label': 'VERDADEIRA', 'score': 0.99...}]1import torch
2from transformers import AutoTokenizer, AutoModelForSequenceClassification
3
4tokenizer = AutoTokenizer.from_pretrained("HenriqueLz/xlm-roberta-large-fakerecogna2-extrativa-elections")
5model = AutoModelForSequenceClassification.from_pretrained("HenriqueLz/xlm-roberta-large-fakerecogna2-extrativa-elections")
6
7texto = "Texto da notícia para classificação..."
8inputs = tokenizer(texto, return_tensors="pt", truncation=True, max_length=512)
9
10with torch.no_grad():
11 logits = model(**inputs).logits
12
13predicted_class_id = logits.argmax().item()
14label = model.config.id2label[predicted_class_id]
15print(f"Classe predita: {label}")HenriqueLz/fakerecogna2-extrativa-elections (split temporal com data de corte em 30/10/2021).1e-5 com otimizador AdamW e decaimento de peso (weight decay) de 0.01.DataCollatorWithPadding).1@inproceedings{garcia-etal-2024-text,
2 title = "Text Summarization and Temporal Learning Models Applied to {P}ortuguese Fake News Detection in a Novel {B}razilian Corpus Dataset",
3 author = "Garcia, Gabriel Lino and Paiola, Pedro Henrique and Jodas, Danilo Samuel and Sugi, Luis Afonso and Papa, Jo{\~a}o Paulo",
4 booktitle = "Proceedings of the 16th International Conference on Computational Processing of Portuguese - Vol. 1",
5 month = mar,
6 year = "2024",
7 address = "Santiago de Compostela, Galicia/Spain",
8 publisher = "Association for Computational Lingustics",
9 url = "https://aclanthology.org/2024.propor-1.9/",
10 pages = "86--96"
11}1@inproceedings{conneau-etal-2020-unsupervised,
2 title = "Unsupervised Cross-lingual Representation Learning at Scale",
3 author = "Conneau, Alexis and Khandelwal, Kartikay and Goyal, Naman and Chaudhary, Vishrav and Wenzek, Guillaume and Guzm{'a}n, Francisco and Grave, Edouard and Ott, Myle and Zettlemoyer, Luke and Stoyanov, Veselin",
4 booktitle = "Proceedings of the 58th Annual Meeting of the Association for Computational Linguistics",
5 month = jul,
6 year = "2020",
7 address = "Online",
8 publisher = "Association for Computational Linguistics",
9 url = "https://aclanthology.org/2020.acl-main.747/",
10 doi = "10.18653/v1/2020.acl-main.747",
11 pages = "8440--8451"
12}