Spaces:
Build error
Build error
Commit
·
5970cbf
1
Parent(s):
d984b22
Added Examples and Information
Browse files
app.py
CHANGED
@@ -48,6 +48,42 @@ text = gr.inputs.Textbox(lines=5, placeholder="Enter Text to translate",
|
|
48 |
default="", label="Enter Text in Source Language")
|
49 |
|
50 |
supported_lang = ', '.join(languages)
|
51 |
-
|
52 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
53 |
iface.launch(enable_queue=True)
|
|
|
48 |
default="", label="Enter Text in Source Language")
|
49 |
|
50 |
supported_lang = ', '.join(languages)
|
51 |
+
|
52 |
+
interface_article = """
|
53 |
+
<html>
|
54 |
+
<body>
|
55 |
+
<div>
|
56 |
+
<h1>
|
57 |
+
About
|
58 |
+
</h1>
|
59 |
+
<h4>
|
60 |
+
Original repository can be found at <a href="https://github.com/AI4Bharat/indicTrans">here</a>.
|
61 |
+
</h4>
|
62 |
+
<br/>
|
63 |
+
<span>
|
64 |
+
The models used in this interface are multilingual single-script transformer based models for translating between English and Indian languages. The models are trained using the Samanantar corpus and at the time of their release was the state of the art open source model as evaluated on Facebook's FLORES benchmark.
|
65 |
+
</span>
|
66 |
+
<br/>
|
67 |
+
<h3>
|
68 |
+
Usage:
|
69 |
+
</h3>
|
70 |
+
<ul>
|
71 |
+
<li>Choose the Source Language and Target Language for translation.</li>
|
72 |
+
<li>Enter your text in source language in the textbox.</li>
|
73 |
+
<li>Click Submit and view your translated output.</li>
|
74 |
+
</ul>
|
75 |
+
</div>
|
76 |
+
</body>
|
77 |
+
</html>
|
78 |
+
"""
|
79 |
+
|
80 |
+
examples = [
|
81 |
+
["A farmer lives in a village", "English", "Hindi"],
|
82 |
+
["एक गाव मे एक किसान रहता ता", "Hindi", "English"],
|
83 |
+
["एक गाव मे एक किसान रहता ता", "Hindi", "Tamil"]
|
84 |
+
]
|
85 |
+
|
86 |
+
|
87 |
+
iface = gr.Interface(fn=translate, inputs=[text, fromChoice, toChoice], outputs=text_output, title='IndicTrans - Multilingual Translation', description='Currently the model supports ' +
|
88 |
+
supported_lang, article=interface_article, examples=examples)
|
89 |
iface.launch(enable_queue=True)
|