Priyanhsu commited on
Commit
11b5667
·
1 Parent(s): d9bcc3e

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -3
app.py CHANGED
@@ -18,16 +18,17 @@ import nltk
18
  nltk.download('stopwords')
19
  nltk.download('punkt')
20
 
 
21
  model = joblib.load('model.bin')
22
 
23
- # Initialize the vectorizer
24
- vectorizer = CountVectorizer()
25
 
26
  def remove_punctuation(text):
27
  punctuation_free = "".join([i for i in text if i not in string.punctuation])
28
  return punctuation_free
29
 
30
- def test_model(text, vectorizer):
31
  # Convert text to lowercase
32
  text = text.lower()
33
 
 
18
  nltk.download('stopwords')
19
  nltk.download('punkt')
20
 
21
+ # Load the trained model
22
  model = joblib.load('model.bin')
23
 
24
+ # Load the pre-trained vectorizer
25
+ vectorizer = joblib.load('vectorizer.bin')
26
 
27
  def remove_punctuation(text):
28
  punctuation_free = "".join([i for i in text if i not in string.punctuation])
29
  return punctuation_free
30
 
31
+ def test_model(text):
32
  # Convert text to lowercase
33
  text = text.lower()
34