Skip to content

Commit

Permalink
lin reg
Browse files Browse the repository at this point in the history
  • Loading branch information
cmaloney111 committed Oct 27, 2023
1 parent 53c5d24 commit 30d09d8
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions api/NbLinRegressionModel.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
import pickle

def make_prediction(my_sentence):
with open("./models/vectorizer_lin.pkl", "rb") as f:
vectorizer = pickle.load(f)

with open("./models/linear_reg.pkl", "rb") as f:
model = pickle.load(f)

new_sentence = vectorizer.transform(my_sentence)

prediction = model.predict(new_sentence)
if prediction == 0:
return "Negativo"
else:
return "Positivo"
Binary file added api/models/linear_reg.pkl
Binary file not shown.
Binary file added api/models/vectorizer_lin.pkl
Binary file not shown.

0 comments on commit 30d09d8

Please sign in to comment.