Spaces:
Build error
Build error
Commit ·
24cbc9a
1
Parent(s): 5d30bf1
update
Browse files3 unmodified lines45678910148 unmodified lines15916016116116216316216316416516616728 unmodified lines19619719819920020120220320420520620720820921021121221321421521621721821922022122216 unmodified lines2392402412202422432442453 unmodified linesimport osimport stringimport loggingfrom datetime import datetime
# Set up logginglogging.basicConfig(level=logging.INFO,148 unmodified lines
# statement = "Please make a decision to Accept/Reject the AI prediction based on the explanation." statement = """The Table Question Answering model is working on Table Fact Verification task (TabFact dataset), verifying if a given Statement is TRUE or FALSE on a given input Table.You are given an explanation that describes the reasoning process of the Table Question Answering model in HTML format. Please carefully analyze the explanation and determine you should Accept or Reject the AI prediction.A Table Question Answering model is working on Table Fact Verification task (TabFact dataset), verifying if a given Statement is TRUE or FALSE on a given input Table.You are given an explanation that describes the reasoning process of the Table QA model. Please carefully analyze the explanation and determine whether you should Accept or Reject the AI prediction. """
return render_template('experiment.html',28 unmodified lines # Save updated session data save_session_data(username, session_data)
# Write feedback to a separate JSON file os.makedirs('session_data', exist_ok=True) feedback_file = f'session_data/{username}_feedback.json'
if os.path.exists(feedback_file): with open(feedback_file, 'r') as f: feedback_data = json.load(f) else: feedback_data = []
feedback_data.append({ 'sample_id': session_data['current_index'] - 1, 'feedback': feedback, 'timestamp': datetime.now().isoformat() })
with open(feedback_file, 'w') as f: json.dump(feedback_data, f, indent=4)
logger.info(f"Feedback saved for user {username}, sample {session_data['current_index'] - 1}")
if session_data['current_index'] >= len(session_data['selected_samples']): return redirect(url_for('completed', username=username))
16 unmodified lines if method == "Chain-of-Table": json_file = 'Tabular_LLMs_human_study_vis_6_COT.json' else: # Default to Plan-of-SQLs json_file = 'Tabular_LLMs_human_study_vis_6.json' json_file = 'Tabular_LLMs_human_study_vis_6_POS.json'
with open(json_file, 'r') as f: ground_truth = json.load(f)app.py+26-4