BtB-ExpC commited on
Commit
345f778
·
verified ·
1 Parent(s): 4707d8f

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +11 -6
app.py CHANGED
@@ -67,10 +67,11 @@ Verander hierbij zo min mogelijk aan de rest van de zin, verander alleen de doel
67
 
68
  def display_results(grouped_results):
69
  for html_id, results in grouped_results.items():
70
- print(f"HTML (ID: {html_id})")
71
  for result in results:
72
- print(f" - {result}")
73
- print("\n") # Ensure this newline is working; add another for more spacing
 
74
 
75
 
76
  inputs = [
@@ -80,12 +81,16 @@ inputs = [
80
  ]
81
  outputs = gr.Textbox(label="Result", show_copy_button=True)
82
 
 
 
 
 
83
  # Create the Gradio interface with HTML-formatted output
84
  iface = gr.Interface(
85
- fn=process_course,
86
  inputs=inputs,
87
- outputs=outputs,
88
- title="Doelgroepsanalyse",
89
  description="Voer de tekst van een module in en druk op 'Submit'."
90
  )
91
 
 
67
 
68
  def display_results(grouped_results):
69
  for html_id, results in grouped_results.items():
70
+ markdown_output += f"### HTML (ID: {html_id})\n"
71
  for result in results:
72
+ markdown_output += f"- {result}\n"
73
+ markdown_output += "\n---\n" # Markdown horizontal line for separation
74
+ return markdown_output
75
 
76
 
77
  inputs = [
 
81
  ]
82
  outputs = gr.Textbox(label="Result", show_copy_button=True)
83
 
84
+ def interface_function(input_text):
85
+ results = process_course(input_text)
86
+ return display_results(results)
87
+
88
  # Create the Gradio interface with HTML-formatted output
89
  iface = gr.Interface(
90
+ fn=interface_function,
91
  inputs=inputs,
92
+ outputs="markdown",
93
+ title="Doelgroepanalyse",
94
  description="Voer de tekst van een module in en druk op 'Submit'."
95
  )
96