kpal002 commited on
Commit
3bf3e60
·
verified ·
1 Parent(s): 6ba811c

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -8
app.py CHANGED
@@ -209,19 +209,15 @@ def process_pdf(uploaded_files, llm_model, n_criteria = num_criteria):
209
  # Evaluate with OpenAI model
210
  total_score, criteria_met, score_percentage, reasoning = pdf_criteria_query.evaluate_with_llm(registration_result, peer_journal_result, eq_journal_result, queries)
211
 
212
- reasoning_html = "<ul>"
213
- for query, reason in zip(criteria, reasoning):
214
- reasoning_html += f"<li style='font-size: 18px;'><strong style='color: forestgreen;'>{query}</strong> <br> Reasoning: {reason}</li>"
215
- reasoning_html += "</ul>"
216
 
217
  # Generate the score bar HTML
218
  score_bar_html = generate_score_bar(total_score, n_criteria)
219
-
220
- author_info_html = f"<div style='font-size: 18px;'>{author_result}</div>"
221
- title_info_html = f"<div style='font-size: 20px;'>{title}</div>"
222
 
223
  output_path = f"/tmp/paper_report_{i+1}.pdf"
224
- create_pdf_report(title_info_html, author_info_html, total_score, reasoning_html, output_path)
225
  output_files.append(output_path)
226
 
227
  # Construct the processing message
 
209
  # Evaluate with OpenAI model
210
  total_score, criteria_met, score_percentage, reasoning = pdf_criteria_query.evaluate_with_llm(registration_result, peer_journal_result, eq_journal_result, queries)
211
 
212
+ # Convert reasoning list to plain text
213
+ reasoning_text = "\n".join([f"{idx + 1}. {reason}" for idx, reason in enumerate(reasoning)])
214
+
 
215
 
216
  # Generate the score bar HTML
217
  score_bar_html = generate_score_bar(total_score, n_criteria)
 
 
 
218
 
219
  output_path = f"/tmp/paper_report_{i+1}.pdf"
220
+ create_pdf_report(title, author_result, total_score, reasoning_html, output_path)
221
  output_files.append(output_path)
222
 
223
  # Construct the processing message