srivarshan commited on
Commit
dc40079
·
1 Parent(s): 710f00d

Add prediction functionality

Browse files
Files changed (1) hide show
  1. app.py +3 -2
app.py CHANGED
@@ -8,8 +8,9 @@ os.system("cp -r ./nltk_data/ /home/user/nltk_data")
8
  def analyze(text):
9
  model = CustomModel()
10
  text = preprocess_pipeline(text)
11
- text = vectorizer([text])
12
- return text.shape
 
13
 
14
  app = gr.Interface(fn=analyze, inputs="text", outputs="text")
15
 
 
8
  def analyze(text):
9
  model = CustomModel()
10
  text = preprocess_pipeline(text)
11
+ vector = vectorizer([text])
12
+ pred = model.predict(vector)
13
+ return pred
14
 
15
  app = gr.Interface(fn=analyze, inputs="text", outputs="text")
16