CoolFace
Modelpublic

IDA-SERICS/PromptClassifier

sourceHugging Faceapache-2.0updated 1y agoView on Hugging Face
0likes9downloads
Model Card

๐Ÿง  DeBERTa-v3 Base - Prompt Category Classifier (Fine-tuned)

This model is a fine-tuned version of `microsoft/deberta-v3-base` on the databricks-dolly-15k dataset. It has been trained to classify the prompt category based solely on the response text.

๐Ÿ—‚๏ธ Task

Text Classification Input: Response text Output: One of the predefined categories such as:

  • โ€”brainstorming
  • โ€”classification
  • โ€”closed_qa
  • โ€”creative_writing
  • โ€”general_qa
  • โ€”information_extraction
  • โ€”open_qa
  • โ€”summarization

๐Ÿ“Š Evaluation

The model was evaluated on a balanced version of the dataset. Here are the results:

  • โ€”Validation Accuracy: ~85.5%
  • โ€”F1 Score: ~85.0%
  • โ€”Best performance on: creative_writing, classification, summarization
  • โ€”Room for improvement on: open_qa

๐Ÿงช How to Use

python
from transformers import AutoTokenizer, AutoModelForSequenceClassification
import torch

model = AutoModelForSequenceClassification.from_pretrained("mariadg/deberta-v3-prompt-recognition")
tokenizer = AutoTokenizer.from_pretrained("mariadg/deberta-v3-prompt-recognition")

text = "The mitochondria is known as the powerhouse of the cell."
inputs = tokenizer(text, return_tensors="pt", truncation=True, padding=True)
outputs = model(**inputs)
pred = torch.argmax(outputs.logits, dim=1).item()

print(pred)  # Map this index back to label if needed

๐Ÿ“ฆ Label Mapping

The model outputs a numerical label corresponding to a prompt category. Below is the mapping between label IDs and their respective categories:

  • โ€”0: brainstorming
  • โ€”1: classification
  • โ€”2: closed_qa
  • โ€”3: creative_writing
  • โ€”4: general_qa
  • โ€”5: information_extraction
  • โ€”6: open_qa
  • โ€”7: summarization

๐Ÿ› ๏ธ Training Details

  • โ€”Base model: microsoft/deberta-v3-base
  • โ€”Framework: PyTorch
  • โ€”Max length: 256
  • โ€”Batch size: 16
  • โ€”Epochs: 4
  • โ€”Loss function: CrossEntropyLoss

๐Ÿ” License

Apache 2.0


๐Ÿ“ Fine-tuned for research purposes.