fix: refine calorie estimation - #1847
Open
neverbiasu wants to merge 12 commits into
Open
Conversation
neverbiasu
force-pushed
the
feature/calorie-estimation-system
branch
from
July 27, 2026 00:51
d24f5e3 to
df7b9ee
Compare
Owner
|
话说这是啥算法算的,为什么很多0? 我需要一些材料支撑证明这个新数据真的比老算法可靠 |
Author
|
@Anduin2017 这个算法是基于食材明细的规则计算:先从菜谱中解析食材、数量和单位,再统一换算成克重;然后匹配营养数据库中的每 100 克热量和可食部比例,计算每种食材的热量,最后汇总并按份数折算 |
Owner
不用完全checkin。在这个pr里介绍一下即可。因为如果计算差异过大,我担心后续社区可能会质疑数据来源。 |
neverbiasu
force-pushed
the
feature/calorie-estimation-system
branch
from
July 28, 2026 18:18
e7a97f8 to
2ce91a1
Compare
neverbiasu
force-pushed
the
feature/calorie-estimation-system
branch
from
July 28, 2026 18:21
2ce91a1 to
9769763
Compare
Author
热量根据菜谱原料、用量和份数计算:统一换算原料重量,匹配营养数据库,按每 100g 热量及可食部比例汇总,再折算为每份热量 数据参考香港食物营养数据、新加坡卫生促进局数据、日本文部科学省数据、中国食物成分查询平台和 USDA FoodData Central,无法可靠解析或匹配的菜谱保留原值 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
变更说明
本 PR 展示热量估算系统在 HowToCook 菜谱数据上的应用结果,主要更新 dishes/ 目录下菜谱的预估卡路里字段,不提交估算系统的完整实现代码。
本次结果按菜品分类拆分提交,便于审核、定位和回滚。
计算方法
这些数值是基于菜谱文本和公开营养数据的估算,不应视为营养标签或实验室测量结果。
0 值说明
当前输出中发现 108 道菜谱得到 0 大卡:
因此,0 大卡不作为真实热量结果。后续处理原则是:阻止 0 值自动写回,暂时保留原有值,并在修复解析、单位和匹配问题后重新计算;不直接用人工猜测值替换。
注意
Pull Request 提交后,预计 1 分钟内将会得到自动化格式检查的结果。只有通过自动化代码检查的 Pull Request 才会被人工审核。
签署
必须签署下面的对话框才能开始审核。
HowToCook 仓库采用了 The Unlicense 协议
菜谱在签入前,必须确保其可以直接声明进入 "公共领域"(public domain)。这意味着一旦合并后,任何人都可以自由复制、修改、发布、使用、编译、出售或以菜谱的形式或菜的形式分发,无论是出于商业目的还是非商目的,以及通过任何手段。