CoolFace
Modelpublic

Detecting-ai/pt-ai-detector

sourceHugging Facecc-by-nc-4.0updated 1y agoView on Hugging Face
3likes199downloads
Model Card

πŸ‡§πŸ‡· pt-ai-detector

pt-ai-detector is a BERT-base model fine-tuned to decide whether a Portuguese sentence or paragraph was written by a human (label = 0) or generated by AI (label = 1).

MetricValue
Train data1 000 000 human + 1 000 000 AI
Balanced test set1 954 190 (Β½ human, Β½ AI)
Accuracyβ‰ˆ 99 %
F1 (macro)β‰ˆ 0.99
Model size434 M parameters (β‰ˆ 430 MB)

πŸ“– Quick usage

Try it live at detecting-ai.com – our team at Detecting-ai built this model and demo so you can instantly test any Portuguese text online.

python
from transformers import pipeline

clf = pipeline(
    "text-classification",
    model="Detecting-ai/pt-ai-detector",
    tokenizer="Detecting-ai/pt-ai-detector",
    device=0  # set -1 for CPU
)

text = "A inteligΓͺncia artificial estΓ‘ transformando a educaΓ§Γ£o."
print(clf(text))        # β†’ [{'label': 'AI', 'score': 0.987}]
idlabel
0Human
1AI

πŸ‹οΈβ€β™‚οΈ Training details

  • β€”Base model: neuralmind/bert-base-portuguese-cased
  • β€”Epochs: 3 (fp16 on 1 Γ— A100)
  • β€”Batch size: 32
  • β€”Optimizer/LR: AdamW 2 Γ— 10⁻⁡
  • β€”Loss: Cross-entropy

Data sources

CorpusLines usedNotes
Human corpus (wiki40b-pt, oscar-pt, cc100-pt, europarl-pt, opus-books-pt)1 M sampledDiverse Portuguese web/news/books
AI corpus (Detecting-ai/ai_pt_corpus)1 MGenerated with OpenAI models (various GPT-4 / GPT-3.5 variants); prompts cover essays, news, tweets, dialogs, paraphrases, T = 0.6–1.0

Datasets were balanced 1 : 1 and shuffled before training.


🚦 Intended use

Detect AI-generated Portuguese text in essays, articles, chats, support tickets, etc.

Limitations

  • β€”Not trained on code or non-Portuguese language.
  • β€”Accuracy may drop on texts < 10 tokens or heavily paraphrased AI.
  • β€”Commercial use is disallowed (CC-BY-NC-4.0).

⚠️ Future work

  • β€”Evaluate on adversarial paraphrases.
  • β€”Distill/quantize for edge deployment.
  • β€”Extend to multilingual detection.

πŸ“œ Citation

bibtex
@misc{abdurazzoqov2025ptaidetector,
  title   = {pt-ai-detector: Detecting AI-generated Portuguese Text},
  author  = {Abdulla Abdurazzoqov},
  year    = {2025},
  howpublished = {Hugging Face hub},
  url     = {https://huggingface.co/Detecting-ai/pt-ai-detector}
}

πŸ’¬ License

Creative Commons CC-BY-NC-4.0 β€” free for research & personal use; commercial use requires written permission.