china-food-composition-data  by Sanotsu

Food composition data extraction and conversion

Created 2 years ago
276 stars

Top 93.6% on SourcePulse

GitHubView on GitHub
Project Summary

This repository provides processed data from the "Chinese Food Composition Table Standard Edition (6th Edition)," specifically focusing on energy, general nutritional components, and glycemic index (GI). It offers structured JSON datasets derived from scanned tables, intended for developers needing reliable food data for applications such as fitness trackers or nutritional analysis tools. The project offers two processing pipelines: one using traditional OCR and another leveraging advanced vision-language models (LLMs).

How It Works

The project offers two primary methods for data extraction and conversion. The first method, index.py, utilizes PaddleOCR to convert table screenshots into Excel files, which are then processed into a specified JSON format. The second, and preferred, method (index_vision_llm_processor.py) employs vision LLMs, such as Qwen2.5-VL-72B-Instruct, to recognize table data directly into Markdown format before generating JSON. This LLM-based approach is noted for yielding superior results compared to traditional OCR, though it is more computationally intensive.

Quick Start & Requirements

  • Primary install/run command:
    • For OCR-based processing: python3 index.py
    • For Vision LLM-based processing: python3 index_vision_llm_processor.py
  • Non-default prerequisites: The Vision LLM approach requires API access and configuration (e.g., API keys) within a .env file.
  • Estimated setup time or resource footprint: The OCR conversion process took over two hours on a specific test machine (i5-4460 CPU, GT710 GPU, Windows 7 VM with Ubuntu 22). Vision LLM processing is noted as potentially very time-consuming. Pre-generated JSON files are available in json_data and json_data_vision folders to bypass processing.
  • Links: No direct links to official quick-start guides or demos are provided beyond the README itself.

Highlighted Details

  • Data is sourced from the "Energy and General Nutritional Components" and "Food Glycemic Index (GI)" sections of the 《中国食物成分表标准版(第 6 版)》.
  • The repository includes 1677 food items in the latest vision LLM processed dataset, excluding "infant foods" due to data inconsistencies.
  • Qwen2.5-VL-72B-Instruct is highlighted as the most effective vision model tested for this task, outperforming other tested models.
  • The project provides a specific JSON schema for food composition data, demonstrated by an example entry for "Chicken (representative value)".

Maintenance & Community

No specific information regarding maintainers, contributors, community channels (like Discord/Slack), or project roadmaps is present in the provided text.

Licensing & Compatibility

The repository does not explicitly state a software license. However, it notes that "All copyrights belong to the original author," suggesting that usage, especially for commercial purposes, may require explicit permission from the copyright holder.

Limitations & Caveats

The accuracy of the automated recognition (both OCR and LLM) is not guaranteed, and users are advised that data may not be absolutely consistent. The vision LLM processing can be computationally expensive and time-consuming. The lack of a clear license and the assertion of copyright ownership by the original author may impose restrictions on the use and redistribution of the data.

Health Check
Last Commit

7 months ago

Responsiveness

Inactive

Pull Requests (30d)
0
Issues (30d)
0
Star History
22 stars in the last 30 days

Explore Similar Projects

Starred by Tobi Lutke Tobi Lutke(Cofounder of Shopify), John Resig John Resig(Author of jQuery; Chief Software Architect at Khan Academy), and
9 more.

lilac by databricks

0%
1k
Data exploration tool for LLM dataset curation and quality control
Created 3 years ago
Updated 2 years ago
Feedback? Help us improve.