File size: 2,343 Bytes
30bc546
 
 
 
 
 
 
 
 
 
17c9be9
 
 
 
30bc546
 
 
 
17c9be9
30bc546
 
 
 
 
e2df9cf
30bc546
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
6b95560
 
30bc546
 
 
 
 
 
 
 
3d31fe6
 
 
 
36a1820
 
 
 
 
 
 
4358d34
30bc546
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
58a5fd3
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
---
license: apache-2.0
tags:
- bert
- deberta
- text-classification
- fine-tuned
- databricks-dolly
- prompt-category
language: en
datasets:
- databricks/databricks-dolly-15k
base_model:
- microsoft/deberta-v3-base
---

# 🧠 DeBERTa-v3 Base - Prompt Category Classifier (Fine-tuned)

This model is a fine-tuned version of [`microsoft/deberta-v3-base`](https://huggingface.co/microsoft/deberta-v3-base) on the [databricks-dolly-15k](https://huggingface.co/datasets/databricks/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.