# 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 NEWS2018 DATASET_04', article='Author: Anurag Singh . Using training and inference script from AI4Bharat/IndianNLP-Transliteration

', examples=["Namaste"], ) # Launch the interface with caching enabled. iface.launch(show_api=False, mcp_server=True)