Views
No views yet
| ID | Label | Description |
|---|---|---|
| 0 | creative | Fiction, brainstorming, roleplay, poetry |
| 1 | informational | Factual questions, explanations, definitions |
| 2 | task | Code, translation, summarisation, editing |
| 3 | adversarial | Jailbreaks, prompt injection, manipulation |
| Classifier | Accuracy | F1 macro | F1 weighted |
|---|---|---|---|
| Logistic Regression | 0.8218 | 0.8222 | 0.8209 |
| Linear SVM | 0.7816 | 0.7824 | 0.7816 |
| MLP | 0.8103 | 0.8090 | 0.8100 |
precision recall f1-score support
creative 0.78 0.89 0.83 45
informational 0.84 0.77 0.80 48
task 0.80 0.89 0.85 37
adversarial 0.87 0.75 0.80 44
accuracy 0.82 174
macro avg 0.82 0.83 0.82 174
weighted avg 0.83 0.82 0.82 174
Predicted →
creative info task adversarial
creative 40 2 3 0
informational 3 37 5 3
task 0 2 33 2
adversarial 8 3 0 331from sentence_transformers import SentenceTransformer
2import joblib
3from huggingface_hub import hf_hub_download
4
5embedder = SentenceTransformer("sentence-transformers/all-MiniLM-L6-v2")
6clf_path = hf_hub_download(repo_id="belrem/llm-prompt-intent-classifier", filename="classifier.joblib")
7clf = joblib.load(clf_path)
8
9prompt = "Write a poem about the ocean."
10vec = embedder.encode([prompt])
11label_id = clf.predict(vec)[0]
12labels = ["creative", "informational", "task", "adversarial"]
13print(labels[label_id]) # → creativecreative or task.