Add runnable V1/V1.5 dependency-tree generation pipeline#1
Open
Vic1025 wants to merge 1 commit into
Open
Conversation
Implements the documented Math Word Problem Generator pipeline in pure
standard-library Python (no external deps, runs fully offline):
- variable_tree.py : stages 1-3 (random variables -> dependency tree ->
operation assignment -> ground-truth answer + answer_list)
- themes.py : stage 4 theme library (behavior/unit/noun categories)
- entity_library.py : stage 5 (V1.5) pre-built entity library
- renderer.py : stage 6 narrative (V1) + compact listing (V1.5) renderers
- validator.py : stage 7 classify -> recompute -> correct
- pipeline.py : end-to-end batch generation + dataset stats
- generate.py CLI, tests (28 passing), examples, USAGE.md
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.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.
This PR fills in the previously code-less repo with a full, runnable reference implementation of the documented V1 / V1.5 Math Word Problem Generator pipeline.
What's included
Pure standard-library Python (no external dependencies, no API key, runs fully offline and deterministically with
--seed):src/mwp_v1/variable_tree.pyanswer_listsrc/mwp_v1/themes.pysrc/mwp_v1/entity_library.pysrc/mwp_v1/renderer.pyNarrativeRenderer(V1, optional LLM hook) +ListingRenderer(compact V1.5)src/mwp_v1/validator.pysrc/mwp_v1/pipeline.pygenerate.pyVerification
28 tests passing. Every accepted record's independently-recomputed answer equals the tree ground truth. Real samples in
examples/, architecture notes inUSAGE.md.🤖 Generated with Claude Code