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

semantic-nutrition-0.0.2.tar.gz (4.3 kB view details)

Uploaded Source

Built Distribution

semantic_nutrition-0.0.2-py3-none-any.whl (3.1 kB view details)

Uploaded Python 3

File details

Details for the file semantic-nutrition-0.0.2.tar.gz.

File metadata

  • Download URL: semantic-nutrition-0.0.2.tar.gz
  • Upload date:
  • Size: 4.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/49.2.0 requests-toolbelt/0.9.1 tqdm/4.42.1 CPython/3.7.6

File hashes

Hashes for semantic-nutrition-0.0.2.tar.gz
Algorithm Hash digest
SHA256 0ed35a04f213230e1de36e69e92a1e16ecf9ec87e6deb145e9762245c42f82e2
MD5 ab908160285ae9a46ca96f96cb1424b3
BLAKE2b-256 17831d04fe52d84959de5575862576ad6078f8021d36eb76a0277df85ebfbbc8

See more details on using hashes here.

File details

Details for the file semantic_nutrition-0.0.2-py3-none-any.whl.

File metadata

  • Download URL: semantic_nutrition-0.0.2-py3-none-any.whl
  • Upload date:
  • Size: 3.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/49.2.0 requests-toolbelt/0.9.1 tqdm/4.42.1 CPython/3.7.6

File hashes

Hashes for semantic_nutrition-0.0.2-py3-none-any.whl
Algorithm Hash digest
SHA256 9734c5f5234a31b8730dcbc477bb5fd3fbd461091f66211952ac883cacaec24d
MD5 c72e8c3db60c1c1196f4c75012639606
BLAKE2b-256 82e1a9124b8b72f668491d6eb95dad17182a285d6c05e7c05c9e2923ea5f9e40

See more details on using hashes here.

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