codingcoolfun9ed commited on
Commit
ad301ba
·
verified ·
1 Parent(s): 7f05762

forgot to make stuff percentages so it says uncertain every time

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