kpal002 commited on
Commit
86e8be5
·
verified ·
1 Parent(s): 2ae9623

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -2
app.py CHANGED
@@ -246,7 +246,7 @@ def process_pdf(uploaded_files, llm_model, n_criteria = num_criteria):
246
  # Evaluate with OpenAI model
247
  total_score, criteria_met, score_percentage, score_list, reasoning = pdf_criteria_query.evaluate_with_llm(registration_result, peer_journal_result, eq_journal_result, queries)
248
 
249
- print(id_number,title,author_result)
250
  try:
251
  # Define the path to your CSV file
252
  csv_file_path = 'storing_output.csv'
@@ -263,14 +263,16 @@ def process_pdf(uploaded_files, llm_model, n_criteria = num_criteria):
263
 
264
  # Convert new_row dictionary to a DataFrame for easy appending
265
  new_row_df = pd.DataFrame([new_row])
266
- print(new_row_df)
267
 
268
  # Check if the CSV file exists
269
  if os.path.exists(csv_file_path):
270
  # Load the existing data
 
271
  df = pd.read_csv(csv_file_path)
272
  else:
273
  # Or create a new DataFrame if the file does not exist
 
274
  columns = ['Id', 'Title', 'Author'] + [f'score_cr_{i}' for i in range(1, 10)] + [f'reasoning_cr_{i}' for i in range(1, 10)]
275
  df = pd.DataFrame(columns=columns)
276
 
 
246
  # Evaluate with OpenAI model
247
  total_score, criteria_met, score_percentage, score_list, reasoning = pdf_criteria_query.evaluate_with_llm(registration_result, peer_journal_result, eq_journal_result, queries)
248
 
249
+
250
  try:
251
  # Define the path to your CSV file
252
  csv_file_path = 'storing_output.csv'
 
263
 
264
  # Convert new_row dictionary to a DataFrame for easy appending
265
  new_row_df = pd.DataFrame([new_row])
266
+ logger.debug("New row DataFrame:\n%s", new_row_df)
267
 
268
  # Check if the CSV file exists
269
  if os.path.exists(csv_file_path):
270
  # Load the existing data
271
+ logger.debug("CSV file exists. Loading existing data.")
272
  df = pd.read_csv(csv_file_path)
273
  else:
274
  # Or create a new DataFrame if the file does not exist
275
+ logger.debug("CSV file does not exist. Creating a new DataFrame.")
276
  columns = ['Id', 'Title', 'Author'] + [f'score_cr_{i}' for i in range(1, 10)] + [f'reasoning_cr_{i}' for i in range(1, 10)]
277
  df = pd.DataFrame(columns=columns)
278