Instructions to use cngchis/phi4-mini-intent with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use cngchis/phi4-mini-intent with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-classification", model="cngchis/phi4-mini-intent")# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("cngchis/phi4-mini-intent") model = AutoModelForCausalLM.from_pretrained("cngchis/phi4-mini-intent") - Notebooks
- Google Colab
- Kaggle
File size: 2,305 Bytes
1f86143 12cab26 158b0f9 12cab26 2e6cea3 12cab26 | 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 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 | ---
license: mit
datasets:
- cngchis/Support-Ticket-Router-12K-Cleaned
language:
- en
metrics:
- f1
- accuracy
- precision
- recall
base_model:
- unsloth/Phi-4-mini-instruct
new_version: cngchis/phi4-mini-intent
pipeline_tag: text-classification
library_name: transformers
---
# Intent Classification Model
## Model Description
This repository contains a **fine-tuned Transformer model** for **intent classification**.
The model is built using Hugging Face `transformers` and stored in **safetensors format**, enabling efficient and safe loading.
It predicts an intent label from input text for tasks such as chatbot understanding, ticket routing, and text categorization.
---
## How to Use
### Install dependencies
```bash
pip install transformers==4.57.6
```
---
### Load model
```bash
from transformers import AutoTokenizer, AutoModelForSequenceClassification
import torch
model_path = "cngchis/phi4-mini-intent"
tokenizer = AutoTokenizer.from_pretrained(model_path)
model = AutoModelForSequenceClassification.from_pretrained(model_path)
text = "I cannot log into my account"
inputs = tokenizer(text, return_tensors="pt", truncation=True, padding=True)
with torch.no_grad():
outputs = model(**inputs)
logits = outputs.logits
predicted_class = torch.argmax(logits, dim=1).item()
print(predicted_class)
```
---
### Input Format (Recommended)
```json
"I want to reset my password"
```
---
### Output Format
The model outputs a class index, which can be mapped to intent labels:
```json
3 → password_reset
1 → login_issue
5 → payment_problem
```
(You should define label mapping in your application.)
---
### Model Details
- Architecture: Transformer-based classification model
- Task: Intent classification
- Format: PyTorch (safetensors)
- Library: Hugging Face Transformers
- Input: Natural language text
- Output: Single intent class
---
### Notes
- Best performance when input format matches training data
- Requires label mapping for interpretation
- Works with GPU
- Supports batch inference via Transformers
---
### Limitations
Not suitable for generative tasks
Sensitive to domain shift (out-of-distribution text)
Requires consistent intent label schema
---
### Acknowledgements
Built using:
Hugging Face Transformers
PyTorch
Safetensors format
|