Spaces:
Sleeping
Sleeping
Download api/inference.py from ApyHTML19/Triple-R-Checker: direct link, hf CLI and curl.
- Browser
- Download file 300 Bytes
-
https://huggingface.co/spaces/ApyHTML19/Triple-R-Checker/resolve/main/api/inference.py
- Command line
-
hf download hf://spaces/ApyHTML19/Triple-R-Checker/api/inference.py
-
curl -L -o inference.py https://huggingface.co/spaces/ApyHTML19/Triple-R-Checker/resolve/main/api/inference.py
300 Bytes
| import joblib | |
| model = joblib.load( | |
| "models/best_logistic.pkl" | |
| ) | |
| vectorizer = joblib.load( | |
| "models/tfidf_vectorizer.pkl" | |
| ) | |
| def predict_claim(text): | |
| vector = vectorizer.transform( | |
| [text] | |
| ) | |
| prediction = model.predict( | |
| vector | |
| ) | |
| return str(prediction[0]) |