BK-AI commited on
Commit
53b0cab
·
1 Parent(s): 8aa124c

update texts in frontend

Browse files
Files changed (1) hide show
  1. app.py +17 -17
app.py CHANGED
@@ -14,16 +14,17 @@ from langdetect import detect
14
  from matplotlib import pyplot as plt
15
  import imageio
16
 
17
- # move constants into extra file
18
- DESCRIPTION = """Diese Anwendung klassifiziert Vorstöße in Departements und schlägt auch ein
19
- mögliches Office vor. Bitte bewerten Sie für sich, ob Sie dem Office-Vorschlag
20
- nachkommen wollen, oder Ihren Vorstoß in einem anderen Office sehen, und leiten Sie
21
- nach eigenem Ermessen weiter. \n\n
22
- Cette application classe les requêtes dans les départements et propose également un
23
- office possible. Veuillez évaluer pour vous-même si vous souhaitez suivre la
24
- proposition d'office ou si vous souhaitez voir votre démarche dans un autre office
25
- et transmettez à votre discrétion."""
26
- TITLE_DE = "Automatisierte Einteilung von Vorstößen in Departements & Offices"
 
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(label="", lines=28, placeholder=PLACEHOLDER_TEXT)
 
 
185
  predict_btn = gr.Button("Submit | Soumettre")
186
  with gr.Column(scale=2):
187
- output_text_dep = gr.Textbox(label="Departement prediction:")
188
  output_image_dep = gr.Image(label="Departement")
189
  with gr.Column(scale=2):
190
- output_text_office = gr.Textbox(label="Office prediction:")
191
- output_image_office = gr.Image(label="Office")
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,