A webapp to find potentially harmful ingredients in packaged food and find similar products built using AWS OpenSearch, SageMaker, DynamoDB, Cognito, Docker, Flask, and OpenAI API. Demo
Use this data to test the barcode scanner or the search feature.
While I find Yuka very useful for this, I started this project with two questions:
- How can the recent advances in NLP help summarize research in health and food science per ingredient?
- Since the ratings by a human expert may induce bias, is a qualitative stance better than Yuka's rating system?
Data is fetched from the US Department of Agriculture archive. A subset is derived based on popular brands like Haagen-Dazs and Starbucks; look at products for the list of all supported products.
Prerequisite - Set all the environment variables in env.list
git clone https://github.com/NeuralFlux/foodvisorLM
cd foodvisorLM
pip install -r requirements.txt
cd flask-app/
flask --app app.py --debug run
# build Docker image
cd ..
docker build -t fvsr-lm .
docker run --env-file env.list -p 5000:5000 fvsr-lm
AWS Service | Pros and Cons |
---|---|
Lambda | Scalable but cold-starts are slow |
S3 | Scalable but static pages only |
Amplify | Scalable and JavaScript-based whereas this app uses Flask for lightweight API |
Lightsail | Load balancing, isolated, free tier but no blue/green deployments and auto scaling |
Elastic Beanstalk | Robust solution but insufficient free tier EC2 credits |
Product barcode data is largely structured and contains millions of rows, hence RDS or DynamoDB are well-suited. However, for User History, DynamoDB is better suited due to scalability.
- Deploy custom retrieval-augmented generation pipeline for label classification
- Cite relevant articles in RAG
- Recommend healthier alternatives as opposed to similar products only
This is a part of my project for Cloud Computing and Big Data at New York University, Fall 2023 taught by Prof. Sambit Sahu.
- A. Hill, “What AWS service should you use to publish a web site?, ” https://adrianhall.github.io/cloud/2019/01/31/which-aws-service-for-hosting/
- OpenAI, “Chat Completion API Documentation, ” https://platform.openai.com/docs/guides/text-generation/chat-completions-api
- AWS, “AWS Documentation, ” https://docs.aws.amazon.com/index.html
- Julie, François, Benoı̂t, “Yuka Blog, ” https://yuka.io/en/
- OpenSearch, "Neural Search Tutorial, " https://opensearch.org/docs/latest/search-plugins/neural-search-tutorial/
- Ricardo Ferreira, "Developing Neural Searches with Custom Models, " https://community.aws/content/2ZVEF1vMg0Jh2IwtbVMEVEMND59/developing-neural-searches-with-custom-models?lang=en