import gradio as gr from transformers import pipeline classifier = pipeline("sentiment-analysis") def check_sentiment(phrase: str) -> str: classification = classifier(phrase) return classification[0]["label"] def main(): iface = gr.Interface(fn=check_sentiment, inputs="text", outputs="text") iface.launch() if __name__ == "__main__": main()