Update api/predict.py
Browse files- api/predict.py +5 -5
api/predict.py
CHANGED
|
@@ -250,8 +250,8 @@ def predict_review(text):
|
|
| 250 |
"confidence": 0.0,
|
| 251 |
"is_fake": None,
|
| 252 |
"model_agreement": result['agreement'] * 100,
|
| 253 |
-
"fake_probability": result['fakeProb']
|
| 254 |
-
"genuine_probability": result['genuineProb']
|
| 255 |
"length_category": getLengthCategory(cleaned),
|
| 256 |
"token_count": len(cleaned.split()),
|
| 257 |
"error": result['error']
|
|
@@ -276,11 +276,11 @@ def predict_review(text):
|
|
| 276 |
|
| 277 |
return {
|
| 278 |
"prediction": prediction,
|
| 279 |
-
"confidence": confidence
|
| 280 |
"is_fake": isFakeOutput,
|
| 281 |
"model_agreement": agreement * 100,
|
| 282 |
-
"fake_probability": fakeProb
|
| 283 |
-
"genuine_probability": genuineProb
|
| 284 |
"length_category": lengthCat,
|
| 285 |
"token_count": tokenCount
|
| 286 |
}
|
|
|
|
| 250 |
"confidence": 0.0,
|
| 251 |
"is_fake": None,
|
| 252 |
"model_agreement": result['agreement'] * 100,
|
| 253 |
+
"fake_probability": result['fakeProb'],
|
| 254 |
+
"genuine_probability": result['genuineProb'],
|
| 255 |
"length_category": getLengthCategory(cleaned),
|
| 256 |
"token_count": len(cleaned.split()),
|
| 257 |
"error": result['error']
|
|
|
|
| 276 |
|
| 277 |
return {
|
| 278 |
"prediction": prediction,
|
| 279 |
+
"confidence": confidence,
|
| 280 |
"is_fake": isFakeOutput,
|
| 281 |
"model_agreement": agreement * 100,
|
| 282 |
+
"fake_probability": fakeProb,
|
| 283 |
+
"genuine_probability": genuineProb,
|
| 284 |
"length_category": lengthCat,
|
| 285 |
"token_count": tokenCount
|
| 286 |
}
|