r/LanguageTechnology • u/RhubarbFlat6247 • 7h ago
Extracting quantities with their units and denominators from real documents: how do you measure extraction accuracy before building calculations on it?
I am building a methodology that seeks out what institutional decision files have missed. The code, not the model, decides which numbers combine, tests combinations whose units are compatible, and then the results pass through acceptance and rejection gates. But all of this rests on one step: extracting each quantity, along with its unit, denominator, period, and scope, from authentic reports, studies, and PDF files. If the extraction is flawed, everything that follows is wrong, just calculated precisely.
What I'm doing now:
Two models extract each quantity with structured outputs: value, unit, denominator, period, scope, and verbatim quote from the source. The value is only accepted if the two extractions agree, or if it's settled by a verbatim quote. The code verifies that the number actually exists within the quote. I learned from a previous discussion to add an explicit "unknown" field, instead of the model guessing a reasonable unit.
The difficult cases:
- The implied denominator: “The center spends $2 million on the program.” Annually? Or for the entire project?
- The discrepancy in scope: A figure for one branch and a figure for the entire organization, both in the same document.
- Quote matching in PDF: curly quotation marks, ligatures, and words split by a hyphen at line ends. I solved these, but it took longer than I expected.
I pre-registered the evaluation: 100 cases, with a false-positive limit of 5%. Happy to share the link if anyone wants it.
Questions seeking your help:
- Do you know of a good benchmark for extracting quantities and their units from long texts, especially implicit denominators?
- Do you rely more on traditional tools like quantulum3 or grobid-quantities than on language models for this step, or do you combine both?
- How do you measure the accuracy of the extraction itself, separate from the accuracy of the final result?
Thank you
I'm an independent developer in Gaza.