Method and system for detecting fuzzy features of natural language requirements
Through the interaction between the fuzzy detection prompt word generator and the large language model, the problem of fuzzy feature detection in natural language requirements in complex system engineering is solved, and the accuracy and recall of detection is improved, which is suitable for multilingual support.
Patent Information
- Application Number
- CN202411553014.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-01
- Publication Date
- 2025-02-21
AI Technical Summary
The prior art is difficult to effectively detect and solve the fuzzy features present in natural language requirements, especially in complex system engineering, which leads to difficulties in understanding and verifying requirements.
The fuzzy detection prompt word generator is used to generate prompt words, and interact with the large language model. The output parser is used to detect the natural language requirements fuzzy feature of the output data of the large language model to generate detection results.
It improves the accuracy and recall of fuzzy feature detection in natural language requirements, and can more effectively identify multiple fuzzy features in complex system engineering, which is suitable for multilingual support.
Smart Images

Figure CN119493843A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of software engineering, and in particular to a method and system for detecting fuzzy features of natural language requirements. Background Art
[0002] In the highly competitive field of commercial aircraft and other complex systems, demand-driven system engineering is an important basis for the smooth development of models and excellent commercial performance. The quality of system requirements definition is directly related to the quality of the subsequent process of system engineering. However, the common ambiguity of requirements writing and low availability of requirements in actual engineering are a major problem faced by practitioners.
[0003] At present, there are many fuzzy features in the natural language requirements written manually, such as writing formats that do not conform to the prevailing standards, unexplained nouns and pronouns, and unverifiable adjectives and adverbs, which can easily lead to ambiguity and difficulty in verifying requirements. At the same time, business departments and domain experts lack the awareness of standardized requirements writing, and requirements management software also lacks the requirement fuzziness detection function suitable for complex systems. This problem needs to be solved urgently. In addition, the application practice of large language models in vertical fields is booming. The large model application mode based on existing domain knowledge and relevant practical experience in the field of software engineering is expected to play an important role in the system engineering method.
[0004] At present, the detection methods for the fuzzy features of natural language requirements are mostly carried out by heuristic algorithms, part-of-speech tag analysis, and training text classifiers. For example, the heuristic algorithms mainly use statistics and language morphology to determine the semantic ambiguity caused by conjunctions. The method is inspiring, but limited to specific English syntactic patterns and has low applicability; NLP preprocessing and harmfulness classifiers are added to increase the judgment of metaphorical ambiguity, but the applicable scenarios are still very limited; the use of predefined regular expressions for demand analysis is applicable to English and German texts; the availability of natural language requirements can be identified by training text classifiers, and discourse can be identified; the part-of-speech tagging method is used to detect adjectives and adverbs that cannot be verified for requirements.
[0005] In summary, the existing research on fuzzy feature detection methods for natural language requirements is limited to traditional NLP methods, cannot be applied to a variety of fuzzy features, and has poor effectiveness for complex professional field requirements. It is also difficult to provide multi-language support and basically has no possibility of application in the actual engineering environment of complex systems. Summary of the invention
[0006] In view of this, the first aspect of the present invention provides a method for detecting fuzzy features of natural language requirements to solve the technical problems raised in the background technology section. The method comprises:
[0007] The fuzzy detection prompt word generator generates prompt words according to the requirement text, requirement reference and requirement dependency, wherein the requirement reference and the requirement dependency are obtained from an instance of the requirement metamodel, and the requirement text includes a plurality of natural language requirement fuzzy features;
[0008] The fuzzy detection prompt word generator interacts with the large language model according to the generated prompt words, the number of interactions is the same as the number of prompt words, and the large language model outputs output data in JSON format;
[0009] The output parser performs natural language demand fuzzy feature detection on the output data of the large language model to obtain a detection result, wherein the detection result includes existing problems, judgment reasons and problem text corresponding to the demand text.
[0010] Furthermore, the requirement meta-model uses requirement items as elements, each of which stores a requirement text, a requirement ID, and records a requirement reference relationship and a requirement traceability relationship.
[0011] Furthermore, the large language model uses a RASCEF framework as a prompt word template, and the fuzzy detection prompt word generator generates the prompt word based on the RASCEF framework.
[0012] Furthermore, the RASCEF framework includes roles, actions, scopes, constraints, expectations and feedback.
[0013] Furthermore, the demand text includes a plurality of natural language demand fuzzy features, including fuzzy features related to the demand writing language and fuzzy features unrelated to the demand writing language; the plurality of natural language demand fuzzy features correspond one-to-one to the plurality of prompt words respectively.
[0014] Furthermore, after the output parser parses the output data to obtain the detection result, the detection result is stored in a relational database, and the detection result is associated with an instance of the demand metamodel; and the instance of the demand metamodel is adjusted according to the detection result stored in the relational database.
[0015] The second aspect of the present invention proposes a detection system for fuzzy features of natural language requirements to solve the technical problems raised in the background technology section. The system includes:
[0016] A prompt word generation module, used for the fuzzy detection prompt word generator to generate prompt words according to the requirement text, the requirement reference and the requirement dependency, wherein the requirement reference and the requirement dependency are obtained from an instance of the requirement metamodel;
[0017] A large language model interaction module, used for the fuzzy detection prompt word generator to interact with the large language model according to the generated prompt words, the number of interactions is the same as the number of the prompt words, and the large language model outputs output data in JSON format;
[0018] The fuzzy feature detection module is used to output the parser to perform natural language demand fuzzy feature detection on the output data of the large language model to obtain a detection result, wherein the detection result includes the existing problems, judgment reasons and problem text corresponding to the demand text.
[0019] Compared with the prior art, the beneficial effects that can be achieved by at least one of the above-mentioned technical solutions adopted in the embodiments of this specification include at least the following: The present invention provides a method for detecting fuzzy features of natural language requirements, which improves the accuracy and recall rate of feature detection by proposing a variety of fuzzy features of natural language requirements, a natural language requirement metamodel suitable for complex systems, and an adaptive large language model prompt word generator for detecting fuzzy features of natural language requirements. BRIEF DESCRIPTION OF THE DRAWINGS
[0020] In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings required for use in the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work.
[0021] Figure 1 It is an overall flow chart of a method for detecting fuzzy features of natural language requirements provided by an embodiment of the present invention;
[0022] Figure 2 is a schematic diagram of the structure of a demand metamodel instance provided by an embodiment of the present invention;
[0023] Figure 3 It is a schematic diagram of the structure of a natural language demand fuzzy feature detection system provided by an embodiment of the present invention;
[0024] Reference numerals in the figure: 300, a system for detecting fuzzy features of natural language requirements; 301, a prompt word generation module; 302, a large language model interaction module; 303, a fuzzy feature detection module. DETAILED DESCRIPTION
[0025] The embodiments of the present application are described in detail below with reference to the accompanying drawings.
[0026] The following describes the implementation methods of the present application through specific examples, and those skilled in the art can easily understand other advantages and effects of the present application from the contents disclosed in this specification. Obviously, the described embodiments are only a part of the embodiments of the present application, rather than all the embodiments. The present application can also be implemented or applied through other different specific implementation methods, and the details in this specification can also be modified or changed in various ways based on different viewpoints and applications without departing from the spirit of the present application. It should be noted that, in the absence of conflict, the following embodiments and the features in the embodiments can be combined with each other. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in the field without making creative work belong to the scope of protection of the present application.
[0027] This embodiment provides a method for detecting fuzzy features of natural language requirements. By proposing a variety of fuzzy features of natural language requirements, a natural language requirement metamodel suitable for complex systems, and an adaptive large language model prompt word generator, the method is used to detect the fuzzy features of natural language requirements, thereby improving the accuracy and recall rate of feature detection.
[0028] In an embodiment of the present invention, a method for detecting fuzzy features of natural language requirements includes:
[0029] Step S100: a fuzzy detection prompt word generator generates prompt words according to a requirement text, a requirement reference and a requirement dependency, wherein the requirement reference and the requirement dependency are obtained from an instance of a requirement metamodel, and the requirement text includes a plurality of natural language requirement fuzzy features;
[0030] Furthermore, the demand text includes a plurality of natural language demand fuzzy features, including fuzzy features related to the demand writing language and fuzzy features unrelated to the demand writing language; the plurality of natural language demand fuzzy features correspond one-to-one to the plurality of prompt words respectively.
[0031] Specifically, according to Figure 1 As shown, in this embodiment, peripheral modules are constructed around the large language model, and the peripheral modules include a requirement metamodel and its instances, a fuzzy detection prompt word generator, and an output parser. In the requirement fuzzy detection process, the fuzzy detection prompt word generator first receives the requirement text output by the upper-level module, as well as the requirement references and requirement dependencies obtained from the instance of the requirement metamodel; secondly, the fuzzy detection prompt word generator generates prompt words corresponding to the fuzzy features of each natural language requirement of the requirement text based on the above received data. The requirement metamodel is used to meet the needs of structured analysis. Recording the dependencies and references in the requirements can make it suitable for the multi-level requirement decomposition architecture in complex system engineering, and at the same time facilitate the call of subsequent modules.
[0032] Further, such as Figure 2 As shown, the requirement metamodel uses requirement items as elements, each of which stores requirement text, requirement ID, and records requirement reference relationship and requirement traceability relationship. Each requirement item (element) has a one-way traceability relationship between parent and child, which theoretically can realize multi-layer decomposition and traceability of requirements. At the same time, the requirement text, requirement reference relationship and requirement traceability relationship are stored in the element. For example, in a project in the pre-research stage of commercial aircraft, requirement management generally only involves three levels: business requirements and objectives (BRO), aircraft development requirements and objectives (ADRO), and aircraft-level requirements (ALR). In this example, the requirement metamodel is a three-layer requirement model.
[0033] Furthermore, in this embodiment, preferably, the requirement text corresponds to 12 natural language requirement fuzzy features, including 9 fuzzy features related to the requirement writing language and 3 fuzzy features unrelated to the requirement writing language.
[0034] Among them, the nine fuzzy features related to the requirements writing language are mainly from the ISO-29148 standard, and the examples in the INCOSE requirements writing guide are used as a reference. Specifically, they include:
[0035] 1. Superlatives
[0036] 2. Subjective language
[0037] 3. Vague pronouns
[0038] 4.Ambiguous adverbs and adjectives
[0039] 5. Open-ended, non-verifiable terms
[0040] 6. Comparative phrases
[0041] 7. Loopholes
[0042] 8.Incomplete references
[0043] 9. Negative statements
[0044] Furthermore, in this embodiment, the three fuzzy features that are not related to the requirements writing language are mainly derived from the requirements set features in the ISO-29148 standard, and also refer to the relevant items in the INCOSE requirements writing guide. Specifically, they include:
[0045] 1. Implementation Free
[0046] 2. Singular (demand singularity)
[0047] 3.Consistent (demand consistency)
[0048] Step S200: the fuzzy detection prompt word generator interacts with the large language model according to the generated prompt words, the number of interactions is the same as the number of the prompt words, and the large language model outputs output data in JSON format;
[0049] Furthermore, the large language model uses the RASCEF framework as a prompt word template, and the fuzzy detection prompt word generator generates the prompt word based on the RASCEF framework. The RASCEF framework includes roles, actions, scopes, constraints, expectations, and feedback.
[0050] Specifically, in order to enable the large language model to better understand the task context and improve the quality of the prompt words, the present invention preferably uses a RASCEF-like framework as a prompt word template to achieve better logic and reduce hallucination output. The RASCEF framework is an effective prompt word template used to fill in the framework prompt words to promote the large language model's understanding of different tasks and guide the generation of content in an orderly manner. In this embodiment, the basic structure of the RASCEF framework includes:
[0051] R:Role defines the role of the participants, executors or stakeholders of the task. Clarify who will perform what tasks or play what roles.
[0052] A: Action describes the specific actions or tasks that the participants will take. It includes verbs and action keywords.
[0053] S:Scope: Defines the scope or applicability of an action. Determines the object, area or scope affected by the action.
[0054] C: Constraints List the restrictions, conditions or constraints that may affect the way the action is performed. These constraints can be limitations in terms of resources, time, skills, etc.
[0055] E: Expectation describes the expected results or outcomes of a task. It clearly states the goals or standards that should be achieved after completing the action.
[0056] F:Feedback: Clarify how to collect feedback or evaluate results after completing the task. Including the process of checking, confirming or evaluating the results.
[0057] Furthermore, in the RASCEF framework, in the Role module, a common language block is designed to explain the role played by the large language model - the domain requirements engineering expert; in the Action module, the fuzzy features and related instructions that should be detected in the current interaction are pointed out; in the Scope and Constraints modules, detailed descriptions will be given according to the fuzzy features to be detected, and the limitations, exclusions, and other instructions for different features are embedded in the template of this module; in the Expectation module, two samples and detailed explanations of the corresponding fuzzy feature detection are embedded; in the Feedback module, detailed requirements for the output JSON format are explained to ensure that the output can be correctly parsed in the automated process. The Scope and Constraints modules will be detailed according to the fuzzy features to be detected, and the limitations, exclusions, and other instructions for different features are embedded in the template of this module.
[0058] Specifically, the prompt word generator is an adaptive prompt word generator. First, in the fuzzy detection task, the prompt word generator can automatically generate the prompt words required for 12 detection items based on the input requirement items to be detected, and each detection item is subject to different scopes, constraints and expectations. For detection items that require requirement reference relationships or requirement dependencies (requirement consistency, incomplete reference standards), the prompt word generator can also flexibly incorporate relevant information (upstream and downstream requirements, requirement reference information, etc.) into the background information.
[0059] Step S300: The output parser performs natural language demand fuzzy feature detection on the output data of the large language model to obtain a detection result, wherein the detection result includes existing problems, judgment reasons and problem text corresponding to the demand text.
[0060] Furthermore, after the output parser parses the output data to obtain the detection result, the detection result is stored in a relational database, and the detection result is associated with an instance of the demand metamodel; and the instance of the demand metamodel is adjusted according to the detection result stored in the relational database.
[0061] Specifically, the task output generated by the large language model needs to be parsed and recorded, and the output parser will parse the JSON format output. After the fuzzy detection process is completed, the output parser outputs the results of 12 detection items, and the detection results are stored in a table using a relational database. The detection results are associated with the structure and content of the demand model, and the demand model can be modified based on this to give a demand document without fuzzy features.
[0062] Embodiment 1
[0063] The requirement is "a certain aircraft should reduce flight noise as much as possible". After detection and analysis by the method proposed in this embodiment, the fuzzy feature of "fuzzy adjectives or adverbs" is given, and the reasons for the judgment and the problematic statements in the original text are given.
[0064] Detection result: vague adjective or adverb; Judgment reason: the meaning of the word "as much as possible" does not have a clear measurement standard, and different people may have different understandings of it, which makes the demand difficult to verify or has multiple interpretations"; The problematic statement in the original text: "as much as possible".
[0065] Based on the same inventive concept, a system for detecting fuzzy features of natural language requirements is also provided in an embodiment of the present invention, as described in the following embodiment. Since the principle of solving the problem by a system for detecting fuzzy features of natural language requirements is similar to that of a method for detecting fuzzy features of natural language requirements, the implementation of a system for detecting fuzzy features of natural language requirements can refer to the implementation of a method for detecting fuzzy features of natural language requirements, and the repeated parts will not be repeated. As used below, the term "unit" or "module" can be a combination of software and / or hardware that implements predetermined functions. Although the system described in the following embodiments is preferably implemented in software, the implementation of hardware, or a combination of software and hardware, is also possible and conceivable.
[0066] like Figure 3 As shown in FIG. 1 , it is a structural block diagram of a natural language requirement fuzzy feature detection system according to an embodiment of the present invention. Figure 3 As shown, including:
[0067] A prompt word generation module 301 is used for the fuzzy detection prompt word generator to generate prompt words according to the requirement text, the requirement reference and the requirement dependency, wherein the requirement reference and the requirement dependency are obtained from an instance of the requirement metamodel;
[0068] A large language model interaction module 302 is used for the fuzzy detection prompt word generator to interact with the large language model according to the generated prompt words, the number of interactions is the same as the number of the prompt words, and the large language model outputs output data in JSON format;
[0069] The fuzzy feature detection module 303 is used for the output parser to perform natural language demand fuzzy feature detection on the output data of the large language model to obtain a detection result, which includes the existing problems, judgment reasons and problem text corresponding to the demand text.
[0070] In summary, the embodiments of the present invention achieve the following technical effects:
[0071] The present invention proposes 12 natural language requirement features that may lead to requirement ambiguity in the actual engineering of complex system development. At the same time, it proposes a natural language requirement metamodel suitable for complex systems and an adaptive large language model prompt word generator to detect the fuzzy features of natural language requirements, thereby improving the accuracy and recall rate of feature detection.
[0072] The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. For those skilled in the art, the embodiments of the present invention may have various modifications and variations. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present invention shall be included in the protection scope of the present invention.
Claims
1. A method for detecting fuzzy features of natural language requirements, characterized in that: The method comprises: The fuzzy detection prompt word generator generates prompt words according to the requirement text, the requirement reference and the requirement dependency, wherein the requirement reference and the requirement dependency are obtained from an instance of the requirement metamodel, and the requirement text includes one or more natural language requirement fuzzy features; The fuzzy detection prompt word generator interacts with the large language model according to the generated prompt words, the number of interactions is the same as the number of prompt words, and the large language model outputs output data in JSON format; The output parser performs natural language demand fuzzy feature detection on the output data of the large language model to obtain a detection result, wherein the detection result includes existing problems, judgment reasons and problem text corresponding to the demand text.
2. The method for detecting fuzzy features of natural language requirements according to claim 1, characterized in that: include: The requirement meta-model uses requirement items as elements, and each requirement item stores a requirement text, a requirement ID, and records a requirement reference relationship and a requirement traceability relationship.
3. The method for detecting fuzzy features of natural language requirements according to claim 1, characterized in that: The large language model uses the RASCEF framework as a prompt word template, and the fuzzy detection prompt word generator generates the prompt word based on the RASCEF framework.
4. The method for detecting fuzzy features of natural language requirements according to claim 3, characterized in that: The RASCEF framework includes roles, actions, scope, constraints, expectations, and feedback.
5. The method for detecting fuzzy features of natural language requirements according to claim 1, characterized in that: The multiple natural language requirement fuzzy features include fuzzy features related to the requirement writing language and fuzzy features unrelated to the requirement writing language; The multiple natural language requirement fuzzy features correspond one-to-one to the multiple prompt words respectively.
6. The method for detecting fuzzy features of natural language requirements according to claim 1, characterized in that: The method further comprises: After the output parser parses the output data to obtain the detection result, the output parser stores the detection result in a relational database and associates the detection result with an instance of the demand metamodel; The demand metamodel is adjusted according to the detection results stored in the relational database.
7. A system for detecting fuzzy features of natural language requirements, characterized in that: include: A prompt word generation module, used for the fuzzy detection prompt word generator to generate prompt words according to the requirement text, the requirement reference and the requirement dependency, wherein the requirement reference and the requirement dependency are obtained from an instance of the requirement metamodel; A large language model interaction module, used for the fuzzy detection prompt word generator to interact with the large language model according to the generated prompt words, the number of interactions is the same as the number of the prompt words, and the large language model outputs output data in JSON format; The fuzzy feature detection module is used to output the parser to perform natural language demand fuzzy feature detection on the output data of the large language model to obtain a detection result, wherein the detection result includes the existing problems, judgment reasons and problem text corresponding to the demand text.
Citation Information
Patent Citations
Software demand text expression defect detection method and system and computer storage medium
CN110442324A
English demand ambiguity auxiliary inspection system
CN114742041A
Software demand description fuzziness detection method based on heuristic rule
CN115268842A
Information identification method and device, equipment, storage medium and program product
CN118194131A
Large language model interaction data processing method and device, storage medium and equipment
CN118394917A