File size: 1,052 Bytes
f2874d4
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
40201a5
8cfca7c
b921c58
f2874d4
 
b921c58
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
import gradio as gr
from xlit_src import XlitEngine


def transliterate(input_text):
    engine = XlitEngine()
    result = engine.translit_sentence(input_text)
    return result


input_box = gr.inputs.Textbox(type="str", label="Input Text")
target = gr.outputs.Textbox()

iface = gr.Interface(
    transliterate,
    input_box,
    target,
    title="English to Hindi Transliteration",
    description='Model for Transliterating English to Hindi using a Character-level recurrent sequence-to-sequence trained with <a href="http://workshop.colips.org/news2018/dataset.html">NEWS2018 DATASET_04</a>',
    article='Author: <a href="https://huggingface.co/anuragshas">Anurag Singh</a> . Using training and inference script from <a href="https://github.com/AI4Bharat/IndianNLP-Transliteration.git">AI4Bharat/IndianNLP-Transliteration</a><p><center><img src="https://visitor-badge.glitch.me/badge?page_id=anuragshas/en-hi-transliteration" alt="visitor badge"></center></p>',
    examples=["Namaste"],
)

iface.launch(enable_queue=True, cache_examples=True)