Christopher Román Jaimes commited on
Commit
9c88bfd
·
1 Parent(s): 7f254c6

chore: add bert raw output.

Browse files
Files changed (1) hide show
  1. app.py +3 -0
app.py CHANGED
@@ -262,9 +262,12 @@ def generate_answer(text):
262
 
263
  # Format Prediction
264
  label, score = extract_max_label_score(predictions[0])
 
 
265
  prediction_cleaned = clean_prediction_bert(label, score)
266
  if isinstance(prediction_cleaned, int):
267
  entities_cleaned["NIVELES_CASA"] = prediction_cleaned
 
268
 
269
  result_json = json.dumps(entities_cleaned, indent = 4, ensure_ascii = False)
270
 
 
262
 
263
  # Format Prediction
264
  label, score = extract_max_label_score(predictions[0])
265
+ entities_formatted["NIVELES_CASA"] = label
266
+ entities_formatted["prob_NIVELES_CASA"] = score
267
  prediction_cleaned = clean_prediction_bert(label, score)
268
  if isinstance(prediction_cleaned, int):
269
  entities_cleaned["NIVELES_CASA"] = prediction_cleaned
270
+
271
 
272
  result_json = json.dumps(entities_cleaned, indent = 4, ensure_ascii = False)
273