import gradio as gr from svm_predict import predict def process_sentence(sentence): words, tags = predict(sentence) return " ".join([f"{word}_{tag}" for word, tag in zip(words, tags)]) iface = gr.Interface( fn=process_sentence, inputs=gr.Textbox(label="Enter a sentence", lines=4), outputs=gr.HTML(label="NEI tagged sentence", elem_id="output-box"), css=""" #input-box { width: 50%; height: 150px; } #output-box { overflow-y: scroll; /* Always allow vertical scrolling */ padding: 10px; border-radius: 5px; box-sizing: border-box; /* Ensures padding is included */ white-space: pre-wrap; /* Ensure the text wraps to avoid horizontal scrolling */ } """, live=False ) iface.launch(share=True)