Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -3,7 +3,7 @@ import pandas as pd
|
|
3 |
import numpy as np
|
4 |
from sklearn.feature_extraction.text import CountVectorizer
|
5 |
from sklearn.ensemble import RandomForestClassifier
|
6 |
-
import
|
7 |
|
8 |
import warnings
|
9 |
warnings.filterwarnings('ignore')
|
@@ -71,7 +71,7 @@ if uploaded_file is not None:
|
|
71 |
df_ext = pd.concat([df, text_vectors_df],axis=1)
|
72 |
df = df_ext.drop(['GMN','Product_Description','EA_GTIN','CV_GTIN'],axis=1)
|
73 |
|
74 |
-
loaded_model =
|
75 |
result = loaded_model.predict(df)
|
76 |
data['Product_Type_Predicted']=result
|
77 |
|
|
|
3 |
import numpy as np
|
4 |
from sklearn.feature_extraction.text import CountVectorizer
|
5 |
from sklearn.ensemble import RandomForestClassifier
|
6 |
+
import joblib
|
7 |
|
8 |
import warnings
|
9 |
warnings.filterwarnings('ignore')
|
|
|
71 |
df_ext = pd.concat([df, text_vectors_df],axis=1)
|
72 |
df = df_ext.drop(['GMN','Product_Description','EA_GTIN','CV_GTIN'],axis=1)
|
73 |
|
74 |
+
loaded_model = joblib.load(open('rfc_model_grid.sav', 'rb'))
|
75 |
result = loaded_model.predict(df)
|
76 |
data['Product_Type_Predicted']=result
|
77 |
|