Spaces:
Running
on
CPU Upgrade
Running
on
CPU Upgrade
update texts in frontend
Browse files
app.py
CHANGED
@@ -14,16 +14,17 @@ from langdetect import detect
|
|
14 |
from matplotlib import pyplot as plt
|
15 |
import imageio
|
16 |
|
17 |
-
|
18 |
-
|
19 |
-
|
20 |
-
|
21 |
-
|
22 |
-
|
23 |
-
|
24 |
-
|
25 |
-
|
26 |
-
|
|
|
27 |
TITLE_FR = "Où aller ? Classification des départements & bureaux"
|
28 |
UNKNOWN_LANG_TEXT = (
|
29 |
"The language is not recognized, it must be either in German or in French."
|
@@ -164,9 +165,6 @@ def textclassification(SubmittedText):
|
|
164 |
return chosenCategoryTexts[0], images[0], chosenCategoryTexts[1], images[1]
|
165 |
|
166 |
|
167 |
-
# TODO set example picture upon loading
|
168 |
-
# TODO vielleicht ein paar Sachen zum Einstellen im Frontend?
|
169 |
-
|
170 |
# Launch UI
|
171 |
with gr.Blocks(
|
172 |
# Set theme matching BK CH
|
@@ -181,14 +179,16 @@ with gr.Blocks(
|
|
181 |
# Organize layout in three columns for input, prediction I and prediction II
|
182 |
with gr.Row():
|
183 |
with gr.Column(scale=2):
|
184 |
-
name = gr.Textbox(
|
|
|
|
|
185 |
predict_btn = gr.Button("Submit | Soumettre")
|
186 |
with gr.Column(scale=2):
|
187 |
-
output_text_dep = gr.Textbox(label="Departement
|
188 |
output_image_dep = gr.Image(label="Departement")
|
189 |
with gr.Column(scale=2):
|
190 |
-
output_text_office = gr.Textbox(label="
|
191 |
-
output_image_office = gr.Image(label="
|
192 |
|
193 |
predict_btn.click(
|
194 |
fn=textclassification,
|
|
|
14 |
from matplotlib import pyplot as plt
|
15 |
import imageio
|
16 |
|
17 |
+
DESCRIPTION = """Diese Anwendung teilt Vorstösse an das federführende Departement zu und
|
18 |
+
macht einen Vorschlag für das zuständige Amt. Der Vorschlag der Anwendung ist nicht
|
19 |
+
100% richtig. Der Zuteilungsvorschlag muss von einer Fachperson geprüft und die
|
20 |
+
effektive Zuteilung muss nach eigenem Ermessen erfolgen. \n\n
|
21 |
+
Cette application attribue les interventions au département chef de file et fait une
|
22 |
+
proposition à l'office compétent. La proposition de l'application n'est pas correcte
|
23 |
+
à 100%. La proposition d'attribution doit être vérifiée par un spécialiste et l'attribution
|
24 |
+
effective doit être faite à la discrétion de l'utilisateur."""
|
25 |
+
TITLE_DE = (
|
26 |
+
"Automatische Zuteilung von Vorstössen an das federführende Departement bzw. Amt"
|
27 |
+
)
|
28 |
TITLE_FR = "Où aller ? Classification des départements & bureaux"
|
29 |
UNKNOWN_LANG_TEXT = (
|
30 |
"The language is not recognized, it must be either in German or in French."
|
|
|
165 |
return chosenCategoryTexts[0], images[0], chosenCategoryTexts[1], images[1]
|
166 |
|
167 |
|
|
|
|
|
|
|
168 |
# Launch UI
|
169 |
with gr.Blocks(
|
170 |
# Set theme matching BK CH
|
|
|
179 |
# Organize layout in three columns for input, prediction I and prediction II
|
180 |
with gr.Row():
|
181 |
with gr.Column(scale=2):
|
182 |
+
name = gr.Textbox(
|
183 |
+
label="Vorstosstext:", lines=28, placeholder=PLACEHOLDER_TEXT
|
184 |
+
)
|
185 |
predict_btn = gr.Button("Submit | Soumettre")
|
186 |
with gr.Column(scale=2):
|
187 |
+
output_text_dep = gr.Textbox(label="Vorschlag Departement:")
|
188 |
output_image_dep = gr.Image(label="Departement")
|
189 |
with gr.Column(scale=2):
|
190 |
+
output_text_office = gr.Textbox(label="Vorschlag Amt:")
|
191 |
+
output_image_office = gr.Image(label="Amt")
|
192 |
|
193 |
predict_btn.click(
|
194 |
fn=textclassification,
|