Text Generation
Transformers
Safetensors
English
phi
phi-2
customer-service
transcript-analysis
multi-issue
legacy
text-generation-inference
Instructions to use chendren/phi2-multi-issue-analysis with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use chendren/phi2-multi-issue-analysis with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="chendren/phi2-multi-issue-analysis")# pip install -U transformers accelerate # Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("chendren/phi2-multi-issue-analysis") model = AutoModelForCausalLM.from_pretrained("chendren/phi2-multi-issue-analysis", device_map="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use chendren/phi2-multi-issue-analysis with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "chendren/phi2-multi-issue-analysis" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "chendren/phi2-multi-issue-analysis", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/chendren/phi2-multi-issue-analysis
- SGLang
How to use chendren/phi2-multi-issue-analysis with SGLang:
Install from pip and serve model
# Install SGLang from pip: pip install sglang # Start the SGLang server: python3 -m sglang.launch_server \ --model-path "chendren/phi2-multi-issue-analysis" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "chendren/phi2-multi-issue-analysis", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker images
docker run --gpus all \ --shm-size 32g \ -p 30000:30000 \ -v ~/.cache/huggingface:/root/.cache/huggingface \ --env "HF_TOKEN=<secret>" \ --ipc=host \ lmsysorg/sglang:latest \ python3 -m sglang.launch_server \ --model-path "chendren/phi2-multi-issue-analysis" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "chendren/phi2-multi-issue-analysis", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use chendren/phi2-multi-issue-analysis with Docker Model Runner:
docker model run hf.co/chendren/phi2-multi-issue-analysis
docs: refresh model/dataset card metadata and honesty notes
Browse files
README.md
CHANGED
|
@@ -1,105 +1,55 @@
|
|
| 1 |
---
|
| 2 |
-
language:
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 3 |
tags:
|
| 4 |
- phi-2
|
| 5 |
- customer-service
|
| 6 |
- transcript-analysis
|
| 7 |
- multi-issue
|
| 8 |
-
|
| 9 |
---
|
| 10 |
|
| 11 |
-
# Phi-2 Multi-Issue Transcript Analysis
|
| 12 |
-
|
| 13 |
-
This model is based on Microsoft's Phi-2 for analyzing customer service transcripts with multiple issues. It can:
|
| 14 |
|
| 15 |
-
|
| 16 |
-
2. Analyze customer sentiment
|
| 17 |
-
3. Rate agent performance
|
| 18 |
-
4. Track resolution status
|
| 19 |
-
5. Predict CSAT scores
|
| 20 |
-
6. Extract key actions and outcomes
|
| 21 |
|
| 22 |
-
|
| 23 |
-
|
| 24 |
-
- **Base Model**: microsoft/phi-2
|
| 25 |
-
- **Task**: Multi-issue customer service transcript analysis
|
| 26 |
-
- **Training Data**: Customer service transcripts with multiple issues
|
| 27 |
-
- **Output Format**: Structured JSON with detailed analysis
|
| 28 |
|
| 29 |
## Usage
|
| 30 |
|
| 31 |
```python
|
| 32 |
from transformers import AutoModelForCausalLM, AutoTokenizer
|
| 33 |
-
|
| 34 |
-
# Load model and tokenizer
|
| 35 |
model = AutoModelForCausalLM.from_pretrained("chendren/phi2-multi-issue-analysis")
|
| 36 |
tokenizer = AutoTokenizer.from_pretrained("chendren/phi2-multi-issue-analysis")
|
| 37 |
-
|
| 38 |
-
# Prepare input
|
| 39 |
-
transcript = """[Your customer service transcript here]"""
|
| 40 |
-
|
| 41 |
-
# Generate analysis
|
| 42 |
inputs = tokenizer(transcript, return_tensors="pt")
|
| 43 |
outputs = model.generate(**inputs, max_new_tokens=512)
|
| 44 |
-
|
| 45 |
```
|
| 46 |
|
| 47 |
-
##
|
| 48 |
|
| 49 |
-
|
| 50 |
-
{
|
| 51 |
-
"primary_issue": "Internet connection drops",
|
| 52 |
-
"secondary_issues": [
|
| 53 |
-
"Signal interference",
|
| 54 |
-
"Router firmware outdated"
|
| 55 |
-
],
|
| 56 |
-
"customer_sentiment": "negative",
|
| 57 |
-
"agent_performance": {
|
| 58 |
-
"rating": 4,
|
| 59 |
-
"justification": "Agent was helpful and provided clear instructions"
|
| 60 |
-
},
|
| 61 |
-
"resolution_status": "resolved",
|
| 62 |
-
"follow_up_needed": false,
|
| 63 |
-
"key_points": [
|
| 64 |
-
"Customer experienced internet drops",
|
| 65 |
-
"Agent guided through troubleshooting",
|
| 66 |
-
"Issue resolved with firmware update"
|
| 67 |
-
],
|
| 68 |
-
"issues": [
|
| 69 |
-
"Intermittent connection drops",
|
| 70 |
-
"WiFi interference",
|
| 71 |
-
"Outdated firmware"
|
| 72 |
-
],
|
| 73 |
-
"actions": [
|
| 74 |
-
"Diagnosed signal fluctuations",
|
| 75 |
-
"Updated router firmware",
|
| 76 |
-
"Provided monitoring instructions"
|
| 77 |
-
],
|
| 78 |
-
"outcomes": [
|
| 79 |
-
"Connection stability improved",
|
| 80 |
-
"Firmware updated successfully"
|
| 81 |
-
],
|
| 82 |
-
"predicted_csat": 4
|
| 83 |
-
}
|
| 84 |
-
```
|
| 85 |
|
| 86 |
-
##
|
| 87 |
|
| 88 |
-
-
|
| 89 |
-
-
|
| 90 |
-
-
|
| 91 |
|
| 92 |
## Citation
|
| 93 |
|
| 94 |
-
If you use this model, please cite:
|
| 95 |
-
|
| 96 |
```bibtex
|
| 97 |
@misc{phi2-multi-issue-analysis,
|
| 98 |
-
author = {
|
| 99 |
title = {Phi-2 Multi-Issue Transcript Analysis Model},
|
| 100 |
year = {2025},
|
| 101 |
publisher = {Hugging Face},
|
| 102 |
-
|
| 103 |
-
howpublished = {https://huggingface.co/chendren/phi2-multi-issue-analysis}
|
| 104 |
}
|
| 105 |
```
|
|
|
|
| 1 |
---
|
| 2 |
+
language:
|
| 3 |
+
- en
|
| 4 |
+
license: mit
|
| 5 |
+
library_name: transformers
|
| 6 |
+
base_model: microsoft/phi-2
|
| 7 |
+
base_model_relation: finetune
|
| 8 |
+
pipeline_tag: text-generation
|
| 9 |
tags:
|
| 10 |
- phi-2
|
| 11 |
- customer-service
|
| 12 |
- transcript-analysis
|
| 13 |
- multi-issue
|
| 14 |
+
- legacy
|
| 15 |
---
|
| 16 |
|
| 17 |
+
# Phi-2 Multi-Issue Transcript Analysis (legacy)
|
|
|
|
|
|
|
| 18 |
|
| 19 |
+
Fine-tune of `microsoft/phi-2` that emits JSON for multi-issue customer-service transcripts (primary/secondary issues, sentiment, agent rating, resolution, CSAT-style score).
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 20 |
|
| 21 |
+
**Legacy.** No held-out metric was published. Phi-2 is a 2023 2.7B checkpoint. For process-control labels and forbidden-hit scoring use [Immortalis/cx-comply](https://huggingface.co/datasets/Immortalis/cx-comply). For applied CX decisions with measured accuracy use [chendren/cx-decider-applied-v1](https://huggingface.co/chendren/cx-decider-applied-v1).
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 22 |
|
| 23 |
## Usage
|
| 24 |
|
| 25 |
```python
|
| 26 |
from transformers import AutoModelForCausalLM, AutoTokenizer
|
|
|
|
|
|
|
| 27 |
model = AutoModelForCausalLM.from_pretrained("chendren/phi2-multi-issue-analysis")
|
| 28 |
tokenizer = AutoTokenizer.from_pretrained("chendren/phi2-multi-issue-analysis")
|
| 29 |
+
transcript = "[customer service transcript]"
|
|
|
|
|
|
|
|
|
|
|
|
|
| 30 |
inputs = tokenizer(transcript, return_tensors="pt")
|
| 31 |
outputs = model.generate(**inputs, max_new_tokens=512)
|
| 32 |
+
print(tokenizer.decode(outputs[0]))
|
| 33 |
```
|
| 34 |
|
| 35 |
+
## Intended use
|
| 36 |
|
| 37 |
+
Research on structured transcript tagging. Not a production QA scorer. Agent-performance ratings from this model should not be used for HR decisions.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 38 |
|
| 39 |
+
## Limits
|
| 40 |
|
| 41 |
+
- No published test accuracy, ECE, or agreement vs human labels
|
| 42 |
+
- English, clear dialogue format
|
| 43 |
+
- CSAT values are model guesses, not survey scores
|
| 44 |
|
| 45 |
## Citation
|
| 46 |
|
|
|
|
|
|
|
| 47 |
```bibtex
|
| 48 |
@misc{phi2-multi-issue-analysis,
|
| 49 |
+
author = {Hendren, Chad},
|
| 50 |
title = {Phi-2 Multi-Issue Transcript Analysis Model},
|
| 51 |
year = {2025},
|
| 52 |
publisher = {Hugging Face},
|
| 53 |
+
url = {https://huggingface.co/chendren/phi2-multi-issue-analysis}
|
|
|
|
| 54 |
}
|
| 55 |
```
|