Spaces:
Running
Running
small update
Browse files
Home.py
CHANGED
|
@@ -28,26 +28,24 @@ legislature_periods = [
|
|
| 28 |
"1. Legislaturperiode"
|
| 29 |
]
|
| 30 |
|
| 31 |
-
partys = ['All','CDU/CSU','SPD','AfD','Grüne','FDP','DIE LINKE.','GB/BHE','DRP', 'WAV', 'NR', 'BP', 'FU', 'SSW', 'KPD', 'DA', 'FVP','DP','Z', 'PDS','Fraktionslos',
|
| 32 |
|
| 33 |
|
| 34 |
|
| 35 |
with gr.Blocks() as App:
|
| 36 |
with gr.Tab("ChatBot"):
|
| 37 |
with gr.Blocks():
|
| 38 |
-
|
| 39 |
-
|
| 40 |
-
|
|
|
|
| 41 |
|
| 42 |
-
|
| 43 |
-
|
| 44 |
gr.ChatInterface(chatbot,
|
| 45 |
title="PoliticsToYou",
|
| 46 |
description= "Ask anything about your favorite political topic from any legislature period",
|
| 47 |
#examples=["Wie steht die CDU zur Cannabislegalisierung?", "Wie steht die FDP zur Rente?", "Was wird für die Rechte von LGBTQ getan?", "Sollen wir Waffen an die Ukraine liefern"],
|
| 48 |
cache_examples=False, #true increases loading time
|
| 49 |
additional_inputs = [db_inputs, prompt_language],
|
| 50 |
-
additional_inputs_accordion="Additional inputs"
|
| 51 |
)
|
| 52 |
|
| 53 |
with gr.Tab("KeywordSearch"):
|
|
@@ -113,7 +111,7 @@ with gr.Blocks() as App:
|
|
| 113 |
)
|
| 114 |
|
| 115 |
with gr.Tab("About"):
|
| 116 |
-
gr.Markdown("""<
|
| 117 |
|
| 118 |
<p>Would you like to gain insights into political debates or reveal party positions on specific topics from any legislature?</p>
|
| 119 |
<ul>
|
|
@@ -122,7 +120,7 @@ with gr.Blocks() as App:
|
|
| 122 |
<p>Enjoy your journey! </p>
|
| 123 |
<p>Looking forward to your feedback! <a href="mailto:tomklotz@gmx.net">tomklotz@gmx.net</a></p>
|
| 124 |
|
| 125 |
-
<
|
| 126 |
<ul>
|
| 127 |
<li>Experiment with different LLMs and Templates</li>
|
| 128 |
<li>Include chat history in RAG</li>
|
|
|
|
| 28 |
"1. Legislaturperiode"
|
| 29 |
]
|
| 30 |
|
| 31 |
+
partys = ['All','CDU/CSU','SPD','AfD','Grüne','FDP','DIE LINKE.','GB/BHE','DRP', 'WAV', 'NR', 'BP', 'FU', 'SSW', 'KPD', 'DA', 'FVP','DP','Z', 'PDS','Fraktionslos','not found', 'Gast']
|
| 32 |
|
| 33 |
|
| 34 |
|
| 35 |
with gr.Blocks() as App:
|
| 36 |
with gr.Tab("ChatBot"):
|
| 37 |
with gr.Blocks():
|
| 38 |
+
with gr.Accordion(open=False, label="Filter database"):
|
| 39 |
+
# Apply RAG using chatbut function from local file ChatBot.py
|
| 40 |
+
db_inputs = gr.Dropdown(choices=legislature_periods, value="All", multiselect=True, label="Legislature", info="Select a combination of legislatures as basis for the chatbot's replies", show_label=True)
|
| 41 |
+
prompt_language = gr.Dropdown(choices=["DE", "EN"], value="DE",label="Language", info="Choose output language", multiselect=False)
|
| 42 |
|
|
|
|
|
|
|
| 43 |
gr.ChatInterface(chatbot,
|
| 44 |
title="PoliticsToYou",
|
| 45 |
description= "Ask anything about your favorite political topic from any legislature period",
|
| 46 |
#examples=["Wie steht die CDU zur Cannabislegalisierung?", "Wie steht die FDP zur Rente?", "Was wird für die Rechte von LGBTQ getan?", "Sollen wir Waffen an die Ukraine liefern"],
|
| 47 |
cache_examples=False, #true increases loading time
|
| 48 |
additional_inputs = [db_inputs, prompt_language],
|
|
|
|
| 49 |
)
|
| 50 |
|
| 51 |
with gr.Tab("KeywordSearch"):
|
|
|
|
| 111 |
)
|
| 112 |
|
| 113 |
with gr.Tab("About"):
|
| 114 |
+
gr.Markdown("""<h2>Welcome to <strong>Politics2you</strong> - your playground for investigating the heart of politics in Germany</h2>
|
| 115 |
|
| 116 |
<p>Would you like to gain insights into political debates or reveal party positions on specific topics from any legislature?</p>
|
| 117 |
<ul>
|
|
|
|
| 120 |
<p>Enjoy your journey! </p>
|
| 121 |
<p>Looking forward to your feedback! <a href="mailto:tomklotz@gmx.net">tomklotz@gmx.net</a></p>
|
| 122 |
|
| 123 |
+
<h3>Further improvements & Ideas:</h3>
|
| 124 |
<ul>
|
| 125 |
<li>Experiment with different LLMs and Templates</li>
|
| 126 |
<li>Include chat history in RAG</li>
|