Views
No views yet
sagui-nlp/debertinha-ptbr-xsmall para a tarefa de Detecção de Notícias Falsas (Fake News) em português brasileiro, treinado no dataset HenriqueLz/fakerecogna2-extrativa-elections.0.9877| 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/debertinha-ptbr-xsmall-fakerecogna2-extrativa-elections",
6 tokenizer="HenriqueLz/debertinha-ptbr-xsmall-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/debertinha-ptbr-xsmall-fakerecogna2-extrativa-elections")
5model = AutoModelForSequenceClassification.from_pretrained("HenriqueLz/debertinha-ptbr-xsmall-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@misc{campiotti2023debertinha,
2 title={DeBERTinha: A Multistep Approach to Adapt DebertaV3 XSmall for Brazilian Portuguese Natural Language Processing Task},
3 author={Israel Campiotti and Matheus Rodrigues and Yuri Albuquerque and Rafael Azevedo and Alyson Andrade},
4 year={2023},
5 eprint={2309.16844},
6 archivePrefix={arXiv},
7 primaryClass={cs.CL}
8}