From Text to Diagrams: Building Traceable and Queryable Domain Models with AI
Towards Queryable and Traceable Domain Models
The paper introduces a hybrid approach combining rule-based NLP and Machine Learning (SVM and LDA) to automatically extract domain models (class diagrams) from natural language problem descriptions. The system, instantiated as a web-based tool within the ModBud framework, achieves a 49% accuracy relative to ground truth, outperforming existing baselines by approximately 70% while providing queryable trace links for model elements.
TL;DR
Researchers at McGill University have developed an automated tool that transforms free-form natural language requirements into structured domain models (class diagrams). By blending traditional NLP rules with Machine Learning classifiers, it achieves nearly 50% accuracy relative to human experts, significantly outperforming prior SOTA baselines. More importantly, it creates "trace links," allowing users to query why specific modeling decisions were made.
The Modeling Bottleneck
Model-Driven Software Engineering (MDSE) relies heavily on domain models to bridge the gap between informal requirements and formal code. However, building these models is a classic "expert-only" task. Novices struggle with the abstraction required, and industrial practitioners often lack the time to maintain parity between text and diagrams.
Existing tools often produce "black-box" models—they output a diagram but cannot explain which sentence in the requirements justified a specific attribute or relationship. This lack of transparency prevents these tools from being effective teaching aids.
Methodology: Rules Meet Learning
The authors propose a four-stage pipeline designed to ensure both accuracy and accountability:
- Parsing & Enrichment: Using spaCy, the system performs tokenization, POS tagging, and coreference resolution (e.g., recognizing that "The employees" and "They" refer to the same entity).
- The Descriptive Layer (Rules): Rule-based NLP identifies "Candidate Concepts" (mostly noun phrases) and "Candidate Relationships" (based on verb dependencies).
- The Predictive Layer (ML): This is where the heavy lifting happens. Since rules struggle to distinguish between a "Class" and an "Attribute," the authors use an SVM classifier (Support Vector Machine) trained on GloVe word embeddings. Once an attribute is identified, a Linear Discriminant Analysis (LDA) model predicts its type (e.g., Integer, String, Date).
- The Prescriptive Layer: The system merges descriptive findings with ML predictions to generate a final class diagram.

Why Traceability Matters
Most research focus is on Accuracy. This paper adds a second dimension: Traceability. By maintaining a "Trace Model," the tool knows exactly which word in the text corresponds to which class in the diagram.
- User Scenario: A student asks, "Why was 'StudentRole' created as an enumeration?"
- The Bot's Answer: Points to the specific text fragments (e.g., "part-time," "full-time") and explains the pattern matching involved.
Experimental Results
The authors evaluated their approach against a rigorous baseline (Arora et al., 2016) using a new comparison metric that assigns points for correct classes, relationships, and cardinalities.
- Accuracy Boost: The proposed NLP+ML approach reached 49% of the ground truth score, compared to only 28.78% for the baseline.
- Classifier Efficiency: The SVM for concept classification reached a median F-score of 0.91, showing that semantic word vectors are highly effective at distinguishing structural units (Classes) from data units (Attributes).


Critical Perspective: The Road Ahead
While a 70% improvement over the baseline is impressive, a 49% absolute accuracy compared to humans suggests that automated domain modeling is still an unsolved problem.
Key Challenges remaining:
- Ambiguity: Natural language is inherently messy. The authors suggest that a "Modeling Bot" could proactively ask users for clarification when it detects ambiguity—moving from automation to collaboration.
- Embedding Evolution: The study used static GloVe embeddings. The authors rightly note that context-aware models like BERT or LLMs (Large Language Models) are the next logical step to capture context-heavy modeling nuances.
Conclusion
This work shifts the focus from "Generation" to "Education." By emphasizing queryable trace links, the authors provide a blueprint for a modeling bot that doesn't just do the work for you, but teaches you how to do it better. For the MDSE community, this is a vital step toward making high-level modeling accessible to everyone.
