Spaces:
Sleeping
Sleeping
| import gradio as gr | |
| from EmotionClassifier.EmotionPredictor import EmotionPredictor | |
| from NER_Wrapper.NER_Wrapper import FullNERPipeline | |
| import pandas as pd | |
| emotion_predictor,ner_pipe = EmotionPredictor(),FullNERPipeline() | |
| def predict(description): | |
| ner_text = ner_pipe.process_text(description) | |
| emotions = emotion_predictor(ner_text) | |
| return pd.DataFrame(emotions) | |
| iface = gr.Interface( | |
| fn=predict, | |
| inputs=gr.TextArea(), | |
| outputs="dataframe", | |
| live=False, | |
| title="Emotion Prediction" | |
| ) | |
| iface.launch(inline=False) |