tcepi/prog_integridade_dataset
Viewer • Updated • 5.34k • 59
How to use tcepi/prog_integridade_model with Transformers:
# Use a pipeline as a high-level helper
from transformers import pipeline
pipe = pipeline("text-classification", model="tcepi/prog_integridade_model") # Load model directly
from transformers import AutoTokenizer, AutoModelForSequenceClassification
tokenizer = AutoTokenizer.from_pretrained("tcepi/prog_integridade_model")
model = AutoModelForSequenceClassification.from_pretrained("tcepi/prog_integridade_model")Este modelo é um fine-tune do ModernBERT-base para classificação binária, treinado no dataset tcepi/prog_integridade_dataset.
| Métrica | Valor |
|---|---|
| Accuracy | 0.9944 |
| F1-Score | 0.9944 |
| Precision | 0.9944 |
| Recall | 0.9944 |
| ROC-AUC | 0.9984 |
| Specificity | 0.9905 |
| Predito Negativo | Predito Positivo | |
|---|---|---|
| Real Negativo | 522 (TN) | 5 (FP) |
| Real Positivo | 1 (FN) | 541 (TP) |
precision recall f1-score support
Negativo 0.9981 0.9905 0.9943 527
Positivo 0.9908 0.9982 0.9945 542
accuracy 0.9944 1069
macro avg 0.9945 0.9943 0.9944 1069
weighted avg 0.9944 0.9944 0.9944 1069
from transformers import AutoTokenizer, AutoModelForSequenceClassification
import torch
# Carregar modelo e tokenizer
tokenizer = AutoTokenizer.from_pretrained("tcepi/prog_integridade_model")
model = AutoModelForSequenceClassification.from_pretrained("tcepi/prog_integridade_model")
# Classificar texto
text = "Seu texto aqui"
inputs = tokenizer(text, return_tensors="pt", truncation=True, max_length=8192)
with torch.no_grad():
outputs = model(**inputs)
predictions = torch.softmax(outputs.logits, dim=-1)
predicted_class = torch.argmax(predictions, dim=-1).item()
print(f"Classe predita: {model.config.id2label[predicted_class]}")
print(f"Probabilidades: {predictions.tolist()}")
| epoch | eval_loss | eval_accuracy | eval_f1 | eval_roc_auc | eval_specificity |
|---|---|---|---|---|---|
| 1 | 0.188758 | 0.946262 | 0.946277 | 0.997855 | 0.985294 |
| 2 | 0.0218751 | 0.990654 | 0.990654 | 0.999912 | 0.990196 |
| 3 | 0.0222455 | 0.992991 | 0.992993 | 0.999869 | 1 |
| 4 | 0.0971301 | 0.983645 | 0.983653 | 0.999934 | 1 |
| 5 | 0.0337453 | 0.990654 | 0.990649 | 1 | 0.980392 |
| 6 | 0.0275761 | 0.997664 | 0.997664 | 0.999956 | 1 |
| 7 | 0.0167756 | 0.997664 | 0.997664 | 1 | 1 |
| 8 | 0.0292979 | 0.997664 | 0.997664 | 0.999912 | 1 |
| 9 | 0.0309485 | 0.997664 | 0.997664 | 0.999912 | 1 |
| 10 | 0.0248101 | 0.997664 | 0.997664 | 0.999956 | 1 |
O modelo foi treinado usando o dataset tcepi/prog_integridade_dataset.
Base model
answerdotai/ModernBERT-base