jiangjiechen commited on
Commit
02cd36f
1 Parent(s): 9d6c6a0
Files changed (1) hide show
  1. app.py +7 -4
app.py CHANGED
@@ -105,12 +105,15 @@ def gradio_formatter(js, output_type):
105
  def run(claim):
106
  try:
107
  js = loren.check(claim)
108
- except:
 
 
109
  return 'Oops, something went wrong.', '', ''
110
- loren.logger.warning(str(js))
 
111
  ev_html = gradio_formatter(js, 'e')
112
  z_html = gradio_formatter(js, 'z')
113
- return js['claim_veracity'], z_html, ev_html
114
 
115
 
116
  iface = gr.Interface(
@@ -129,7 +132,7 @@ iface = gr.Interface(
129
  layout='horizontal',
130
  description="LOREN is an interpretable Fact Verification model using Wikipedia as its knowledge source. "
131
  "This is a demo system for the AAAI 2022 paper: \"LOREN: Logic-Regularized Reasoning for Interpretable Fact Verification\"(https://arxiv.org/abs/2012.13577). "
132
- "See the paper for technical details. You can add a *FLAG* on the bottom to record interesting or bad cases! "
133
  "(Note that the demo system directly retrieves evidence from an up-to-date Wikipedia, which is different from the evidence used in the paper.)",
134
  flagging_dir='results/flagged/',
135
  allow_flagging=True,
 
105
  def run(claim):
106
  try:
107
  js = loren.check(claim)
108
+ except Exception as e:
109
+ loren.logger.error(str(e))
110
+ loren.logger.error(claim)
111
  return 'Oops, something went wrong.', '', ''
112
+ label = js['claim_veracity']
113
+ loren.logger.warning(label + str(js))
114
  ev_html = gradio_formatter(js, 'e')
115
  z_html = gradio_formatter(js, 'z')
116
+ return label, z_html, ev_html
117
 
118
 
119
  iface = gr.Interface(
 
132
  layout='horizontal',
133
  description="LOREN is an interpretable Fact Verification model using Wikipedia as its knowledge source. "
134
  "This is a demo system for the AAAI 2022 paper: \"LOREN: Logic-Regularized Reasoning for Interpretable Fact Verification\"(https://arxiv.org/abs/2012.13577). "
135
+ "See the paper for more details. You can add a *FLAG* on the bottom to record interesting or bad cases! "
136
  "(Note that the demo system directly retrieves evidence from an up-to-date Wikipedia, which is different from the evidence used in the paper.)",
137
  flagging_dir='results/flagged/',
138
  allow_flagging=True,