File size: 712 Bytes
b28e047
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
a2d2f85
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34

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