Afeezee commited on
Commit
5b9c581
·
verified ·
1 Parent(s): 13b148b

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -2
app.py CHANGED
@@ -76,6 +76,7 @@ def fact_check_with_llama3(query):
76
 
77
  def map_politifact_label(label):
78
  label_mapping = {
 
79
  "false": "False",
80
  "half-true": "Misleading",
81
  "mostly-true": "Misleading",
@@ -94,11 +95,11 @@ def evaluate_politifact(csv_file):
94
  start_time = time.time()
95
  facto_result, sources = fact_check_with_llama3(claim)
96
  time_taken = time.time() - start_time
97
- accuracy = "100% Accurate" if facto_result.lower() == actual_label.lower() else "Not Accurate"
98
 
99
  results.append([claim, facto_result, actual_label, time_taken, sources, accuracy])
100
 
101
- results_df = pd.DataFrame(results, columns=["Claim", "Facto Verdict", "Politifact Verdict", "Time Taken (s)", "Sources", "Accuracy"])
102
  output_csv = "fact_check_results.csv"
103
  results_df.to_csv(output_csv, index=False)
104
 
 
76
 
77
  def map_politifact_label(label):
78
  label_mapping = {
79
+ "pants-fire": "False",
80
  "false": "False",
81
  "half-true": "Misleading",
82
  "mostly-true": "Misleading",
 
95
  start_time = time.time()
96
  facto_result, sources = fact_check_with_llama3(claim)
97
  time_taken = time.time() - start_time
98
+ accuracy = "100" if facto_result.lower() == actual_label.lower() else "0"
99
 
100
  results.append([claim, facto_result, actual_label, time_taken, sources, accuracy])
101
 
102
+ results_df = pd.DataFrame(results, columns=["Claim", "Facto Verdict", "Politifact Verdict", "Time Taken (s)", "Accuracy"])
103
  output_csv = "fact_check_results.csv"
104
  results_df.to_csv(output_csv, index=False)
105