Upload 5 files
Browse files- README.md +33 -0
- dataset_info.json +16 -0
- inference.py +6 -0
- model.joblib +3 -0
- requirements.txt +2 -0
README.md
ADDED
|
@@ -0,0 +1,33 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
---
|
| 2 |
+
library_name: scikit-learn
|
| 3 |
+
tags:
|
| 4 |
+
- text-classification
|
| 5 |
+
- nlp
|
| 6 |
+
- customer-support
|
| 7 |
+
- tf-idf
|
| 8 |
+
---
|
| 9 |
+
|
| 10 |
+
# Customer Support Intent Classifier
|
| 11 |
+
|
| 12 |
+
A small NLP model that classifies customer-support messages into nine intents
|
| 13 |
+
using TF-IDF and Logistic Regression.
|
| 14 |
+
|
| 15 |
+
## Intents
|
| 16 |
+
password_reset, login_issue, billing_issue, refund_request,
|
| 17 |
+
performance_issue, subscription_cancel, plan_upgrade, service_outage,
|
| 18 |
+
general_support
|
| 19 |
+
|
| 20 |
+
## Intended use
|
| 21 |
+
Educational/portfolio demonstration of NLP and customer-support automation.
|
| 22 |
+
The training data is synthetic and this model is not intended for production
|
| 23 |
+
use without additional real-world training and evaluation.
|
| 24 |
+
|
| 25 |
+
## Usage
|
| 26 |
+
```python
|
| 27 |
+
import joblib
|
| 28 |
+
model = joblib.load("model.joblib")
|
| 29 |
+
print(model.predict(["I need to reset my password"]))
|
| 30 |
+
```
|
| 31 |
+
|
| 32 |
+
## Author
|
| 33 |
+
Samuel V
|
dataset_info.json
ADDED
|
@@ -0,0 +1,16 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"type": "synthetic_demo",
|
| 3 |
+
"examples": 27,
|
| 4 |
+
"intents": [
|
| 5 |
+
"billing_issue",
|
| 6 |
+
"general_support",
|
| 7 |
+
"login_issue",
|
| 8 |
+
"password_reset",
|
| 9 |
+
"performance_issue",
|
| 10 |
+
"plan_upgrade",
|
| 11 |
+
"refund_request",
|
| 12 |
+
"service_outage",
|
| 13 |
+
"subscription_cancel"
|
| 14 |
+
],
|
| 15 |
+
"note": "Synthetic examples created for portfolio demonstration; no real customer data."
|
| 16 |
+
}
|
inference.py
ADDED
|
@@ -0,0 +1,6 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import joblib
|
| 2 |
+
model = joblib.load("model.joblib")
|
| 3 |
+
text = input("Customer message: ")
|
| 4 |
+
intent = model.predict([text])[0]
|
| 5 |
+
confidence = float(model.predict_proba([text]).max())
|
| 6 |
+
print({"intent": intent, "confidence": round(confidence, 4)})
|
model.joblib
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:5dbb0dc68238fbc044cd04884a14a7460300fe2d9bade84b5783679ffb7b487a
|
| 3 |
+
size 16177
|
requirements.txt
ADDED
|
@@ -0,0 +1,2 @@
|
|
|
|
|
|
|
|
|
|
| 1 |
+
scikit-learn>=1.3
|
| 2 |
+
joblib>=1.3
|