Spaces:
Sleeping
Sleeping
Update app.py
Browse files
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 |
-
|
| 71 |
for result in results:
|
| 72 |
-
|
| 73 |
-
|
|
|
|
| 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=
|
| 86 |
inputs=inputs,
|
| 87 |
-
outputs=
|
| 88 |
-
title="
|
| 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 |
|