abhika-m commited on
Commit
e3b28ca
·
verified ·
1 Parent(s): 9241971

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +5 -5
app.py CHANGED
@@ -28,18 +28,18 @@ def result(passage, reference):
28
  output = output.replace("<entity>", "<span style='background-color: #E9A2D9; border-bottom: 1px dotted;'>entity</span>")
29
  output = output.replace("<relation>", "<span style='background-color: #F3B78B; border-bottom: 1px dotted;'>relation</span>")
30
  output = output.replace("<contradictory>", "<span style='background-color: #FFFF9B; border-bottom: 1px dotted;'>contradictory</span>")
31
- output = output.replace("<unverifiable>", "<span style='background-color: #B2DCE5; border-bottom: 1px dotted;'>unverifiable</span>")
32
  output = output.replace("<invented>", "<span style='background-color: #BFE9B9; border-bottom: 1px dotted;'>invented</span>")
33
- output = output.replace("<subjective>", "<span style='background-color: #B5B7F5; border-bottom: 1px dotted;'>subjective</span>")
34
  output = output.replace("</entity>", "")
35
  output = output.replace("</relation>", "")
36
  output = output.replace("</contradictory>", "")
37
- output = output.replace("</unverifiable>", "")
38
  output = output.replace("</invented>", "")
39
- output = output.replace("</subjective>", "")
40
  output = output.replace("Edited:", "")
41
  return f'<div style="font-weight: normal;">{output}</div>'; #output;
42
 
43
  if __name__ == "__main__":
44
- demo = gradio.Interface(fn=result, inputs=["text", "text"], outputs="html")
45
  demo.launch(share=True)
 
28
  output = output.replace("<entity>", "<span style='background-color: #E9A2D9; border-bottom: 1px dotted;'>entity</span>")
29
  output = output.replace("<relation>", "<span style='background-color: #F3B78B; border-bottom: 1px dotted;'>relation</span>")
30
  output = output.replace("<contradictory>", "<span style='background-color: #FFFF9B; border-bottom: 1px dotted;'>contradictory</span>")
31
+ output = output.replace("<unverifiable>", "<span style='background-color: #D3D3D3; border-bottom: 1px dotted;'>unverifiable</span><u>")
32
  output = output.replace("<invented>", "<span style='background-color: #BFE9B9; border-bottom: 1px dotted;'>invented</span>")
33
+ output = output.replace("<subjective>", "<span style='background-color: #D3D3D3; border-bottom: 1px dotted;'>subjective</span><u>")
34
  output = output.replace("</entity>", "")
35
  output = output.replace("</relation>", "")
36
  output = output.replace("</contradictory>", "")
37
+ output = output.replace("</u></unverifiable>", "")
38
  output = output.replace("</invented>", "")
39
+ output = output.replace("</u></subjective>", "")
40
  output = output.replace("Edited:", "")
41
  return f'<div style="font-weight: normal;">{output}</div>'; #output;
42
 
43
  if __name__ == "__main__":
44
+ demo = gradio.Interface(fn=result, flagging_dir="flagged/", inputs=["text", "text"], outputs="html", title="Fine-grained Hallucination Detection and Editing (FAVA)", description="Enter some text and a reference for the text and FAVA will detect and edit any hallucinations present.")
45
  demo.launch(share=True)