Method and system for eliminating fuzzy features of natural language requirements
By combining the fuzzy elimination prompt word generator and the large language model, fuzzy features in natural language requirements are identified and processed, the problem of demand ambiguity in complex systems is solved, and the clarity and usability of requirements are improved.
Patent Information
- Application Number
- CN202411553015.0
- 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
In the field of complex systems, there are a large number of fuzzy features in the writing of natural language requirements, which leads to difficulties in understanding ambiguity and demand verification. The existing technology lacks effective fuzzy feature elimination methods.
Using a combination of fuzzy elimination prompt word generator and large language model, by generating prompt words and using the RASCEF framework, fuzzy features in natural language requirements are identified and processed, and data in JSON format is output for parsing to achieve modification of the demand text.
It achieves full coverage of various features that may lead to fuzziness in natural language requirements, improves the clarity and availability of requirements, and is suitable for demand management of complex systems.
Smart Images

Figure CN119493844A_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 eliminating 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 a lot of fuzzy features in the natural language requirements written manually, such as writing formats that do not conform to the commonly accepted 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 function of eliminating fuzzy requirements for complex systems. This problem needs to be solved urgently. In addition, there are currently few studies in the industry that are directly related to eliminating fuzzy requirements. On the one hand, the use of requirement templates is believed to reduce the fuzziness of natural language requirements; on the other hand, some studies use framework-based modeling methodologies to avoid fuzzy requirements. Summary of the invention
[0004] In view of this, the first aspect of the present invention provides a method for eliminating fuzzy features of natural language requirements to solve the technical problems raised in the background technology section. The method comprises:
[0005] The fuzzy elimination prompt word generator generates prompt words according to the received requirement text, requirement references and requirement dependencies, and fuzzy detection results, wherein the requirement references and the requirement dependencies are obtained from instances of the requirement metamodel, and the requirement text includes one or more natural language requirement fuzzy features;
[0006] The large language model performs fuzzy feature elimination processing on the demand text according to the generated prompt words, and outputs the data in JSON format to the output parser;
[0007] The output parser parses the received data in JSON format to obtain a parsing result, wherein the parsing result includes a modified text and a modified explanation of the requirement text.
[0008] Furthermore, the ambiguity elimination prompt word generator receives manual feedback and background knowledge from an external knowledge base, and generates the prompt word in combination with the requirement text, requirement references and requirement dependencies, and ambiguity detection results, wherein the background knowledge is related to the requirement text.
[0009] Furthermore, the instance of the requirement metamodel is modified according to the parsing result, and the modification content includes modification of the requirement text, modification of the requirement reference and modification of the requirement dependency.
[0010] Furthermore, the requirement meta-model uses requirement items as elements, and each of the requirement items 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, and the RASCEF framework includes roles, actions, scopes, constraints, expectations, and feedback.
[0012] Furthermore, the multiple natural language requirement fuzzy features include fuzzy features related to the language in which the requirement is written, and fuzzy features unrelated to the language in which the requirement is written; the multiple natural language requirement fuzzy features correspond one-to-one to the multiple prompt words respectively.
[0013] Furthermore, if there are multiple fuzzy features in the requirement text, the fuzzy features are eliminated one by one according to a preset process, and the preset process includes processing of various types of fuzzy features.
[0014] The second aspect of the present invention proposes a system for eliminating fuzzy features of natural language requirements to solve the technical problems raised in the background technology section. The system includes:
[0015] A prompt word generation module, used for the fuzzy elimination prompt word generator to generate prompt words according to the received requirement text, requirement references and requirement dependencies, and fuzzy detection results, wherein the requirement references and the requirement dependencies are obtained from instances of the requirement metamodel, and the requirement text includes one or more natural language requirement fuzzy features;
[0016] A fuzzy feature elimination module is used for the large language model to perform fuzzy feature elimination processing on the demand text according to the generated prompt words, and output the data in JSON format to the output parser;
[0017] The text modification module is used for the output parser to parse the received data in JSON format to obtain a parsing result, wherein the parsing result includes a modified text and a modified explanation of the requirement text.
[0018] 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 present invention provides a method for eliminating fuzzy features of natural language requirements, which achieves full coverage of various natural language features that may cause fuzzy requirements in actual projects, and combines an adaptive large language model and an adaptive prompt word generator to achieve the effect of eliminating fuzzy features of natural language requirements. BRIEF DESCRIPTION OF THE DRAWINGS
[0019] 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 paying creative work.
[0020] Figure 1 This is an overall flow chart of a method for eliminating fuzzy features of natural language requirements provided by an embodiment of the present invention;
[0021] Figure 2 is a schematic diagram of the structure of a demand metamodel instance provided by an embodiment of the present invention;
[0022] Figure 3 It is a schematic diagram of the structure of a system for eliminating fuzzy features of natural language requirements provided by an embodiment of the present invention;
[0023] Reference numerals in the figure: 300, a system for eliminating fuzzy features of natural language requirements; 301, a prompt word generation module; 302, a fuzzy feature elimination module; 303, a text modification module. DETAILED DESCRIPTION
[0024] The embodiments of the present application are described in detail below with reference to the accompanying drawings.
[0025] 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.
[0026] This embodiment provides a method for eliminating fuzzy features of natural language requirements, which fully covers various natural language features that may cause fuzzy requirements in actual projects, and combines an adaptive large language model and an adaptive prompt word generator to achieve the effect of eliminating fuzzy features of natural language requirements.
[0027] like Figure 1 As shown, in an embodiment of the present invention, a method for eliminating fuzzy features of natural language requirements includes:
[0028] Step S100, the fuzziness elimination prompt word generator generates prompt words according to the received requirement text, requirement references and requirement dependencies, and fuzziness detection results, wherein the requirement references and the requirement dependencies are obtained from instances of the requirement metamodel, and the requirement text includes one or more natural language requirement fuzzy features;
[0029] 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.
[0030] Preferably, in this embodiment, the ambiguity elimination prompt word generator can also receive feedback manually input by engineers, and can also choose to receive relevant information related to the requirement text automatically generated by an external knowledge base (including project information, project documents, airworthiness standards, background knowledge, etc.), thereby generating prompt words in combination with the requirement text, requirement references and requirement dependencies.
[0031] Specifically, the prompt word generator is an adaptive prompt word generator. In the fuzzy elimination task, this embodiment adjusts the prompt word design according to the fuzzy detection result (single fuzzy feature or multiple fuzzy features) output by the previous task, and introduces the feedback information input manually or the reference information provided by the external knowledge base according to the user's choice. The relevant information can also be flexibly incorporated into the prompt word design. In addition, the knowledge base retrieval subtask designed for the fuzzy elimination task in this embodiment also uses a similar prompt word framework.
[0032] Specifically, according to Figure 1As shown, in this embodiment, peripheral modules are constructed around the large language model, and the peripheral modules include a structured requirement metamodel and its instances, an external knowledge base, a fuzzy elimination prompt word generator, and an output parser. In the requirement fuzzy elimination process, the fuzzy elimination prompt word generator first receives the requirement text output by the upper module and the requirement references and requirement dependencies obtained from the requirement metamodel, and collects manual feedback or external knowledge base output; secondly, the fuzzy elimination prompt word generator generates prompt words corresponding to fuzzy feature elimination based on the above received data. Among them, the requirement metamodel and its instances are used to meet the needs of structured analysis of requirements. 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 support of subsequent module calls.
[0033] 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 relationships and requirement traceability relationships. A parent-child unidirectional traceability relationship can be established between each requirement item (element), and in theory, multi-layer decomposition and traceability of requirements can be achieved. At the same time, the requirement text, requirement reference relationship, and requirement traceability relationship are stored in the elements. 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 case, the instance of the requirement metamodel is a three-layer requirement model.
[0034] Furthermore, in this embodiment, preferably, the 12 natural language requirement fuzzy features for which fuzzy features are eliminated include 9 fuzzy features related to the requirement writing language and 3 fuzzy features unrelated to the requirement writing language.
[0035] 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:
[0036] 1. Superlatives
[0037] 2. Subjective language
[0038] 3. Vague pronouns
[0039] 4.Ambiguous adverbs and adjectives
[0040] 5. Open-ended, non-verifiable terms
[0041] 6. Comparative phrases
[0042] 7. Loopholes
[0043] 8.Incomplete references
[0044] 9. Negative statements
[0045] 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:
[0046] 1. Implementation Free
[0047] 2. Singular (demand singularity)
[0048] 3.Consistent (demand consistency)
[0049] Step S200: the large language model performs fuzzy feature elimination processing on the demand text according to the generated prompt words, and outputs output data in JSON format to the output parser;
[0050] 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.
[0051] Specifically, after the fuzzy elimination prompt word generator interacts with the large language model, the large language model processes the demand text, combines the generated prompt words, identifies and processes the fuzzy features in the demand, and the output parser parses the JSON output of the large language model. In order to enable the large language model to better understand the task context and improve the quality of the prompt words, it is preferred in the present invention to use 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 for filling in framed 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:
[0052] R:Role defines the role of the participants, executors or stakeholders of the task. Clarify who will perform what tasks or play what roles;
[0053] A: Action describes the specific actions or tasks that the participants will take. Includes verbs and action keywords;
[0054] S:Scope: Define the scope or application of the action. Determine the object, field or scope affected by the action;
[0055] C: Constraints list the restrictions, conditions or constraints that may affect the way the action is performed. These constraints can be limitations in resources, time, skills, etc.
[0056] E: Expectation describes the expected results or expected outcomes of a task. It clearly states the goals or standards that should be achieved after completing the action.
[0057] F:Feedback: Clarify how to collect feedback or evaluate results after completing the task. Including the process of checking, confirming or evaluating the results.
[0058] Furthermore, in the RASCEF framework, in the Role module, a general language block is designed to explain the role played by the large language model - the domain requirements engineering expert; in the Action module, the general ambiguity elimination method is explained, including embedded input manual feedback or automatic subtask output; in the Scope and Constraints modules, the fuzzy features to be eliminated are described in detail, and the instructions for the limitation, exclusion, etc. of different features are embedded in the template of this module; in the Expectation module, samples and detailed explanations of the corresponding fuzzy feature elimination 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.
[0059] Furthermore, if there are multiple fuzzy features in the requirement text, the fuzzy features are eliminated one by one according to a preset process, and the preset process includes processing of various types of fuzzy features.
[0060] Specifically, in the preset process, if there are multiple fuzzy features in the requirement text, the fuzzy elimination method process will cycle in the following order to eliminate the fuzzy features one by one:
[0061] 1. Negative statements
[0062] 2. Vague pronouns
[0063] 3. Superlatives
[0064] 4. Comparative phrases
[0065] 5. Subjective language
[0066] 6.Ambiguous adverbs and adjectives
[0067] 7. Open-ended, non-verifiable terms
[0068] 8. Loopholes
[0069] 9. Incomplete references
[0070] 10. Implementation Free
[0071] 11. Singular
[0072] 12.Consistent (demand consistency)
[0073] Furthermore, generally, each problematic requirement item has no more than three fuzzy features, and in most cases, there are problems that violate the unity of the requirement among multiple fuzzy features. For items that violate the unity of the requirement, they can be relatively simply divided into two or more requirement items after eliminating other fuzzy features. Such special fuzzy features require adjustment of the structure of the requirement model storage. For upstream and downstream items that violate the consistency of requirements, in this embodiment, all requirement clusters with this problem will be traversed at the end, and the results will be displayed to the requirements engineer for manual proofreading. Therefore, this scheme introduces a vector database (external knowledge base) into the fuzziness elimination method. By incorporating model project information, model requirement information, internal enterprise standards, industry standards, etc. into the knowledge base in a vectorized form, subtasks can be designed to automatically extract background knowledge related to the requirements to better support the automated fuzziness elimination method.
[0074] Step S300: The output parser parses the received output data to obtain a parsing result, wherein the parsing result includes a modified text and a modified explanation of the requirement text.
[0075] Specifically, the requirement metamodel is modified according to the parsing result, and the modification content includes modification of the requirement text, modification of the requirement reference and modification of the requirement dependency. By modifying the structured requirement, the modification is aligned to the original requirement document.
[0076] Furthermore, this solution designs two fuzzy elimination methods: fully automatic and semi-automatic. In the fully automatic process, fuzzy features are eliminated one by one in the order described above, among which Negative statements do not require the participation of the knowledge base, Vague pronouns features can be supplemented by retrieving project-related information, and seven fuzzy features such as Superlatives, Comparative phrases, Subjective language, Ambiguous adverbs and adjectives, Open-ended, non-verifiable terms, Loopholes, and Incomplete references need to retrieve industry standards related to the entry to replace the grammatical components where the fuzzy features exist. The remaining three fuzzy features generally do not require the participation of external knowledge.
[0077] In the semi-automatic process, the requirements engineer will make a comprehensive judgment based on the analysis results of the fuzzy features and the results of the knowledge base related knowledge search, reconfirm the requirements through a manual input feedback, and give the final modification result in one step. The human can choose to only input feedback, only confirm or only make minor corrections, or give a final result completely by himself.
[0078] Embodiment 1
[0079] A requirement written in the development of a commercial aircraft pre-research project was "A certain aircraft should reduce flight noise as much as possible." After analysis, it was found that it had the fuzzy feature of "fuzzy adjectives or adverbs", and the reasons for the judgment and the problematic statements in the original text were given.
[0080] Question type: vague adjectives or adverbs;
[0081] Judgment reason: The meaning of the word "as far as possible" does not have a clear measurement standard, and different people may have different understandings of it, which makes the requirements difficult to verify or subject to multiple interpretations";
[0082] Problematic expressions in the original text: "as far as possible";
[0083] In the semi-automatic process, the engineer inputs feedback information: "The noise control level of a certain aircraft should comply with ICA0Annex16Volume I-Environmental Protection, Chapter 3-Aircraft Noise: This is the ICAO "Environmental Protection Convention"... ", and the method outputs the unambiguous requirement as "The flight noise control of a certain aircraft should comply with the provisions of ICA0Annex16Volume I-Environmental Protection, Chapter 3-Aircraft Noise".
[0084] In the fully automatic process, the knowledge base detection result is: "Based on the known information, the noise control level of the aircraft should be measured and evaluated in accordance with the equivalent procedures accepted by the Civil Aviation Administration of China. (Referring to the aircraft model and airworthiness certification noise regulations)", and the unambiguous requirement output by the method is "A certain aircraft should reduce flight noise, and the noise control level should be measured and evaluated in accordance with the equivalent procedures accepted by the Civil Aviation Administration of China."
[0085] Based on the same inventive concept, a system for eliminating 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 eliminating fuzzy features of natural language requirements is similar to that of a method for eliminating fuzzy features of natural language requirements, the implementation of a system for eliminating fuzzy features of natural language requirements can refer to the implementation of a method for eliminating 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 conceived.
[0086] like Figure 3 As shown in FIG. 1 , it is a structural block diagram of a system for eliminating fuzzy features of natural language requirements according to an embodiment of the present invention. Figure 3 As shown, including:
[0087] A prompt word generation module 301 is used for generating prompt words according to the received requirement text, requirement references and requirement dependencies, and fuzzy detection results, wherein the requirement references and the requirement dependencies are obtained from instances of the requirement metamodel, and the requirement text includes one or more natural language requirement fuzzy features;
[0088] A fuzzy feature elimination module 302 is used for the large language model to perform fuzzy feature elimination processing on the demand text according to the generated prompt words, and output the output data in JSON format to the output parser;
[0089] The text modification module 303 is used for the output parser to parse the received output data to obtain a parsing result, wherein the parsing result includes a modified text and a modified explanation of the requirement text.
[0090] In summary, the embodiments of the present invention achieve the following technical effects:
[0091] 1. The present invention proposes 12 natural language requirement features that may lead to requirement ambiguity in the actual engineering of complex system development, designs a natural language requirement metamodel and an adaptive large language model prompt word generator suitable for complex systems, which are used to eliminate the fuzzy features of natural language requirements, and uses a vector database to embed background knowledge in the fuzziness elimination method;
[0092] 2. The present invention improves the clarity and usability of requirements through automated and semi-automated methods, combined with a large language model and an adaptive prompt word generator, to adapt to different application scenarios and requirements.
[0093] 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 eliminating fuzzy features of natural language requirements, characterized in that: The method comprises: The fuzzy elimination prompt word generator generates prompt words according to the received requirement text, requirement references and requirement dependencies, and fuzzy detection results, wherein the requirement references and the requirement dependencies are obtained from instances of the requirement metamodel, and the requirement text includes one or more natural language requirement fuzzy features; The large language model performs fuzzy feature elimination processing on the demand text according to the generated prompt words, and outputs output data in JSON format to the output parser; The output parser parses the received output data to obtain a parsing result, which includes a modified text and a modified explanation of the requirement text.
2. The method for eliminating fuzzy features of natural language requirements according to claim 1, characterized in that: The fuzzy elimination prompt word generator generates prompt words according to the received requirement text, requirement references and requirement dependencies, and fuzzy detection results, including: The fuzzy elimination prompt word generator receives manual feedback and background knowledge from an external knowledge base, and generates the prompt word in combination with the requirement text, requirement references and requirement dependencies, and fuzzy detection results, wherein the background knowledge is related to the requirement text.
3. The method for eliminating fuzzy features of natural language requirements according to claim 1, characterized in that: The instance of the requirement metamodel is modified according to the parsing result, and the modification content includes modification of the requirement text, modification of the requirement reference and modification of the requirement dependency.
4. The method for eliminating fuzzy features of natural language requirements according to claim 1, characterized in that: 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.
5. The method for eliminating 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, where the RASCEF framework includes roles, actions, scopes, constraints, expectations, and feedback.
6. The method for eliminating 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.
7. The method for eliminating fuzzy features of natural language requirements according to claim 6, characterized in that: If there are multiple fuzzy features in the requirement text, the fuzzy features are eliminated one by one according to a preset process, and the preset process includes processing of various types of fuzzy features.
8. A system for eliminating fuzzy features of natural language requirements, characterized in that: include: A prompt word generation module, used for the fuzzy elimination prompt word generator to generate prompt words according to the received requirement text, requirement references and requirement dependencies, and fuzzy detection results, wherein the requirement references and the requirement dependencies are obtained from instances of the requirement metamodel, and the requirement text includes one or more natural language requirement fuzzy features; A fuzzy feature elimination module is used for the large language model to perform fuzzy feature elimination processing on the demand text according to the generated prompt words, and output the data in JSON format to the output parser; The text modification module is used for the output parser to parse the received data in JSON format to obtain a parsing result, wherein the parsing result includes a modified text and a modified explanation of the requirement text.
Citation Information
Patent Citations
Demand statement fuzziness judgment method and device
CN114637490A
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
Disambiguity in large language models
US12038918B1