Skip to content

Commit

Permalink
nb lin regression model method name fix
Browse files Browse the repository at this point in the history
  • Loading branch information
jonasgabriel18 committed Oct 30, 2023
1 parent 43e9f68 commit 26155b6
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 9 deletions.
8 changes: 4 additions & 4 deletions api/DataProcesser.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import pandas as pd
from NbNewsModel import NbNewsModel
from NbEmotionsModel import make_prediction
from NbLinRegressionModel import make_prediction
from NbLinRegressionModel import make_prediction_nblin
from io import BytesIO
import nltk
import re
Expand Down Expand Up @@ -45,12 +45,12 @@ def classify_emotions(self, df):
self.preprocess_text).apply(make_prediction)
result_csv = df # converte o df pra csv
return result_csv

def lin_regression_model(self, df):
df['output_column'] = df['input_column'].apply(
self.preprocess_text).apply(make_prediction)
self.preprocess_text).apply(make_prediction_nblin)
result_csv = df # converte o df pra csv
return result_csv


# TODO métodos com o processamento de classificação
4 changes: 2 additions & 2 deletions api/NbLinRegressionModel.py
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
import pickle

def make_prediction(my_sentence):
def make_prediction_nblin(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"
Expand Down
6 changes: 3 additions & 3 deletions main.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,10 @@ function createWindow() {
show: false, // Ocultar a janela até que esteja pronta
//fullscreen: true,
});
win.loadURL("http://localhost:3000/"); // carrega a página hospedada localmente
//win.loadFile(path.join(__dirname, "./build/index.html")); // carrega a build do react
//win.loadURL("http://localhost:3000/"); // carrega a página hospedada localmente
win.loadFile(path.join(__dirname, "./build/index.html")); // carrega a build do react

/*
/*
win.loadURL(
url.format({
pathname: path.join(__dirname, "./build/index.html"), // relative path to the HTML-file
Expand Down

0 comments on commit 26155b6

Please sign in to comment.