Download inference.py from Samuel4650p/customer-support-intent-classifier: direct link, hf CLI and curl.
- Browser
- Download file 235 Bytes
-
https://huggingface.co/Samuel4650p/customer-support-intent-classifier/resolve/main/inference.py
- Command line
-
hf download hf://Samuel4650p/customer-support-intent-classifier/inference.py
-
curl -L -o inference.py https://huggingface.co/Samuel4650p/customer-support-intent-classifier/resolve/main/inference.py
235 Bytes
| import joblib | |
| model = joblib.load("model.joblib") | |
| text = input("Customer message: ") | |
| intent = model.predict([text])[0] | |
| confidence = float(model.predict_proba([text]).max()) | |
| print({"intent": intent, "confidence": round(confidence, 4)}) | |