Run this model with HF Jobs
Run wahidullah/techdocs7-distilbert on Hugging Face's managed compute, monitor its progress, and retrieve the results when it's done.
Paste one of these prompts into your coding agent:
Fine-tune on my dataset
Use HF Jobs to fine-tune https://huggingface.co/wahidullah/techdocs7-distilbert. Ask me which dataset to train on, then push the fine-tuned model to a new model repo. Run `hf jobs --help` first to learn the CLI.
Run batch inference
Use HF Jobs to run batch inference with https://huggingface.co/wahidullah/techdocs7-distilbert on the inputs in a mounted HF Bucket. Ask me which Bucket to use, then write the outputs back to it and keep each input ID. Run `hf jobs --help` first to learn the CLI.
Instructions to use wahidullah/techdocs7-distilbert with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use wahidullah/techdocs7-distilbert with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-classification", model="wahidullah/techdocs7-distilbert")# pip install -U transformers accelerate # Load model directly from transformers import AutoTokenizer, AutoModelForSequenceClassification tokenizer = AutoTokenizer.from_pretrained("wahidullah/techdocs7-distilbert") model = AutoModelForSequenceClassification.from_pretrained("wahidullah/techdocs7-distilbert", device_map="auto") - Notebooks
- Google Colab
- Kaggle
techdocs7-distilbert
A DistilBERT model fine-tuned to classify short technical passages (2 to 4 sentences, 40 to 100 words) into seven topic categories covering AI, cloud, backend and security. It was trained on the TechDocs-7 dataset as a learning project.
Labels
| ID | Label | Meaning |
|---|---|---|
| 0 | ML&DL | Machine Learning & Deep Learning |
| 1 | LLM&NLP | Large Language Models & Natural Language Processing |
| 2 | RAG&IR | Retrieval-Augmented Generation & Information Retrieval |
| 3 | Agents | AI Agents & Agent Orchestration |
| 4 | Cloud&DevOps | Cloud Computing & DevOps |
| 5 | Backend&DB | Backend Development & Databases |
| 6 | Security | Cybersecurity |
How to Use
from transformers import pipeline
clf = pipeline("text-classification",
model="wahidullah/techdocs7-distilbert",
top_k=3)
text = ("Kubernetes schedules pods onto nodes based on resource requests, "
"taints, and affinity rules. The kube-scheduler scores each feasible "
"node and binds the pod to the highest-ranked one.")
print(clf(text, truncation=True, max_length=160))
If the repository is private, log in first with huggingface_hub.login().
Training Data
Fine-tuned on TechDocs-7, a dataset of 334 verbatim excerpts from arXiv abstracts, CVE descriptions and open-source documentation. Stratified split, seed 42:
| Split | Examples |
|---|---|
| Train | 233 |
| Validation | 50 |
| Test | 51 |
See the dataset card for sources, licenses and known limitations.
Training Procedure
- Base model:
distilbert-base-uncased, with a new 7-way classification head - Epochs: 15, with the best checkpoint chosen by validation macro F1 (epoch 6: accuracy 0.80, macro F1 0.794)
- Learning rate: 5e-5, with 45 warmup steps
- Batch size: 8 (train), 32 (eval)
- Weight decay: 0.01
- Max sequence length: 160 tokens
- Loss: cross-entropy with inverse-frequency class weights (labels 1 and 3 have fewer examples)
- Seed: 42
- Framework: Hugging Face Transformers
Trainer
Evaluation
Evaluated once on the held-out test split (51 examples):
| Class | Precision | Recall | F1 | Support |
|---|---|---|---|---|
| ML&DL | 1.00 | 1.00 | 1.00 | 8 |
| LLM&NLP | 0.88 | 1.00 | 0.93 | 7 |
| RAG&IR | 1.00 | 1.00 | 1.00 | 7 |
| Agents | 0.83 | 0.83 | 0.83 | 6 |
| Cloud&DevOps | 1.00 | 0.75 | 0.86 | 8 |
| Backend&DB | 0.80 | 1.00 | 0.89 | 8 |
| Security | 1.00 | 0.86 | 0.92 | 7 |
| Accuracy | 0.92 | 51 | ||
| Macro avg | 0.93 | 0.92 | 0.92 | 51 |
A TF-IDF (1-2 grams) + logistic regression baseline scored about 76% accuracy under 5-fold cross-validation on all 334 rows. The two numbers use different evaluation setups and are not directly comparable.
Observed errors (4 of 51): two Cloud&DevOps passages predicted as Backend&DB (Kubernetes API reference text and Docker port publishing), one Agents passage predicted as LLM&NLP, and one Security passage predicted as Agents. At least two of these look like label-quality problems in the data rather than model mistakes.
Intended Use
Learning, experimentation and demos of topic routing for short English technical passages, such as sorting documentation or paper abstracts into broad areas.
Limitations
- Small data. The model was trained on 233 examples. The test set has only 51, so each per-class score rests on 6 to 8 examples, and the true accuracy could plausibly lie anywhere between about 82% and 98%.
- No "other" class. Text outside these seven topics still receives one of the seven labels, often with high confidence. Confidence scores are not calibrated.
- Overlapping classes. LLM&NLP, RAG&IR and Agents overlap in vocabulary, as do Cloud&DevOps and Backend&DB. Expect mistakes on mixed-topic text.
- Source style. Labels 0 to 3 come mostly from research abstracts and labels 4 to 6 mostly from documentation, so the model may partly use writing style as a signal. Label 5 comes entirely from FastAPI documentation.
- Possible split leakage. Splits were made by row, not by source document, so several chunks from one page may sit in both train and test. The test score may be optimistic.
- Input format. It expects 2 to 4 sentences of technical prose in English. Very short, very long, code-only or non-English inputs are out of distribution.
- Not for security decisions. Do not use it to triage vulnerabilities, filter threats or make any security-critical decision.
License
The model weights are released under Apache 2.0, matching the base model. The training data carries its own licenses (the dataset is CC BY-SA 4.0 overall). Check them before using this model commercially.
Citation
@misc{techdocs7distilbert,
title = {techdocs7-distilbert: DistilBERT fine-tuned on TechDocs-7},
author = {[Your Name]},
year = {2026},
url = {https://huggingface.co/wahidullah/techdocs7-distilbert}
}
- Downloads last month
- 25
Model tree for wahidullah/techdocs7-distilbert
Base model
distilbert/distilbert-base-uncased