File size: 1,014 Bytes
bd99d8d
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
ba59888
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
import gradio as gr
from backend.german_polish import polish_to_german_translation

#Each interface will have on input text and one output text
polish_to_german_examples = [
    ["Warszawa"],        # Warsaw
    ["Kraków"],          # Krakow
    ["Gdańsk"],          # Gdansk
    ["Wrocław"],         # Breslau
    ["Poznań"],          # Posen
    ["Łódź"],            # Lodz
    ["Szczecin"],        # Stettin
    ["Bydgoszcz"],       # Bromberg
    ["Lublin"],          # Lublin
    ["Katowice"],        # Kattowitz
]

german_polish_interface = gr.Interface(
    fn=polish_to_german_translation,
    inputs=gr.Textbox(label="Polish Text"),
    outputs=gr.Textbox(label="German Translation"),
    title="Polish to German Translator",
    description="Translate Polish toponym to German.",
    examples=polish_to_german_examples,
    cache_examples=False
)




tabbed_interface = gr.TabbedInterface(
    [german_polish_interface],
    ["Polish to German Translator"],
)

tabbed_interface.launch(share=False)