A quantity is never an entity - #587
Merged
Merged
Conversation
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Signed-off-by: WaylandYang <wayland0916@gmail.com>
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Signed-off-by: WaylandYang <wayland0916@gmail.com>
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.
上一刀(#586)把「整体是一个量」的宾语改走字面值通道,但只在谓词未知时生效。这一刀补上剩下的路,并把端到端真跑通。
一、已知谓词那一格漏着
判据前面挂着
!known_predicate:谓词一旦在本体里,整段判断跳过。实测的不对称就在同一个库里:两处补:
is_entity_name拦纯量值(主语宾语一视同仁,不问谓词);宾语整体是量时一律走字面值通道,原词进proposed_predicate。二、值换不动,属性挂着 0 条事实
employeeCount (number)在本体里、事实写着employee_count → "1,250 people",词对得上、属性也在,只因为模型把单位写进了值里就永远换不动。加
parse_leading_quantity:开头是量、后面还有词也读得出那个数。它与parse_quantity的严格是两件事——后者要判「这串字是不是一个东西」,判错会吃掉真实体;这里调用方手上已经有一条声明了datatype = number的属性,问的只是「那个数是多少」。严的那套一点没松,测试里钉着。三、键被同名关系占着,采纳直接放弃
占着键的关系常常是空的(本体包带来的、或早先按票数建的),一条事实都没挂。空关系改判成属性不破坏任何东西。有事实的一律不动——判据写在 SQL 的
NOT EXISTS里,invested、raised这类既连实体又带数额的照旧报错留给人看。四、入口门槛不数值候选
12 条待认领的值事实摆在库里,
proposed_predicates只数宾语是实体的,于是算出 0,整个自动扩本体一次都没跑。把值候选也算进信号数。五、datatype 由数据定,不听模型的
模型给
valuation报的是text,而等它的四个值全是$12 billion这样的量——存成 text 就比不了大小,而「能比大小」正是它们不该当节点的理由。手里有事实就不必去问判断题(keep_forms那里已经是同一个原则)。端到端
隔离库 + 六篇虚构语料,先手工把
pledged/valuation/investment_amount等六个说法种成关系,造出「谓词已知」这个漏掉的条件,再整套跑一遍。valuation的 datatype$extraction_drops全程为空,没有任何一条被代码挡掉。剩下的 8 条待认领是说法只出现在一篇文档里(MIN_DOCS,故意不动)或本体与语料的真分歧(pledged、raised既当关系又带数额)——数、证据、时态都在库里,只差一个谓词。一处如实说明
第一条那个 match 分支没有单测:它在
run()那个上千行的 async 函数里,不重构抽不出来。is_entity_name、parse_quantity、parse_leading_quantity三处都有测试钉着两侧边界(3M、7-Eleven、23andMe、2025 Atlantic hurricane season一个都不误伤)。🤖 Generated with Claude Code