import gradio as gr from fastai.vision.all import * # Load the model learn = load_learner('export.pkl') # Prediction function def make_prediction(user_sentence): prediction = learn.predict(user_sentence) dict = {'1': 'Negative', '2': 'Neutral', '3': 'Positive'} return dict[prediction[0]] title = "Sentiment Analysis MyAnimeList Reviews with fastai" description = "

Identifier si un commentaire dans MyAnimeList est positif, neutre ou négatif.
Permet de connaître rapidement le sentiment globale que dégage un avis sur le site.

" app = gr.Interface(fn=make_prediction, title=title, description=description, inputs=gr.TextArea(), outputs='text') app.launch()