File size: 506 Bytes
949c5da
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
import gradio as gr
from lid import identify_and_plot, LID_EXAMPLES

lid_indentify = gr.Interface(
    fn=identify_and_plot,
    inputs=gr.Textbox(lines=2, label="Input text"),
    outputs=[gr.Textbox(label="Language"), gr.Plot(label="Confidence Plot")],
    examples=LID_EXAMPLES,
    title="Language Identification Demo",
    description="Identify the language of input text and view confidence levels.",
    allow_flagging="never",
)

with gr.Blocks() as demo:
    lid_indentify.render()

demo.launch()