Views
No views yet
1from transformers import AutoModelForCausalLM, AutoTokenizer
2
3# Load model and tokenizer
4model = AutoModelForCausalLM.from_pretrained("chendren/phi2-multi-issue-analysis")
5tokenizer = AutoTokenizer.from_pretrained("chendren/phi2-multi-issue-analysis")
6
7# Prepare input
8transcript = """[Your customer service transcript here]"""
9
10# Generate analysis
11inputs = tokenizer(transcript, return_tensors="pt")
12outputs = model.generate(**inputs, max_new_tokens=512)
13analysis = tokenizer.decode(outputs[0])1{
2 "primary_issue": "Internet connection drops",
3 "secondary_issues": [
4 "Signal interference",
5 "Router firmware outdated"
6 ],
7 "customer_sentiment": "negative",
8 "agent_performance": {
9 "rating": 4,
10 "justification": "Agent was helpful and provided clear instructions"
11 },
12 "resolution_status": "resolved",
13 "follow_up_needed": false,
14 "key_points": [
15 "Customer experienced internet drops",
16 "Agent guided through troubleshooting",
17 "Issue resolved with firmware update"
18 ],
19 "issues": [
20 "Intermittent connection drops",
21 "WiFi interference",
22 "Outdated firmware"
23 ],
24 "actions": [
25 "Diagnosed signal fluctuations",
26 "Updated router firmware",
27 "Provided monitoring instructions"
28 ],
29 "outcomes": [
30 "Connection stability improved",
31 "Firmware updated successfully"
32 ],
33 "predicted_csat": 4
34}1@misc{phi2-multi-issue-analysis,
2 author = {args.username},
3 title = {Phi-2 Multi-Issue Transcript Analysis Model},
4 year = {2025},
5 publisher = {Hugging Face},
6 journal = {Hugging Face Model Hub},
7 howpublished = {https://huggingface.co/chendren/phi2-multi-issue-analysis}
8}