Automatically Solving Number Word Problems by Semantic Parsing and Reasoning

Shuming Shi, Yuehui Wang, Chin-Yew Lin, Xiaojiang Liu, Yong Rui

Abstract

This paper presents SigmaDolphin, a symbolic framework designed to solve number word problems by bridging the semantic gap between natural language and mathematical logic. Central to the system is the Dolphin Language (DOL), a strongly typed meaning representation language that supports template classes and entity variables. By employing a large-scale library of 9,600 grammar rules within a Context-Free Grammar parser, SigmaDolphin achieves a precision of 95.4% on the Dolphin dataset, a collection of 1,878 real-world problems. The results demonstrate that a rigorous symbolic approach can significantly outperform statistical models in domains requiring high mathematical accuracy.

Introduction

While computational systems excel at raw calculation, solving "math word problems" remains a significant challenge for artificial intelligence. The primary hurdle is the "semantic gap": the difficulty of translating ambiguous, informal human language into rigid, executable mathematical equations. Previous research has generally split into symbolic approaches, which are often brittle and limited in scope, and statistical learning methods, which are robust but frequently lack the precision necessary for mathematical logic.

SigmaDolphin aims to bridge this gap by introducing a systematic, high-precision symbolic framework tailored for "number word problems"—problems focusing on numerical relationships and properties described in text.

The DOL Meaning Representation

The core of SigmaDolphin is the Dolphin Language (DOL), a newly designed Meaning Representation Language (MRL). Unlike general-purpose semantic representations, DOL is specifically engineered for the mathematical domain. It is characterized by three key features:

  1. Strong Typing: Every node in a DOL tree has a specific type (e.g., math.integer, math.fraction). This allows the system to prune semantically nonsensical interpretations during parsing.
  2. Template Classes: Similar to C++, DOL supports template classes that can represent complex concepts like "a list of at least two integers" concisely.
  3. Entity Variables: DOL uses entity variables to handle co-reference, ensuring that phrases like "the smaller number" and "another" refer to the same underlying variable across different sentences.
Examples of DOL trees illustrating hierarchical structure and entity variables.

Semantic Parsing and Reasoning

The SigmaDolphin system operates in three main stages. First, it utilizes a Context-Free Grammar (CFG) parser based on the Earley algorithm. The researchers developed a library of 9,600 grammar rules to map natural language phrases to DOL nodes. Because DOL is strongly typed, the parser can automatically discard interpretations that are linguistically possible but mathematically impossible.

Mapping of a natural language sentence to its corresponding DOL tree representation.

Once a DOL tree is constructed, a reasoning module applies semantic interpretations to derive mathematical expressions. The system distinguishes between s-expressions (mathematical sentences or equations) and n-expressions (noun phrases or quantities). These expressions are then processed by a standard equation solver to produce the final answer. A notable feature is "lazy variable assignment," where the system delays resolving specific variable mappings (e.g., which number is $x$ or $y$) until the reasoning stage, avoiding premature errors.

Experimental Evaluation

The system was evaluated using the Dolphin Dataset, a collection of 1,878 number word problems harvested from online forums. To ensure a fair comparison with statistical models like KAZB, the researchers created specific subsets (LinearT2 and LinearT6) containing problems with common equation templates.

SigmaDolphin demonstrated significant superiority over existing methods:

  • Precision: On the full test set, SigmaDolphin achieved 95.4% precision, compared to just 29.0% for the statistical baseline (BasicSim).
  • Recall: The system reached 60.2% recall. While the gap in recall is primarily due to sentences not covered by the current grammar rules, the high precision indicates that when the system provides an answer, it is almost certainly correct.
  • F1 Score: On the LinearT6 subset, SigmaDolphin achieved an 83.6% F1 score, nearly doubling the 49.1% achieved by the KAZB model.

Conclusion and Future Work

SigmaDolphin proves that a well-constructed symbolic system can outperform statistical "guessing" models in domains where precision is paramount. However, the system currently has limitations regarding domain specificity, as it struggles with problems requiring physical or spatial reasoning. Future work will focus on extending the DOL lexicon and grammar coverage to move toward a more general-purpose mathematical solver.

Summary updated

BibTeX
@inproceedings{shi2015automatically,
  author = {Shuming Shi and Yuehui Wang and Chin-Yew Lin and Xiaojiang Liu and Yong Rui},
  title = {{Automatically Solving Number Word Problems by Semantic Parsing and Reasoning}},
  booktitle = {Conference on Empirical Methods in Natural Language Processing},
  year = {2015},
  doi = {10.18653/v1/d15-1135},
}
Figure