|
import gradio as gr |
|
import tensorflow as tf |
|
from fastai.vision.all import * |
|
|
|
|
|
learn = tf.keras.models.load_model('sentimentality.h5') |
|
|
|
|
|
def make_prediction(user_sentence): |
|
|
|
prediction = learn.predict(user_sentence) |
|
|
|
|
|
return prediction |
|
|
|
title = "Sentiment Analysis MyAnimeList Reviews with fastai" |
|
description = "<p style='text-align: center'>Identifier si un commentaire dans MyAnimeList est positif, neutre ou négatif.<br/> Permet de connaître rapidement le sentiment globale que dégage un avis sur le site.</p>" |
|
|
|
app = gr.Interface(fn=make_prediction, title=title, description=description, inputs=gr.TextArea(), outputs='text') |
|
|
|
app.launch() |