from googletrans import Translator import gradio as gr def translate(text): translator = Translator() result = translator.translate(text, dest='en') translation = result.text pronunciation = translator.translate(translation, dest='ja').pronunciation return f"Pronunciation: {pronunciation}", f"Translation: {translation}" iface = gr.Interface( fn=translate, inputs="text", outputs=["text", "text"], output_labels=["Pronunciation", "Translation"], title="Japanese to English Translator" ) iface.launch()