|
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 using <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) |