import gradio as gr import numpy as np #loading the saved model from keras.models import load_model model = load_model('model.h5') import gradio as gr def page(word): word_tk= tokenizer.texts_to_sequences([word]) word_pad= pad_sequences(word_tk, maxlen=10) prediction = model.predict(word_pad) f_prediction= np.argmax(prediction) if f_prediction == 1: return "Authentic" elif f_prediction ==2: return "Normal" elif f_prediction ==3: return "Not Authentic" else: return "Error" s demo = gr.Interface( fn=page, inputs=gr.Textbox(placeholder="Enter your review and the rating to check the authenticity of any product or page"), outputs="text", ) demo.launch() #end