Abstract: Creating datasets manually by human annotators is a laborious task that can lead to biased and inhomogeneous labels. We propose a flexible, semi-automatic framework for labeling data for relation extraction. Furthermore, we provide a dataset of preprocessed sentences from the requirements engineering domain, including a set of automatically created as well as hand-crafted labels. In our case study, we compare the human and automatic labels and show that there is a substantial overlap between both annotations.
Introduction
In the field of Requirements Engineering (RE), software specifications are typically documented in natural language. Automating tasks such as UML diagram generation or consistency checking requires the extraction of structured relations from these documents. However, training machine learning models for this purpose is often limited by the scarcity of high-quality labeled datasets. Manual annotation is not only time-consuming but also prone to subjective interpretation. This paper presents a semi-automated framework designed to bridge this gap by leveraging linguistic dependency parsing to generate consistent labels for relation extraction.
Methodology
The proposed framework operates on the premise that the formal and structured nature of requirements language allows syntactic structure to serve as a proxy for semantic meaning. The process involves two primary stages:
- Dependency Parsing: Sentences are processed to create dependency trees, mapping grammatical relationships between words.
- Pattern Application: A pattern-matching engine applies 102 handcrafted rules to these trees. Each rule defines a path to identify specific components: the acting entity (
ent1), the relation or action (rel), the passive entity or object (ent2), and any associated conditions (cond).
The researchers utilized the PURE dataset, consisting of 19 public requirements documents. After preprocessing, a dataset of 2,093 sentences was produced, yielding 1,848 automatically generated labels.
Results and Evaluation
To validate the framework, the automated labels were compared against a "gold standard" subset of 199 sentences manually annotated by experts. Agreement was measured using Cohen’s Kappa ($\kappa$).
The system achieved an overall sentence average $\kappa$ of 0.632, indicating "substantial agreement." Performance was highest for primary entity extraction (ent1) at 0.855. Identifying conditions (cond) proved more difficult ($\kappa = 0.532$) due to the inherent complexity and varied placement of conditional clauses in natural language.
Discussion and Conclusion
The study demonstrates that a relatively small set of 102 patterns can achieve high coverage (over 91%) in functional requirements, significantly reducing the manual effort required for dataset creation. While the system currently focuses on single primary relations per sentence and is dependent on the accuracy of the underlying dependency parser, it provides a robust foundation for future work.
Future research will focus on extending the engine to support recursive patterns for nested instructions and utilizing the generated dataset to train Transformer-based models, such as BERT, to improve generalization beyond rigid syntactic rules.
Summary updated