Spaces:
Sleeping
Sleeping
# This is a Gradio app that transliterates English text to Hindi. | |
import gradio as gr | |
from xlit_src import XlitEngine | |
# Define the transliteration function. | |
def transliterate(input_text): | |
# Initialize the transliteration engine. | |
engine = XlitEngine() | |
# Transliterate the input text. | |
result = engine.translit_sentence(input_text) | |
return result | |
# Create the input and output components. | |
input_box = gr.Textbox(type="text", label="Input Text") | |
output_box = gr.Textbox(label="Transliterated Text") | |
# Create the Gradio interface. | |
iface = gr.Interface( | |
fn=transliterate, | |
inputs=input_box, | |
outputs=output_box, | |
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"], | |
) | |
# Launch the interface with caching enabled. | |
iface.launch(cache_examples=True, show_error=True) |