Spaces:
Build error
Build error
jiangjiechen
commited on
Commit
•
3e34cb7
1
Parent(s):
f06b351
fix premise
Browse files- app.py +2 -2
- src/loren.py +1 -1
app.py
CHANGED
@@ -56,7 +56,7 @@ def gradio_formatter(js, output_type):
|
|
56 |
elif output_type == 'z':
|
57 |
data = {
|
58 |
'Claim Phrase': js['claim_phrases'],
|
59 |
-
'Local Premise':
|
60 |
'p_SUP': [round(x[2], 4) for x in js['phrase_veracity']],
|
61 |
'p_REF': [round(x[0], 4) for x in js['phrase_veracity']],
|
62 |
'p_NEI': [round(x[1], 4) for x in js['phrase_veracity']],
|
@@ -95,7 +95,7 @@ iface = gr.Interface(
|
|
95 |
'The Cry of the Owl is based on a book by an American.',
|
96 |
'Smriti Mandhana is an Indian woman.'],
|
97 |
title="LOREN",
|
98 |
-
layout='
|
99 |
description="LOREN is an interpretable Fact Verification model against Wikipedia. "
|
100 |
"This is a demo system for \"LOREN: Logic-Regularized Reasoning for Interpretable Fact Verification\". "
|
101 |
"See the paper for technical details. You can add FLAG on the bottom to record interesting or bad cases! \n"
|
|
|
56 |
elif output_type == 'z':
|
57 |
data = {
|
58 |
'Claim Phrase': js['claim_phrases'],
|
59 |
+
'Local Premise': js['local_premises'],
|
60 |
'p_SUP': [round(x[2], 4) for x in js['phrase_veracity']],
|
61 |
'p_REF': [round(x[0], 4) for x in js['phrase_veracity']],
|
62 |
'p_NEI': [round(x[1], 4) for x in js['phrase_veracity']],
|
|
|
95 |
'The Cry of the Owl is based on a book by an American.',
|
96 |
'Smriti Mandhana is an Indian woman.'],
|
97 |
title="LOREN",
|
98 |
+
layout='horizontal',
|
99 |
description="LOREN is an interpretable Fact Verification model against Wikipedia. "
|
100 |
"This is a demo system for \"LOREN: Logic-Regularized Reasoning for Interpretable Fact Verification\". "
|
101 |
"See the paper for technical details. You can add FLAG on the bottom to record interesting or bad cases! \n"
|
src/loren.py
CHANGED
@@ -57,7 +57,7 @@ class Loren:
|
|
57 |
label = id2label[y_predicted[0]]
|
58 |
|
59 |
# Update js
|
60 |
-
js = assemble_answers_to_one(js, k=
|
61 |
js['evidence'] = [self.fc_client.tokenizer.clean_up_tokenization(e[2]) for e in js['evidence']]
|
62 |
js['questions'] = [self.fc_client.tokenizer.clean_up_tokenization(q) for q in js['questions']]
|
63 |
js['claim_phrases'] = [self.fc_client.tokenizer.clean_up_tokenization(a[0]) for a in js['answers']]
|
|
|
57 |
label = id2label[y_predicted[0]]
|
58 |
|
59 |
# Update js
|
60 |
+
js = assemble_answers_to_one(js, k=3)
|
61 |
js['evidence'] = [self.fc_client.tokenizer.clean_up_tokenization(e[2]) for e in js['evidence']]
|
62 |
js['questions'] = [self.fc_client.tokenizer.clean_up_tokenization(q) for q in js['questions']]
|
63 |
js['claim_phrases'] = [self.fc_client.tokenizer.clean_up_tokenization(a[0]) for a in js['answers']]
|