Spaces:
Sleeping
Sleeping
Update tasks/utils/predict.py
Browse files- tasks/utils/predict.py +3 -1
tasks/utils/predict.py
CHANGED
|
@@ -6,7 +6,7 @@ import sys
|
|
| 6 |
sys.path.append(".")
|
| 7 |
from tasks.utils.preprocessing import process_text
|
| 8 |
|
| 9 |
-
def predict(input_df: pd.DataFrame,
|
| 10 |
"""
|
| 11 |
Predict the output using a saved TF-IDF vectorizer and Random Forest model.
|
| 12 |
|
|
@@ -19,9 +19,11 @@ def predict(input_df: pd.DataFrame, tfidf_path: str, model_path: str):
|
|
| 19 |
Returns:
|
| 20 |
pd.Series: Predictions for each row in the input dataframe.
|
| 21 |
"""
|
|
|
|
| 22 |
# Load the TF-IDF vectorizer
|
| 23 |
with open(tfidf_path, "rb") as tfidf_file:
|
| 24 |
tfidf_vectorizer = pickle.load(tfidf_file)
|
|
|
|
| 25 |
|
| 26 |
# Load the Random Forest model
|
| 27 |
with open(model_path, "rb") as model_file:
|
|
|
|
| 6 |
sys.path.append(".")
|
| 7 |
from tasks.utils.preprocessing import process_text
|
| 8 |
|
| 9 |
+
def predict(input_df: pd.DataFrame, tfidf_vectorizer , model_path: str):
|
| 10 |
"""
|
| 11 |
Predict the output using a saved TF-IDF vectorizer and Random Forest model.
|
| 12 |
|
|
|
|
| 19 |
Returns:
|
| 20 |
pd.Series: Predictions for each row in the input dataframe.
|
| 21 |
"""
|
| 22 |
+
"""
|
| 23 |
# Load the TF-IDF vectorizer
|
| 24 |
with open(tfidf_path, "rb") as tfidf_file:
|
| 25 |
tfidf_vectorizer = pickle.load(tfidf_file)
|
| 26 |
+
"""
|
| 27 |
|
| 28 |
# Load the Random Forest model
|
| 29 |
with open(model_path, "rb") as model_file:
|