Update app.py
Browse files
app.py
CHANGED
@@ -378,11 +378,11 @@ def gen_qa_who(df):
|
|
378 |
list_of_pairs = [(answer_evidence, answer[j])]
|
379 |
rouge_l_score = calc_rouge_l_score(answer_evidence, answer[j])
|
380 |
if rouge_l_score >= threshold:
|
381 |
-
verification_status = '
|
382 |
elif rouge_l_score == 0:
|
383 |
-
verification_status = 'Not verifiable'
|
384 |
else:
|
385 |
-
verification_status = '
|
386 |
rouge_l_scores.append(verification_status)
|
387 |
except:
|
388 |
pass
|
@@ -390,7 +390,7 @@ def gen_qa_who(df):
|
|
390 |
list_of_ques_who="No claims"
|
391 |
list_of_ans_who=""
|
392 |
list_of_evidence_answer_who="No mention of 'who'in any related documents."
|
393 |
-
rouge_l_scores="Not verifiable"
|
394 |
return list_of_ques_who,list_of_ans_who,list_of_evidence_answer_who,rouge_l_scores
|
395 |
#------------------------------------------------------------
|
396 |
# @st.cache
|
@@ -439,11 +439,11 @@ def gen_qa_what(df):
|
|
439 |
list_of_pairs = [(answer_evidence, answer[j])]
|
440 |
rouge_l_score = calc_rouge_l_score(answer_evidence, answer[j])
|
441 |
if rouge_l_score >= threshold:
|
442 |
-
verification_status = '
|
443 |
elif rouge_l_score == 0:
|
444 |
-
verification_status = 'Not verifiable'
|
445 |
else:
|
446 |
-
verification_status = '
|
447 |
rouge_l_scores.append(verification_status)
|
448 |
except:
|
449 |
pass
|
@@ -451,7 +451,7 @@ def gen_qa_what(df):
|
|
451 |
list_of_ques_what="No claims"
|
452 |
list_of_ans_what=""
|
453 |
list_of_evidence_answer_what="No mention of 'what'in any related documents."
|
454 |
-
rouge_l_scores="Not verifiable"
|
455 |
return list_of_ques_what,list_of_ans_what,list_of_evidence_answer_what,rouge_l_scores
|
456 |
#----------------------------------------------------------
|
457 |
# @st.cache
|
@@ -500,11 +500,11 @@ def gen_qa_why(df):
|
|
500 |
list_of_pairs = [(answer_evidence, answer[j])]
|
501 |
rouge_l_score = calc_rouge_l_score(answer_evidence, answer[j])
|
502 |
if rouge_l_score >= threshold:
|
503 |
-
verification_status = '
|
504 |
elif rouge_l_score == 0:
|
505 |
-
verification_status = 'Not verifiable'
|
506 |
else:
|
507 |
-
verification_status = '
|
508 |
rouge_l_scores.append(verification_status)
|
509 |
except:
|
510 |
pass
|
@@ -512,7 +512,7 @@ def gen_qa_why(df):
|
|
512 |
list_of_ques_why="No claims"
|
513 |
list_of_ans_why=""
|
514 |
list_of_evidence_answer_why="No mention of 'why'in any related documents."
|
515 |
-
rouge_l_scores="Not verifiable"
|
516 |
return list_of_ques_why,list_of_ans_why,list_of_evidence_answer_why,rouge_l_scores
|
517 |
|
518 |
#---------------------------------------------------------
|
@@ -561,11 +561,11 @@ def gen_qa_when(df):
|
|
561 |
list_of_pairs = [(answer_evidence, answer[j])]
|
562 |
rouge_l_score = calc_rouge_l_score(answer_evidence, answer[j])
|
563 |
if rouge_l_score >= threshold:
|
564 |
-
verification_status = '
|
565 |
elif rouge_l_score == 0:
|
566 |
-
verification_status = 'Not verifiable'
|
567 |
else:
|
568 |
-
verification_status = '
|
569 |
rouge_l_scores.append(verification_status)
|
570 |
except:
|
571 |
pass
|
@@ -573,7 +573,7 @@ def gen_qa_when(df):
|
|
573 |
list_of_ques_when="No claims"
|
574 |
list_of_ans_when=""
|
575 |
list_of_evidence_answer_when="No mention of 'when'in any related documents."
|
576 |
-
rouge_l_scores="Not verifiable"
|
577 |
return list_of_ques_when,list_of_ans_when,list_of_evidence_answer_when,rouge_l_scores
|
578 |
|
579 |
#------------------------------------------------------
|
@@ -622,11 +622,11 @@ def gen_qa_where(df):
|
|
622 |
list_of_pairs = [(answer_evidence, answer[j])]
|
623 |
rouge_l_score = calc_rouge_l_score(answer_evidence, answer[j])
|
624 |
if rouge_l_score >= threshold:
|
625 |
-
verification_status = '
|
626 |
elif rouge_l_score == 0:
|
627 |
-
verification_status = 'Not verifiable'
|
628 |
else:
|
629 |
-
verification_status = '
|
630 |
rouge_l_scores.append(verification_status)
|
631 |
except:
|
632 |
pass
|
@@ -634,7 +634,7 @@ def gen_qa_where(df):
|
|
634 |
list_of_ques_where="No claims"
|
635 |
list_of_ans_where=""
|
636 |
list_of_evidence_answer_where="No mention of 'where'in any related documents."
|
637 |
-
rouge_l_scores="Not verifiable"
|
638 |
return list_of_ques_where,list_of_ans_where,list_of_evidence_answer_where,rouge_l_scores
|
639 |
#------------------------------------------------------
|
640 |
|
|
|
378 |
list_of_pairs = [(answer_evidence, answer[j])]
|
379 |
rouge_l_score = calc_rouge_l_score(answer_evidence, answer[j])
|
380 |
if rouge_l_score >= threshold:
|
381 |
+
verification_status = 'β
Verified Valid'
|
382 |
elif rouge_l_score == 0:
|
383 |
+
verification_status = 'β Not verifiable'
|
384 |
else:
|
385 |
+
verification_status = 'β Verified False'
|
386 |
rouge_l_scores.append(verification_status)
|
387 |
except:
|
388 |
pass
|
|
|
390 |
list_of_ques_who="No claims"
|
391 |
list_of_ans_who=""
|
392 |
list_of_evidence_answer_who="No mention of 'who'in any related documents."
|
393 |
+
rouge_l_scores="β Not verifiable"
|
394 |
return list_of_ques_who,list_of_ans_who,list_of_evidence_answer_who,rouge_l_scores
|
395 |
#------------------------------------------------------------
|
396 |
# @st.cache
|
|
|
439 |
list_of_pairs = [(answer_evidence, answer[j])]
|
440 |
rouge_l_score = calc_rouge_l_score(answer_evidence, answer[j])
|
441 |
if rouge_l_score >= threshold:
|
442 |
+
verification_status = 'β
Verified Valid'
|
443 |
elif rouge_l_score == 0:
|
444 |
+
verification_status = 'β Not verifiable'
|
445 |
else:
|
446 |
+
verification_status = 'β Verified False'
|
447 |
rouge_l_scores.append(verification_status)
|
448 |
except:
|
449 |
pass
|
|
|
451 |
list_of_ques_what="No claims"
|
452 |
list_of_ans_what=""
|
453 |
list_of_evidence_answer_what="No mention of 'what'in any related documents."
|
454 |
+
rouge_l_scores="β Not verifiable"
|
455 |
return list_of_ques_what,list_of_ans_what,list_of_evidence_answer_what,rouge_l_scores
|
456 |
#----------------------------------------------------------
|
457 |
# @st.cache
|
|
|
500 |
list_of_pairs = [(answer_evidence, answer[j])]
|
501 |
rouge_l_score = calc_rouge_l_score(answer_evidence, answer[j])
|
502 |
if rouge_l_score >= threshold:
|
503 |
+
verification_status = 'β
Verified Valid'
|
504 |
elif rouge_l_score == 0:
|
505 |
+
verification_status = 'β Not verifiable'
|
506 |
else:
|
507 |
+
verification_status = 'β Verified False'
|
508 |
rouge_l_scores.append(verification_status)
|
509 |
except:
|
510 |
pass
|
|
|
512 |
list_of_ques_why="No claims"
|
513 |
list_of_ans_why=""
|
514 |
list_of_evidence_answer_why="No mention of 'why'in any related documents."
|
515 |
+
rouge_l_scores="β Not verifiable"
|
516 |
return list_of_ques_why,list_of_ans_why,list_of_evidence_answer_why,rouge_l_scores
|
517 |
|
518 |
#---------------------------------------------------------
|
|
|
561 |
list_of_pairs = [(answer_evidence, answer[j])]
|
562 |
rouge_l_score = calc_rouge_l_score(answer_evidence, answer[j])
|
563 |
if rouge_l_score >= threshold:
|
564 |
+
verification_status = 'β
Verified Valid'
|
565 |
elif rouge_l_score == 0:
|
566 |
+
verification_status = 'β Not verifiable'
|
567 |
else:
|
568 |
+
verification_status = 'β Verified False'
|
569 |
rouge_l_scores.append(verification_status)
|
570 |
except:
|
571 |
pass
|
|
|
573 |
list_of_ques_when="No claims"
|
574 |
list_of_ans_when=""
|
575 |
list_of_evidence_answer_when="No mention of 'when'in any related documents."
|
576 |
+
rouge_l_scores="β Not verifiable"
|
577 |
return list_of_ques_when,list_of_ans_when,list_of_evidence_answer_when,rouge_l_scores
|
578 |
|
579 |
#------------------------------------------------------
|
|
|
622 |
list_of_pairs = [(answer_evidence, answer[j])]
|
623 |
rouge_l_score = calc_rouge_l_score(answer_evidence, answer[j])
|
624 |
if rouge_l_score >= threshold:
|
625 |
+
verification_status = 'β
Verified Valid'
|
626 |
elif rouge_l_score == 0:
|
627 |
+
verification_status = 'β Not verifiable'
|
628 |
else:
|
629 |
+
verification_status = 'β Verified False'
|
630 |
rouge_l_scores.append(verification_status)
|
631 |
except:
|
632 |
pass
|
|
|
634 |
list_of_ques_where="No claims"
|
635 |
list_of_ans_where=""
|
636 |
list_of_evidence_answer_where="No mention of 'where'in any related documents."
|
637 |
+
rouge_l_scores="β Not verifiable"
|
638 |
return list_of_ques_where,list_of_ans_where,list_of_evidence_answer_where,rouge_l_scores
|
639 |
#------------------------------------------------------
|
640 |
|