| import gradio as gr | |
| import pandas as pd | |
| import numpy as np | |
| from transformers import pipeline | |
| def analyze(poem): | |
| classifier = pipeline("text-classification", model="j-hartmann/emotion-english-distilroberta-base", return_all_scores=True) | |
| return classifier(poem) | |
| gr.Interface( | |
| fn=analyze, | |
| inputs= 'text', | |
| outputs="text", | |
| allow_flagging=False,).launch(share=True); |