Related Experiment Videos
Hybrid semantic-lexical framework for ambiguity detection in software requirements using TF-IDF, character n-grams,
Fariha Khalid1, Muhammad Yaseen1, Muhammad Awais Sattar2
1Faculty of Computing, Riphah International University, Lahore, Pakistan.
Abstract:
Ambiguity in software requirements is a major cause of misinterpretation, design defects, rework, and project delays in software engineering. This study proposes a hybrid semantic-lexical ambiguity detection framework that integrates lexical, structural, and contextual representations for identifying ambiguous software requirement statements. Two benchmark datasets were employed, including a Software Requirements Specification (SRS) dataset and a Functional-Non-Functional Requirements (FR-NFR) dataset. Data pre-processing involved tokenisation, lemmatisation, and noise removal, while Synthetic Minority Oversampling Technique (SMOTE) was applied to address class imbalance within training partitions. Three modeling strategies were evaluated: baseline classifiers using TF-IDF and character n-gram features, semantic models based on Sentence-BERT (SBERT) embeddings, and a hybrid representation combining TF-IDF, character n-grams, and SBERT embeddings. Experimental results indicate that baseline models achieved high precision but comparatively lower recall, limiting their ability to identify ambiguous requirements under class imbalance. The proposed hybrid representation achieved the strongest and most balanced performance across both datasets in practical terms, particularly when combined with Support Vector Machine classification, resulting in improved recall and F1-score, although statistical testing indicated that these gains over the strongest lexical baseline were not significant at the 5% level. By jointly modeling lexical vagueness, structural ambiguity patterns, and contextual semantics, the framework captures both explicit and implicit forms of ambiguity that are frequently overlooked by single-representation approaches. To strengthen experimental validity, five-fold stratified cross-validation, transformer-based baseline comparison using fine-tuned BERT, statistical significance testing, and annotation reliability assessment using Cohen's Kappa coefficient were incorporated. The findings demonstrate that integrating lexical, structural, and semantic representations provides a robust and potentially scalable approach for ambiguity detection in software requirements engineering. The proposed framework contributes to improved requirements quality, reduced risk of misinterpretation, and more reliable automated support for requirements analysis.