curtpond commited on
Commit
87806b7
1 Parent(s): d06f5b3

Updated app.py.

Browse files
Files changed (1) hide show
  1. app.py +3 -5
app.py CHANGED
@@ -26,15 +26,15 @@ def process_text(text):
26
  vectorizer = CountVectorizer()
27
  def vectorize_text(text):
28
  text = process_text(text)
29
- text = [text]
30
  return vectorizer.transform(text)
31
 
32
  # Load model from pickle file
33
  model = pickle.load(open(lr_filename, 'rb'))
34
 
35
-
36
  def predict(text):
37
- return model.predict([text])
 
 
38
 
39
 
40
  # Define interface
@@ -48,5 +48,3 @@ demo = gr.Interface(fn=predict,
48
 
49
  demo.launch()
50
 
51
-
52
-
 
26
  vectorizer = CountVectorizer()
27
  def vectorize_text(text):
28
  text = process_text(text)
 
29
  return vectorizer.transform(text)
30
 
31
  # Load model from pickle file
32
  model = pickle.load(open(lr_filename, 'rb'))
33
 
 
34
  def predict(text):
35
+ text = vectorize_text(text)
36
+ prediction = model.predict(text)
37
+ return prediction
38
 
39
 
40
  # Define interface
 
48
 
49
  demo.launch()
50