Update app/routes.py
Browse files- app/routes.py +0 -7
app/routes.py
CHANGED
|
@@ -4,7 +4,6 @@ from concurrent.futures import ThreadPoolExecutor
|
|
| 4 |
from app.utils.ocr import extract_text_from_image
|
| 5 |
from app.utils.ner import extract_ingredients
|
| 6 |
from app.utils.prediction import predict_with_description
|
| 7 |
-
from app.utils.recommendation import recommend_similar_products
|
| 8 |
from app.utils.helper import correct_spelling, load_data
|
| 9 |
|
| 10 |
analyze_blueprint = Blueprint('analyze', __name__)
|
|
@@ -62,15 +61,9 @@ def analyze_ingredients():
|
|
| 62 |
results = list(executor.map(lambda ing: predict_with_description(ing, df_cosing), corrected))
|
| 63 |
logging.info(f"Prediction results: {results}")
|
| 64 |
|
| 65 |
-
# Recommend products
|
| 66 |
-
logging.info("Generating product recommendations")
|
| 67 |
-
recommendations = recommend_similar_products(corrected, df_brand, product_embeddings)
|
| 68 |
-
logging.info(f"Product recommendations: {recommendations}")
|
| 69 |
-
|
| 70 |
|
| 71 |
return jsonify({
|
| 72 |
"Ingredient Analysis": results,
|
| 73 |
-
"Product Recommendations": recommendations,
|
| 74 |
})
|
| 75 |
|
| 76 |
except Exception as e:
|
|
|
|
| 4 |
from app.utils.ocr import extract_text_from_image
|
| 5 |
from app.utils.ner import extract_ingredients
|
| 6 |
from app.utils.prediction import predict_with_description
|
|
|
|
| 7 |
from app.utils.helper import correct_spelling, load_data
|
| 8 |
|
| 9 |
analyze_blueprint = Blueprint('analyze', __name__)
|
|
|
|
| 61 |
results = list(executor.map(lambda ing: predict_with_description(ing, df_cosing), corrected))
|
| 62 |
logging.info(f"Prediction results: {results}")
|
| 63 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 64 |
|
| 65 |
return jsonify({
|
| 66 |
"Ingredient Analysis": results,
|
|
|
|
| 67 |
})
|
| 68 |
|
| 69 |
except Exception as e:
|