Skip to main content

Tools for semantic nutrition

Project description

Semantic Nutrition

This repo demonstrates how our basic semantic nutrition API works. We submitted this process as a clinical abtract to MLHC 2020 (poster, abstract).

This is a base version of what was presented at the MLHC, and operates on a limited dataset. The dataset we used for training and publication is not ours to share. If you're interested in using your own nutrition dataset with this API, you can designate a different (local or hosted) URL when you initialize the class. The USDA provides an excellent starting point to build a dataset.

Installation

pip install nutritiontools

Usage

from nutritiontools import Nutrition

n_obj = Nutrition() 

match = n_obj.semantic_search("I ate an apple") 

print(match)

Connecting to mobile assistants, placing the API in an online server, and managing a database

For testing purposes, we used Siri Shortcuts (iOS) and Google Assistant / IFTTT webhooks (Android) to send voice transcriptions to Google Firebase. Once received, the incoming data would trigger a Firebase Cloud Function. The Firebase Function relayed the voice transcription to our Semantic Nutrition API(hosted online with Flask and Google App Engine), which responded with estimates for nutrition data. The nutrition data was then logged in Google Firebase.

While useful for testing and demonstrations, this method has been depecrated in favor of a native mobile application and private server / database. Please stay tuned for future developments, and feel free to use our API locally in the meantime!

updated on 7/27/2020

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

semanticjoshuadrc-0.0.1.tar.gz (4.3 kB view hashes)

Uploaded Source

Built Distribution

semanticjoshuadrc-0.0.1-py3-none-any.whl (5.6 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page