Chinese demand normalization method based on large language model and EARS normal form
By converting the English EARS paradigm into the Chinese EARS paradigm and combining it with the phased processing of the large language model, the problem of low accuracy of the traditional EARS paradigm in Chinese demand standardization is solved, efficient Chinese demand standardization is achieved, and manual intervention and costs are reduced.
Patent Information
- Application Number
- CN202511179531.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-08-22
- Publication Date
- 2025-09-26
- Estimated Expiration
- 2045-08-22
AI Technical Summary
In the existing technology, the traditional EARS paradigm is mainly aimed at English needs and cannot adapt to Chinese word order and expression habits, resulting in a low accuracy rate in the standardization of Chinese needs and a lack of effective solutions that combine the powerful semantic understanding capabilities of large language models.
A method based on a large language model and the EARS paradigm is used to convert the English EARS paradigm model into a Chinese EARS paradigm template. Through phased processing, the Chinese requirements are normalized in combination with the preset large language model, including action uniqueness decomposition, symbol standardization, pronoun disambiguation, grammatical structure conversion and semantic concretization. Finally, the quality of normalization is ensured through evaluation indicators.
It improves the accuracy of Chinese demand standardization, reduces manual intervention, saves project costs, and effectively solves the problems of uniqueness, consistency and clarity of Chinese demand.
Smart Images

Figure CN120704646A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of natural language technology, and in particular, to a Chinese requirements normalization method based on a large language model and the EARS paradigm. Background Art
[0002] Requirements engineering is a key stage in the software development life cycle, including processes such as requirements acquisition, requirements analysis, requirements specification and requirements verification. Standardized requirements description is an important basis for ensuring the quality of software systems.
[0003] Traditionally, requirements standardization relies primarily on manual work by requirements engineers, resulting in low efficiency, inconsistent quality, and high subjectivity. The development of natural language processing technology, particularly the rise of Large Language Models (LLMs), has provided a new technical path for the automation of requirements engineering.
[0004] EARS (Easy Approach to Requirements Syntax) is a requirements standardization method proposed by Rolls-Royce. It uses predefined syntax templates to standardize requirements expressions. Traditional EARS mainly includes five modes: Ubiquitous, Event-driven, State-driven, Optional, and Complex.
[0005] However, the prior art has the following deficiencies: 1. The traditional EARS paradigm is mainly based on English grammar design, and its grammatical structure is "The <system>shall <response>"Not adapting to the word order and expression habits of Chinese; 2. Existing automated requirements normalization methods primarily target English requirements and lack methods specifically tailored to Chinese grammatical characteristics and semantic expressions. 3. Traditional methods have low accuracy in unique identification, ambiguity resolution, and pronoun replacement for Chinese language requirements. 4. Existing technologies lack an effective solution that combines the powerful Chinese language understanding capabilities of large language models to improve the quality of demand standardization.
[0006] For example, Chinese patent application CN114692588B discloses an expansion method based on the semi-structured natural language EARS demand template, but this method is mainly based on rule templates and does not combine the semantic understanding capabilities of large language models. It has limited effect when processing complex Chinese expressions. Summary of the Invention
[0007] In response to one of the defects in the prior art, the purpose of this application is to provide a Chinese requirements normalization method based on a large language model and the EARS paradigm.
[0008] In a first aspect, the present application provides a Chinese requirements normalization method based on a large language model and the EARS paradigm, comprising: According to the Chinese grammatical structure, the English EARS paradigm model is converted into the Chinese EARS paradigm template; Input the original requirement text and the preset first-stage prompt words into the preset large language model to determine the first-stage output text; Inputting the first-stage output text and the preset second-stage prompt words into the preset large language model, performing structural conversion according to the Chinese EARS paradigm template, and determining the second-stage output text; According to the preset evaluation indicators, the quality of the output text of the second stage is evaluated to determine the standardized requirement text that conforms to the Chinese EARS paradigm.
[0009] Optionally, the English EARS paradigm modes include Ubiquitous, Event-driven, State-driven, Optional and Complex; The Chinese EARS paradigm template includes: under the <precondition>, the <executing subject> should <perform action> with <target effect>; the <precondition> and the <target effect> represent optional elements, and the <executing subject> and the <perform action> represent mandatory elements.
[0010] Optionally, the method further includes: According to the first-stage demand text processing task, a preset first-stage prompt word is constructed, wherein the preset first-stage prompt word is used to perform action uniqueness decomposition processing, symbol standardization processing, and pronoun disambiguation processing on the original demand text; According to the second-stage required text processing tasks, a preset second-stage prompt word is constructed, wherein the preset second-stage prompt word is used to perform grammatical structure conversion processing, semantic concretization processing, and terminology standardization processing on the output text of the first stage; A few-sample learning strategy is adopted to embed a preset number of standardized examples into the preset first-stage prompt words and the preset second-stage prompt words respectively.
[0011] Optionally, inputting the original requirement text and the preset first-stage prompt words into a preset large language model to determine the first-stage output text includes: According to the preset first-stage prompt words, the original requirement text is subjected to action uniqueness decomposition processing to determine the atomic requirements of a single action; Performing symbol normalization processing on the atomic requirements of the single action to determine the atomic requirements that have undergone symbol normalization processing; The pronoun disambiguation process is performed on the atomic requirements that have undergone symbol standardization to determine the output text of the first stage. Optionally, the action uniqueness decomposition process is performed on the original requirement text based on the preset first stage prompt words to determine the atomic requirements of a single action, including: Using a preset verb recognition algorithm to perform action verb detection on the original demand text to determine the action verbs in the original demand text; Performing parallel logical connectives detection on the original demand text to determine the parallel logical connectives in the original demand text; The original requirement text is split into actions according to the action verbs and the parallel logical connectives to determine the atomic requirements of the single action.
[0012] Optionally, performing symbol normalization processing on the atomic requirements of the single action to determine the atomic requirements that have undergone symbol normalization processing includes: Remove the brackets from the atomic requirements of the single action; Replace the symbol " / " in the atomic requirement of the single action with the Chinese expression "or" to determine the atomic requirement after symbol standardization. Optionally, performing pronoun disambiguation processing on the atomic requirements that have undergone symbol normalization processing to determine the first-stage output text includes: The pronouns in the atomic requirements that have undergone symbol standardization are replaced with specific entity names to determine the output text of the first stage.
[0013] Optionally, the step of inputting the first-stage output text and the preset second-stage prompt words into the preset large language model, performing structural conversion according to the Chinese EARS paradigm template, and determining the second-stage output text includes: Converting the output text of the first stage into text corresponding to the Chinese ERAS paradigm template; Convert the passive voice in the text corresponding to the Chinese ERAS paradigm template into the active voice; Convert the vague expressions in the text corresponding to the Chinese ERAS paradigm template into specific expressions; Convert the unverifiable statements in the text corresponding to the Chinese ERAS paradigm template into testable statements; The non-primary <target effect> in the text corresponding to the Chinese ERAS paradigm template is removed to determine the output text of the second stage.
[0014] Optionally, the preset evaluation indicators include EARS paradigm consistency index, grammatical correctness index, and semantic completeness index.
[0015] Optionally, the quality evaluation of the output text of the second stage is performed according to preset evaluation indicators to determine the standardized requirement text that conforms to the Chinese EARS paradigm, including: Performing EARS paradigm consistency testing on the output text of the second stage using the EARS paradigm consistency index to determine the requirement text that has undergone the EARS paradigm consistency testing; Using the grammatical correctness index to perform grammatical correctness detection processing on the requirement text that has undergone the EARS paradigm consistency detection, and determining the requirement text that has undergone the grammatical correctness detection processing; The semantic integrity index is used to perform semantic integrity detection on the requirement text that has undergone grammatical correctness detection to determine the standardized requirement text that conforms to the Chinese EARS paradigm.
[0016] In a second aspect, this application provides a Chinese requirements normalization system based on a large language model and the EARS paradigm, including: Chinese EARS paradigm template construction module, used to convert English EARS paradigm patterns into Chinese EARS paradigm templates based on Chinese grammatical structure; The first-stage requirement text processing module is used to input the original requirement text and the preset first-stage prompt words into the preset large language model to determine the first-stage output text; The second-stage demand text processing module is used to input the first-stage output text and the preset second-stage prompt words into the preset large language model, perform structural conversion according to the Chinese EARS paradigm template, and determine the second-stage output text; The quality evaluation module is used to evaluate the quality of the output text of the second stage according to the preset evaluation indicators and determine the standardized requirement text that conforms to the Chinese EARS paradigm.
[0017] The third aspect of the present application provides a non-temporary computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the steps of any one of the methods provided in the first aspect of the present application.
[0018] According to a fourth aspect of the present application, an electronic device is provided, comprising: a memory having a computer program stored thereon; A processor is used to execute the computer program in the memory to implement the steps of any one of the methods provided in the first aspect of the present application.
[0019] The Chinese demand normalization method based on the large language model and EARS paradigm in this application adopts the Chinese EARS paradigm template for Chinese demands to improve the accuracy of processing Chinese demands, and combines it with the preset large language model. Through the powerful semantic understanding ability and phased processing strategy of the large language model, it realizes end-to-end automated processing, reduces manual intervention, effectively improves the processing quality and efficiency of Chinese demands, and saves project costs.
[0020] Other technical effects brought about by the additional features will be further explained in the corresponding embodiments. BRIEF DESCRIPTION OF THE DRAWINGS
[0021] Other features, objects and advantages of the present application will become more apparent upon reading the detailed description of non-limiting embodiments with reference to the following drawings: Figure 1 The figure is a flowchart of a Chinese requirement normalization method based on a large language model and the EARS paradigm according to an exemplary embodiment.
[0022] Figure 2 The figure is a structural diagram of a Chinese requirement normalization system based on a large language model and the EARS paradigm according to an exemplary embodiment. DETAILED DESCRIPTION
[0023] The present application is described in detail below with reference to specific embodiments. The following embodiments will help those skilled in the art to further understand the present application, but are not intended to limit the present application in any form. It should be noted that those skilled in the art may make several variations and improvements without departing from the scope of the present application. These all fall within the scope of protection of the present application.
[0024] In the embodiments of the present application, the terms "including" and "having" and any variations thereof are intended to cover non-exclusive inclusions. For example, a process, method, system, product, or apparatus comprising a series of steps or units is not limited to the listed steps or units, but may optionally include steps or units not listed, or may optionally include other steps or units inherent to the process, method, product, or apparatus.
[0025] Furthermore, the terms "first" and "second" are used for descriptive purposes only and should not be understood to indicate or imply relative importance or implicitly specify the quantity of the technical features indicated. Thus, features specified as "first" or "second" may explicitly or implicitly include one or more of such features.
[0026] Traditional requirements normalization relies primarily on manual work by requirements engineers, resulting in low efficiency, unstable quality, and high subjectivity. Furthermore, the traditional EARS paradigm, which primarily targets English requirements, is not adapted to the word order and expression conventions of Chinese, resulting in low accuracy when processing Chinese requirements. To address these issues, the present application provides a method for normalizing Chinese requirements based on a large language model and the EARS paradigm to address these issues.
[0027] Figure 1 The figure is a flowchart of a Chinese requirement normalization method based on a large language model and the EARS paradigm according to an exemplary embodiment.
[0028] Reference Figure 1 As shown, an embodiment of the present application, a Chinese requirement normalization method based on a large language model and the EARS paradigm, includes S11 to S14.
[0029] S11, based on the Chinese grammatical structure, convert the English EARS paradigm model into the Chinese EARS paradigm template.
[0030] S12, inputting the original demand text and the preset first-stage prompt words into the preset large language model to determine the first-stage output text.
[0031] S13, inputting the first-stage output text and the preset second-stage prompt words into the preset large language model, performing structural conversion according to the Chinese EARS paradigm template, and determining the second-stage output text.
[0032] S14, based on the preset evaluation indicators, the quality of the output text of the second stage is evaluated to determine the standardized requirement text that conforms to the Chinese EARS paradigm.
[0033] The above-mentioned embodiment of the present application adopts the Chinese EARS paradigm template for Chinese requirements to improve the accuracy of processing Chinese requirements, and combines it with the preset large language model. Through the powerful semantic understanding ability and phased processing strategy of the large language model, end-to-end automated processing is achieved, manual intervention is reduced, and the processing quality and efficiency of Chinese requirements are effectively improved, saving project costs.
[0034] In some specific implementations of the present application, the English EARS paradigm modes include Ubiquitous, Event-driven, State-driven, Optional and Complex.
[0035] Specifically, Ubiquitous means universal, Event-driven means event-driven, State-driven means state-driven, Optional means optional, and Complex means complex.
[0036] The Chinese EARS paradigm template includes: Under <preconditions>, <executing subject> should <perform action> with <target effect>.
[0037] Specifically, <precondition> and <target effect> represent optional elements, and <execution subject> and <execution action> represent mandatory elements.
[0038] To obtain the Chinese EARS paradigm, for S11, according to the Chinese grammatical structure, the English EARS paradigm model is converted into the Chinese EARS paradigm template, which can be used: Based on the Chinese grammatical structure, five English EARS paradigms, namely Ubiquitous, Event-driven, State-driven, Optional and Complex, are converted into Chinese EARS paradigm templates, that is, under the <precondition>, the <executing subject> should <perform the action> with the <target effect>.
[0039] Specifically, the Chinese grammatical structure includes subject, predicate, object, attributive, adverbial, complement and their corresponding word order positions.
[0040] In the Chinese EARS template, <precondition> represents the condition or state that triggers the Chinese requirement, corresponding to the when, if, and while conditions in the English EARS template; <Executing entity> represents the system, module or role that performs the action; <Execution action> indicates the specific function or behavior that needs to be completed; <Target effect> indicates the purpose or effect of performing an action and is used to improve comprehensibility.
[0041] In order to obtain the Chinese EARS paradigm, in some specific implementations of the present application, a Chinese EARS element identification rule knowledge base is constructed, including: a Chinese trigger vocabulary and subject identification rules.
[0042] Specifically, the Chinese trigger vocabulary includes a conditional trigger vocabulary, an action trigger vocabulary, and an effect trigger vocabulary.
[0043] The conditional trigger vocabulary may include but is not limited to: when..., if..., under..., if...; Action trigger words may include but are not limited to: should, must, need, ought to, can; The effect trigger vocabulary may include but is not limited to: so that, for the sake of, thereby, and ensure.
[0044] The subject identification rules are used to identify the execution action entity in the Chinese requirement normalization, ensuring the correct extraction of the <execution subject> element in the EARS paradigm template.
[0045] Specifically, the subject identification rules include: 1. Vocabulary-level recognition: Establish a main vocabulary, including predefined vocabulary such as system category (system, platform, module, device), personnel category (user, administrator, operator), and business entity category (department, account, order).
[0046] 2. Grammatical position recognition: Based on the characteristics of Chinese word order, it recognizes the grammatical patterns of sentence-initial subject ("<subject> + should + <action>") and passive voice conversion ("<action> + by + <subject> + execute").
[0047] 3. Pronoun disambiguation: Replace pronouns such as "the system", "it", and "relevant personnel" with specific entity names to avoid unclear reference issues.
[0048] 4. Split composite subjects: Split parallel subjects such as "users and administrators" into independent single subject requirements.
[0049] 5. Contextual inference: When the subject is missing, the implicit subject is inferred based on the business domain and previous context, and a default subject priority is established (System > User > Administrator).
[0050] For example, the subject identification rule is used to identify the action entity and convert it into the Chinese EARS paradigm: Original text: "When the user logs in, the personal homepage should be displayed"; Recognition result: implicit subject "system"; Standardization: "When the user is logged in, the system should display the personal homepage."
[0051] For example, the subject identification rule is used to identify the action entity and convert it into the Chinese EARS paradigm: Original text: "Data verification and backup are completed by the security module"; Recognition result: subject "security module" in passive voice; Standardization: "Security modules should complete data verification and backup."
[0052] The above-mentioned embodiment of the present application converts the English EARS paradigm model into a Chinese EARS paradigm template standardized for Chinese requirements, and constructs a Chinese EARS element identification rule knowledge base. When processing Chinese requirements, it can accurately identify the execution subject and understand the semantics of Chinese requirements, thereby improving the accuracy of the standardization of Chinese requirements and reducing the quality issues of Chinese requirements.
[0053] In order to achieve standardized processing of Chinese requirements, in some specific implementations of the present application, a Chinese requirements normalization method based on a large language model and the EARS paradigm may also include S15 to S17.
[0054] S15, constructing preset first-stage prompt words according to the first-stage required text processing task.
[0055] Specifically, the first stage requires text processing tasks including action uniqueness decomposition and text normalization.
[0056] The preset first-stage prompt words are used to perform action uniqueness decomposition, symbol standardization, and pronoun disambiguation on the original demand text.
[0057] For example, the preset first-stage prompt word template is: #Task Description: You are a professional requirements engineer. Please pre-process the Chinese requirements text.
[0058] #Processing target: Unique decomposition: split requirements containing multiple actions into multiple independent requirements; Text standardization: standardizing symbols and text representations.
[0059] #Uniqueness judgment criteria: Each independent requirement contains an action verb; Identify coordinating logical connectives; Multiple independent requirements are semantically complete.
[0060] #Text normalization rules: Remove brackets: remove bracket symbols and their contents; Symbol replacement: replace " / " with "or"; Pronoun disambiguation: Replace "the system" and "it" with specific entity names.
[0061] #Text to be processed {input_text} Please follow the above requirements:.
[0062] S16, constructing preset second-stage prompt words according to the second-stage required text processing task.
[0063] Specifically, the second-stage requirement text processing task includes converting the requirement text into the standard Chinese EARS paradigm format.
[0064] The preset second-stage prompt words are used to perform grammatical structure conversion, semantic concretization and terminology standardization on the first-stage output text.
[0065] For example, the preset second-stage prompt word template is: #Task Description: Please convert the following requirement text into the standard Chinese EARS format.
[0066] #ChineseEARS paradigm template: "Under <precondition>, <executing entity> shall <perform action>, with <target effect>"; Note: <Precondition> and <Target Effect> are optional elements.
[0067] #Conversion rules: Voice conversion: convert passive voice into active voice; Accurate word meaning: convert vague descriptive words into specific descriptive words; Testability: converting subjective evaluation into objective evaluation; Simplicity: Remove non-primary <target effect>.
[0068] # Vocabulary replacement table: "suitable" is replaced by "meeting performance requirements"; "Sufficient" is replaced by "not less than the preset first threshold"; "Efficiently" is replaced by "within the specified time"; "Stably" is replaced by "with a failure rate less than a preset second threshold value".
[0069] The preset second threshold may be 0.1%.
[0070] # Text to be processed {input_text} Please convert according to the Chinese EARS template.
[0071] S17 adopts a few-shot learning strategy to embed a preset number of standardized examples in the preset first-stage prompt words and the preset second-stage prompt words respectively.
[0072] Specifically, Few-shot Learning strategy; 3-5 standardized examples can be embedded in the preset first-stage prompt words and the preset second-stage prompt words respectively.
[0073] For example, the annotation example is embedded in the preset first-stage prompt word: Input: The system should perform data verification and (automatic) backup, and generate log files; Output: 1. The system should perform data verification; 2. The system should perform automatic backup; 3. The system should generate log files.
[0074] For example, a standardized example is embedded in the preset second-stage prompt word: Input: The system should perform data validation; Output: The system should validate the format and integrity of input data.
[0075] The above-mentioned embodiment of the present application effectively solves the uniqueness, consistency and clarity problems of Chinese requirements by constructing preset first-stage prompt words and preset second-stage prompt words, thereby reducing the quality problem of requirements.
[0076] In order to combine the large language model to achieve standardized processing of Chinese requirements, the API interface of the preset large language model is accessed and the preset large language model is called. In some specific implementations of this application, the preset large language model can adopt a pre-trained model based on the Transformer architecture, with a parameter scale of not less than 7 billion, and supports Chinese semantic understanding.
[0077] Exemplarily, the preset large language model may include GPT-3.5, GPT-4, ChatGLM, and ERNIE.
[0078] In order to achieve standardized processing of Chinese requirements, in some specific implementations of the present application, for S12, the original requirement text and the preset first-stage prompt words are input into the preset large language model to determine the first-stage output text, which can be achieved by: S121 to S122.
[0079] S121: Based on the preset first-stage prompt words, the original requirement text is decomposed into action uniqueness to determine the atomic requirements of a single action.
[0080] Specifically, according to the preset first-stage prompt words, the uniqueness judgment rule is adopted to perform action uniqueness decomposition processing on the original requirement text.
[0081] Uniqueness judgment rules include: action quantity detection, parallel logical connective analysis, and semantic integrity judgment.
[0082] In some specific implementations of the present application, S121 may adopt S1211 to S1213.
[0083] S1211: Use a preset verb recognition algorithm to detect action verbs in the original demand text to determine the action verbs in the original demand text.
[0084] S1212: Perform parallel logical connectives detection on the original requirement text to determine the parallel logical connectives in the original requirement text.
[0085] Specifically, parallel logical conjunctions include but are not limited to "and", "and", and "at the same time".
[0086] S1213: Split the original requirement text into actions based on action verbs and parallel logical connectives to determine the atomic requirements of a single action.
[0087] Specifically, the atomic requirements of a single action are semantically complete and independent.
[0088] The above-mentioned embodiment of the present application decomposes the original requirement text into atomic requirements of a single action through uniqueness evaluation rules, thereby improving the accuracy of Chinese requirements.
[0089] S122, performing symbol standardization processing on the atomic requirements of the single action to determine the atomic requirements that have undergone symbol standardization processing.
[0090] Specifically, S122 may include: Replace the symbol " / " in the atomic requirement of a single action with the Chinese expression "or" to determine the atomic requirement after symbol standardization.
[0091] S123, performing pronoun disambiguation processing on the atomic requirements that have undergone symbol standardization processing to determine the first-stage output text.
[0092] Specifically, S123 may include: The pronouns in the atomic requirements that have undergone symbol standardization are replaced with specific entity names to determine the output text of the first stage.
[0093] Herein, pronouns may include but are not limited to "the system" and "it".
[0094] The output text of the first stage is the output text set processed by the first stage.
[0095] The above-mentioned embodiment of the present application adopts the first-stage prompt words and combines them with a preset large language model, and applies the powerful semantic understanding ability of the preset large language model to effectively solve the uniqueness problem of Chinese requirements and text standardization problems, realize end-to-end automated processing, reduce manual intervention, and save labor costs.
[0096] In order to achieve standardized processing of Chinese requirements, in some specific implementations of the present application, for S13, the first-stage output text and the preset second-stage prompt words are input into the preset large language model, and structural conversion is performed according to the Chinese EARS paradigm template to determine the second-stage output text, and S131 to S135 can be used.
[0097] S131, converting the output text of the first stage into the text corresponding to the Chinese ERAS paradigm template.
[0098] Specifically, the output text of the first stage is converted into a text in the form of "under <precondition>, <execution subject> should <execute action>, with <target effect>".
[0099] S132, convert the passive voice in the text corresponding to the Chinese ERAS paradigm template into active voice.
[0100] Exemplarily, the passive voice of "being executed" and "being processed" is converted into the active voice, that is, converted into <executing subject> should <perform action>.
[0101] S133, convert the vague expressions in the text corresponding to the Chinese ERAS paradigm template into specific expressions.
[0102] For example, vague words such as "appropriate", "sufficient", and "as far as possible" are replaced with specific quantitative indicators or clear descriptions.
[0103] For example, replace "appropriate" with the specific specification standard: Performance requirements: Original requirement: "The system should provide appropriate response time"; After conversion: "The system should respond to user requests within 3 seconds."
[0104] Quantitative standards: time threshold, percentile requirements.
[0105] Capacity requirement class: Original requirement: "The database should have appropriate storage space"; After conversion: "The database should provide no less than 1TB of available storage space."
[0106] Quantitative standards: specific capacity values and growth reserves.
[0107] For example, replace "sufficient" with the minimum threshold requirement Resource configuration class: Original requirement: "The server should have sufficient memory"; After conversion: "The server should be configured with no less than 16GB of RAM memory."
[0108] Quantitative standards: minimum configuration requirements, peak load standards.
[0109] Security strength class: Original requirement: "The password should be sufficiently complex"; After conversion: "The password should contain at least 8 characters, including uppercase and lowercase letters, numbers and special symbols."
[0110] Quantitative standards: length, character type, and combination requirements.
[0111] For example, replace "as much as possible" with the optimization target bound: Performance optimization class: Original requirement: "The system should process requests as quickly as possible"; After conversion: "The system should process 95% of requests within 2 seconds under normal load."
[0112] Quantitative criteria: percentile performance, load conditions.
[0113] Resource Utilization: Original requirement: "memory usage should be reduced as much as possible"; After conversion: "Application memory usage should be controlled within 512MB."
[0114] Quantitative standards: resource upper limit and monitoring threshold.
[0115] S134, convert the unverifiable statements in the text corresponding to the Chinese ERAS paradigm template into testable statements.
[0116] For example, subjective evaluations such as "efficiently" and "stably" are converted into quantifiable performance indicators.
[0117] For example, replace "efficiently" with the efficiency performance indicator: Processing efficiency: Original requirement: "The system should process batch data efficiently"; After conversion: "The system should process batch data at a rate of not less than 1000 records per second."
[0118] Quantitative standards: throughput, processing rate.
[0119] Algorithm efficiency: Original requirement: "The search function should return results efficiently"; After conversion: "The search function should return results within 500 milliseconds and support retrieval of 100,000 data items."
[0120] Quantitative criteria: response time, data size.
[0121] For example, replace "stably" with the reliability indicator: System availability class: Original requirement: "The system should provide services stably" After conversion: "The system should maintain 99.9% monthly availability, with unplanned downtime not exceeding 8 hours / month."
[0122] Quantitative criteria: availability percentage, downtime limit.
[0123] Error rate control class: Original requirement: "Data transmission should be stable"; After conversion: "The data transmission error rate should be less than 0.01%, and the automatic retransmission mechanism should be supported."
[0124] Quantitative standards: error rate threshold, recovery mechanism.
[0125] S135, remove the non-primary <target effect> in the text corresponding to the Chinese ERAS paradigm template and determine the output text of the second stage.
[0126] Specifically, non-primary <target effect> refers to other <target effects> other than the core <target effect> in the text corresponding to the Chinese ERAS paradigm template, indicating redundant <target effect>.
[0127] The above-mentioned embodiment of the present application adopts the second-stage prompt words and combines them with the preset large language model, applies the powerful semantic understanding ability of the preset large language model, performs structural conversion based on the Chinese EARS model template, and improves the execution language quality by converting the passive voice into the active voice, converting the vague expressions into specific annotations, and converting the unverifiable expressions into testable expressions. By removing non-primary <target effects>, the conciseness of the text is improved.
[0128] Based on the above steps S12 to S13, this application adopts the preset first-stage prompt words and the preset second-stage prompt words, combined with the preset large language model, and through a phased processing strategy, effectively solves the uniqueness, consistency, and clarity problems of Chinese requirements. The quality problems of Chinese requirements can be reduced by more than 60%, and manual intervention can be reduced by more than 80%.
[0129] In some specific embodiments of the present application, the preset evaluation indicators include the EARS paradigm consistency indicator, the grammatical correctness indicator, and the semantic completeness indicator.
[0130] In order to ensure the quality of the standardized requirement text, in some specific implementations of the present application, for S14, the quality of the second-stage output text is evaluated according to preset evaluation indicators to determine the standardized requirement text that conforms to the Chinese EARS paradigm, which can be adopted: S141 to S143.
[0131] S141, using the EARS paradigm consistency index to perform EARS paradigm consistency detection on the output text of the second stage, and determine the requirement text that has undergone the EARS paradigm consistency detection.
[0132] Specifically, the EARS paradigm consistency indicators can be: Format matching: "Under <precondition>, <executing subject> should <perform action>, with <target effect>"; Required elements: <executing entity> + should + <action>; Optional elements: <Preconditions>, <Target Effect>.
[0133] For example, the requirement text that conforms to the EARS paradigm is: "The system should authenticate the user." "When the user is logged in, the system should display the main interface." "Users should enter a valid email address." For example, the requirement text that does not conform to the EARS paradigm is: "Authenticate user" (missing subject and should).
[0134] "The system authenticates the user" (missing "should").
[0135] "The system should authenticate the user" ("should" rather than "ought").
[0136] S142, using a grammatical correctness index to perform grammatical correctness detection processing on the requirement text that has undergone the EARS paradigm consistency detection, and determining the requirement text that has undergone the grammatical correctness detection processing.
[0137] Specifically, the grammatical correctness index can be: The subject-verb-object structure is complete; verbs are used accurately; punctuation is correct; and word order conforms to Chinese conventions.
[0138] For example, grammatically correct requirement text: "The system should save user data." (Complete subject, predicate, and object).
[0139] "In the event of a network disconnect, the system should switch to offline mode." (Correct word order).
[0140] For example, the grammatically incorrect requirement text: "The system should preserve user data" (missing period).
[0141] "The system should save user data." (Word order error).
[0142] "The system should be preserved." (missing object).
[0143] S143, using semantic integrity indicators to perform semantic integrity check on the requirement text that has been processed for grammatical correctness, to determine the standardized requirement text that conforms to the Chinese EARS paradigm.
[0144] Specifically, the semantic integrity indicator can be: The action description is clear and specific; the execution object is clear; the logical relationship is complete; and it is highly understandable.
[0145] For example, a semantically complete requirement text: "The system should perform MD5 encryption on the password entered by the user." (The action, object, and method are all clear).
[0146] "If a user enters an incorrect password three times in a row, the system should lock the user account for 30 minutes." (The conditions, actions, and duration are all specific).
[0147] For example, a semantically incomplete requirement text: "The system should process the data." (How this is done is unclear).
[0148] "The system should be validated." (The object of validation is unclear).
[0149] "Users should take action." (The action content is missing).
[0150] In the above embodiment of the present application, the quality of the output text of the second stage is evaluated by using the EARS paradigm consistency index, grammatical correctness index, and semantic completeness index to ensure that the output text conforms to the Chinese EARS paradigm and guarantees the quality of the output text.
[0151] The preferred features of the above embodiments can be used alone in any embodiment, or in any combination without conflict. In addition, parts not described in detail in the embodiments can be implemented using existing technologies.
[0152] The following further illustrates the present application in conjunction with specific application examples / comparative examples to facilitate a better understanding of the above technical solutions of the present application. It should be understood that the following are merely partial examples and are not intended to limit the present application.
[0153] In some specific implementations of the present application, based on steps S15 to S16 and steps S12 to S13 of the present application, OpenAI's ChatGPT model is called to process the original demand text in stages to obtain the output text, i.e., the second-stage output text. The code implemented using Python software is as follows: Python import openai class LLMProcessor: def __init__(self, model_name="gpt-3.5-turbo", api_key ="your_key"): self.model = model_name self.client = openai.OpenAI(api_key =api_key) def process_stage1(self, requirements_text): prompt = self.build_stage1_prompt(requirements_text) response = self.client.chat.completions.create( model=self.model, messages= [{"role": "user", "content": prompt}], temperature=0.1, # Reduce randomness to ensure consistency max_tokens=2000 ) return self.parse_stage1_output(response.choices[0].message.content) def process_stage2(self, preprocessed_requirements): results = [ ] for req in preprocessed_requirements: prompt = self.build_stage2_prompt(req) response = self.client.chat.completions.create( model=self.model, messages= [{"role": "user", "content": prompt}], temperature=0.1, max_tokens = 1000 ) results.append(response.choices[0].message.content.strip()) return results Specifically, the code is parsed as follows: 1. Class initialization (__init__ method) Receives two parameters: model_name (model name, default gpt-3.5-turbo) and api_key (OpenAI API key).
[0154] Initialize the model name and create an OpenAI client instance (for subsequent API calls).
[0155] First stage processing (process_stage1 method) Input: Original requirements text (requirements_text).
[0156] process: ① Call the build_stage1_prompt method to generate the first stage prompt words.
[0157] ② Call the OpenAI API, send the prompt word to the model, and get a response (temperature=0.1 means the output is more stable).
[0158] ③ Call the parse_stage1_output method to parse the model output and obtain the preprocessed requirements list.
[0159] Second stage processing (process_stage2 method) Input: The list of requirements after preprocessing in the first stage (preprocessed_requirements).
[0160] process: ① Traverse each sub-requirement after preprocessing.
[0161] ② For each sub-requirement, call the build_stage2_prompt method to generate the second-stage prompt words.
[0162] ③ Call the OpenAI API one by one to process sub-requirements and obtain standardized results.
[0163] ④ Collect all results and return a processed list, which is the second stage output text.
[0164] In some specific implementations of the present application, based on step S14 of the present application, the quality of the output text of the second stage is evaluated according to the preset evaluation indicators to determine the standardized requirement text that conforms to the Chinese EARS paradigm. The code implemented using Python software is as follows: Python class QualityEvaluator: def __init__(self): self.ears_pattern = r'^(In the case of .+,)?(.+) should be (.+)(, with .+)?. ?$' def evaluate_quality(self, requirements_list): scores = {} for i, req in enumerate(requirements_list): scores[f"req_{i}"] = { "ears_compliance": self.check_ears_format(req), "grammatical_correctness": self.check_grammar(req), "semantic_completeness": self.check_completeness(req), "testability": self.check_testability(req) } return scores def check_ears_format(self, requirement): import re return bool(re.match(self.ears_pattern, requirement)) def check_grammar(self, requirement): # Check grammatical correctness: subject, predicate, object completeness, punctuation, etc. has_subject = any(word in requirement for word in ["system", "user", "module"]) has_action = "should" in requirement return has_subject and has_action def check_completeness(self, requirement): # Check semantic integrity: clear actions and clear objects return len(requirement) > 10 and "should" in requirement def check_testability(self, requirement): # Checking Testability: Avoid Subjective Statements subjective_words = ["suitable", "sufficient", "efficient", "stable", "beautiful"] return not any(word in requirement for word in subjective_words) Specifically, the code is parsed as follows: 1. Class initialization (__init__ method) (1) A regular expression ears_pattern is defined to match a specific requirement format (EARS pattern).
[0165] (2) The meaning of this regular expression is: the requirement format should be "(under... circumstances,)...should...(, with...).", for example, "When a user logs in, the system should record the login time." 2. Core evaluation method (evaluate_quality) Input: requirements_list (each entry is a string).
[0166] Output: A dictionary whose keys are the requirement numbers (e.g., req_0) and whose values are the evaluation results of the requirement in four dimensions (Boolean values: True if it meets the requirement, False if it does not meet the requirement).
[0167] The four evaluation dimensions include: EARS format compliance, grammatical correctness, semantic completeness, and testability.
[0168] 3. Inspection methods for each dimension check_ears_format: Checks that the requirement conforms to the EARS format using the initialized regular expression.
[0169] check_grammar: Checks whether the grammar is complete by determining whether it contains a subject (such as "system" or "user") and "should" (an action marker).
[0170] check_completeness: Roughly checks semantic completeness by judging length (>10 words) and containing "should".
[0171] check_testability: Checks whether subjective words (such as "suitable" and "efficient") are included. If not, the testability meets the requirements.
[0172] In some specific embodiments of the present application, based on the above steps S11 to S17, the process of outputting standardized requirement text that conforms to the Chinese EARS paradigm by using the Chinese EARS paradigm template combined with a preset large language model through phased processing and quality evaluation is implemented using Python software as follows: Python class ChineseRequirementsNormalizer: def __init__(self): self.llm_processor = LLMProcessor() self.quality_evaluator = QualityEvaluator() self.ears_template = "Under <precondition>, <execution subject> should <execute action>, with <target effect>" def normalize_requirements(self, input_requirements): # Step 1: First stage processing preprocessed = self.llm_processor.process_stage1(input_requirements) # Step 2: Second stage processing normalized = self.llm_processor.process_stage2(preprocessed) # Step 3: Quality Assessment quality_scores = self.quality_evaluator.evaluate_quality(normalized) # Step 4: Output the result return { "original": input_requirements, "preprocessed": preprocessed, "normalized": normalized, "quality_scores": quality_scores } Specifically, the code is parsed as follows: 1. Class initialization (__init__ method) def __init__(self): self.llm_processor = LLMProcessor() # Large Language Model Processor self.quality_evaluator = QualityEvaluator() # Quality Evaluator self.ears_template = "Under <precondition>, <execution subject> should <execute action>, with <target effect>" Functional Description: Component initialization: Create LLM processor and quality evaluator instances to implement modular design; Template definition: Set the Chinese EARS standard template as the target format for standardization; Architecture design: Adopt the composite mode to decompose complex functions into independent components; 2. Core processing method (normalize_requirements): Method signature and parameters: def normalize_requirements(self, input_requirements): # input_requirements: original Chinese requirement text (string or list) # Return value: A dictionary containing the complete processing results Detailed explanation of the four-step process: Step 1: First stage preprocessing: preprocessed = self.llm_processor.process_stage1(input_requirements) Purpose: Decomposition of unique requirements and text standardization Processing content: Splitting multiple action requirements: "The system should validate and save data" → Split into two independent requirements Special symbol processing: remove "()", replace " / " with " or " Pronoun disambiguation: Replace "the system" and "it" with specific entity names Output: Preprocessed requirement text list Step 2, second stage normalization: normalized = self.llm_processor.process_stage2(preprocessed) Purpose: EARS paradigm shift and language quality improvement Processing content: Format conversion: rewrite requirements into standard EARS format Voice adjustment: passive voice → active voice Precision processing: fuzzy words → specific description Output: A list of standardized requirements texts that conform to the EARS paradigm Step 3: Quality Assessment quality_scores = self.quality_evaluator.evaluate_quality(normalized) Purpose: Multi-dimensional quality inspection Evaluation dimensions: EARS format compliance: conformity with the standard structure Grammatical correctness: subject-verb-object completeness check Semantic integrity: action and object clarity Testability: Avoid Subjective Statements Output: Quality score dictionary for each requirement Step 4: Result integration: return { "original": input_requirements, # original input "preprocessed": preprocessed, # preprocessing results "normalized": normalized, # Normalized results "quality_scores": quality_scores # Quality score } 3. Complete code function extension example class ChineseRequirementsNormalizer: def __init__(self): self.llm_processor = LLMProcessor() self.quality_evaluator = QualityEvaluator() self.ears_template = "Under <precondition>, <execution subject> should <execute action>, with <target effect>" # Extension: Add configuration parameters self.min_quality_threshold = 0.8 # quality threshold self.max_retry_attempts = 3 # Maximum number of retries def normalize_requirements(self, input_requirements): """ Main process of demand standardization Args: input_requirements (str|list): original requirement text Returns: dict: dictionary containing the complete processing results Example: normalizer = ChineseRequirementsNormalizer() result = normalizer.normalize_requirements("The system needs to verify the user password") """ Input Validation if not input_requirements or not input_requirements.strip(): raise ValueError("Input requirement cannot be empty") try: # Step 1: First stage processing (preprocessing) print("Executing the first stage of processing...") preprocessed = self.llm_processor.process_stage1(input_requirements) # Step 2: Second stage processing (normalization) print("Executing the second stage of processing...") normalized = self.llm_processor.process_stage2(preprocessed) # Step 3: Quality Assessment print("Performing quality assessment...") quality_scores = self.quality_evaluator.evaluate_quality(normalized) # Extension: Quality Filtering filtered_results = self._filter_by_quality(normalized,quality_scores) # Step 4: Output the result return { "original": input_requirements, "preprocessed": preprocessed, "normalized": normalized, "filtered_results": filtered_results, # High-quality results "quality_scores": quality_scores, "processing_summary": self._generate_summary(quality_scores) } except Exception as e: return { "error": f"Processing failed: {str(e)}", "original": input_requirements } def _filter_by_quality(self, normalized_list, quality_scores): """Filter results based on quality threshold""" filtered = [ ] for i, req in enumerate(normalized_list): scores = quality_scores[f"req_{i}"] # Calculate the comprehensive quality score total_score = sum(scores.values()) / len(scores) if total_score >= self.min_quality_threshold: filtered.append({ "requirement": req, "quality_score": total_score, "details": scores }) return filtered def _generate_summary(self, quality_scores): """Generate processing summary statistics""" total_reqs = len(quality_scores) passed_reqs = sum(1 for scores in quality_scores.values() if all(scores.values())) return { "total_requirements": total_reqs, "high_quality_count": passed_reqs, else "0%", "ears_compliance_rate": f"{sum(1 for s in quality_scores.values() if " } # Usage Examples if __name__ == "__main__": # Create a normalizer instance normalizer = ChineseRequirementsNormalizer() # Test Cases test_input = "The system must verify the password entered by the user while ensuring data security" # Perform normalization result = normalizer.normalize_requirements(test_input) # Output results print("===Requirement normalization processing result===") print(f"Original requirement: {result['original']}") print(f"Preprocessing result: {result['preprocessed']}") print(f"normalized result: {result['normalized']}") print(f"Quality score: {result['quality_scores']}") print(f"Processing summary: {result['processing_summary']}") The above embodiments of the present application implement end-to-end processing of the complete process from original requirements to standardized output; ensure output quality through multi-dimensional evaluation to achieve quality assurance; retain the processing results of each stage to facilitate debugging and optimization, and achieve traceability; achieve modular design through clear responsibilities of each component, easy maintenance and expansion; achieve error handling through graceful handling of abnormal situations; through the above design, automated, standardized, and high-quality processing of Chinese requirements is achieved, significantly improving the efficiency and quality of requirements engineering.
[0173] For example, a Chinese requirements normalization method based on a large language model and the EARS paradigm provided in this application is used to normalize Chinese requirements: Original requirement: "The system must be able to process user input data while ensuring data security and having sufficient performance." The first stage outputs text: 1. "The system must be able to process data entered by the user." 2. "The system must ensure data security." 3. "The system must have sufficient performance." The second stage outputs text: 1. "The system should handle various formats of data input by the user." 2. "The system should protect data security through encryption and access control mechanisms." 3. "The system should respond to user requests within 1 second." Quality evaluation results: 1. EARS paradigm - consistency: 100%; 2. Grammatical Correctness: 100%; 3. Semantic integrity: 100%.
[0174] 4. Testability: 100% The above-mentioned embodiment of the present application adopts a Chinese requirement normalization method based on a large language model and the EARS paradigm. Compared with the traditional manual requirement normalization method, the processing time is reduced from an average of 4 hours / 100 requirements to 30 minutes / 100 requirements, and the efficiency is improved by 87.5%; the rate of discovery of quality problems in requirements is increased from 65% of manual labor to 85%, and the rate of requirement changes in the subsequent development stage is reduced by 42%; the workload of requirement engineers is reduced by 80%, and the overall project cost is reduced by 15-20%; all output requirements strictly follow the unified EARS paradigm, eliminating the subjective differences in manual processing, and providing an efficient and accurate automated solution for requirement normalization in software engineering, which has important industrial application value and broad promotion prospects.
[0175] Figure 2 The figure is a structural diagram of a Chinese requirement normalization system based on a large language model and the EARS paradigm according to an exemplary embodiment.
[0176] Reference Figure 2 As shown, an embodiment of the present application is a Chinese requirement normalization system 100 based on a large language model and the EARS paradigm, comprising: a Chinese EARS paradigm template construction module 110, a first-stage requirement text processing module 120, a second-stage requirement text processing module 130, and a quality evaluation module 140.
[0177] A Chinese EARS paradigm template construction module 110 is used to convert the English EARS paradigm model into a Chinese EARS paradigm template according to the Chinese grammatical structure; The first-stage demand text processing module 120 is used to input the original demand text and the preset first-stage prompt words into the preset large language model to determine the first-stage output text; The second-stage demand text processing module 130 is used to input the first-stage output text and the preset second-stage prompt words into the preset large language model, perform structural conversion according to the Chinese EARS paradigm template, and determine the second-stage output text; The quality evaluation module 140 is used to evaluate the quality of the output text of the second stage according to the preset evaluation indicators, and determine the standardized requirement text that conforms to the Chinese EARS paradigm.
[0178] The above-mentioned embodiment of the present application adopts the Chinese EARS paradigm template for Chinese requirements to improve the accuracy of processing Chinese requirements, and combines it with the preset large language model. Through the powerful semantic understanding ability and phased processing strategy of the large language model, end-to-end automated processing is achieved, manual intervention is reduced, and the processing quality and efficiency of Chinese requirements are effectively improved, saving project costs.
[0179] Regarding the embodiment of the above system, the specific manner in which each module performs operations has been described in detail in the embodiment of the method, and will not be elaborated here.
[0180] Based on the same technical concept, in some specific embodiments of the present application, a terminal includes a memory, a processor, and a computer program stored in the memory and executable on the processor, and a method for executing when the processor executes the program.
[0181] Based on the same technical concept, in some specific embodiments of the present application, a computer-readable storage medium stores a computer program, which can be used to execute a method when executed by a processor.
[0182] Optionally, the memory is used to store programs. The memory may include volatile memory (volatile memory), such as random-access memory (RAM), such as static random-access memory (SRAM) and double data rate synchronous dynamic random access memory (DDR SDRAM). The memory may also include non-volatile memory (non-volatile memory), such as flash memory. The memory is used to store computer programs (such as applications and functional modules that implement the above-mentioned methods), computer instructions, etc. These computer programs and computer instructions may be partitioned and stored in one or more memories. Furthermore, these computer programs, computer instructions, data, etc. can be accessed by the processor.
[0183] The aforementioned computer programs, computer instructions, etc. may be partitioned and stored in one or more memories, and the aforementioned computer programs, computer instructions, data, etc. may be called by a processor.
[0184] The processor is configured to execute the computer program stored in the memory to implement the various steps of the method involved in the above embodiment. For details, please refer to the relevant description in the above method embodiment.
[0185] The processor and memory can be independent structures or integrated structures. When the processor and memory are independent structures, the memory and processor can be coupled via a bus.
[0186] Those skilled in the art will appreciate that the embodiments of the present application may be provided as methods, systems, or computer program products. Therefore, the present application may take the form of an entirely hardware embodiment, an entirely software embodiment, or an embodiment combining software and hardware. Furthermore, the present application may take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to magnetic disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.
[0187] The present application is described with reference to the flowcharts and / or block diagrams of the methods, devices (systems), and computer program products according to the embodiments of the present application. It should be understood that each process and / or block in the flowchart and / or block diagram, as well as the combination of processes and / or blocks in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to produce a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 a process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.
[0188] These computer program instructions may also be stored in a computer readable memory that can direct a computer or other programmable data processing device to work in a specific manner, so that the instructions stored in the computer readable memory produce an article of manufacture comprising an instruction device, which implements the process Figure 1 a process or multiple processes and / or boxes Figure 1 The function specified in one or more boxes.
[0189] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing the instructions executed on the computer or other programmable device for implementing the process. Figure 1 a process or multiple processes and / or boxes Figure 1 A step that specifies a function in one or more boxes.
[0190] The above describes some specific embodiments of the present application. It should be understood that the present application is not limited to the specific embodiments described above, and those skilled in the art may make various variations or modifications within the scope of the claims, which do not affect the substantive content of the present application. The above preferred features may be used in any combination as long as they do not conflict with each other.< / response> < / system>
Claims
1. A Chinese requirements normalization method based on a large language model and the EARS paradigm, characterized by: include: According to the Chinese grammatical structure, the English EARS paradigm model is converted into the Chinese EARS paradigm template; Input the original requirement text and the preset first-stage prompt words into the preset large language model to determine the first-stage output text; Inputting the first-stage output text and the preset second-stage prompt words into the preset large language model, performing structural conversion according to the Chinese EARS paradigm template, and determining the second-stage output text; According to the preset evaluation indicators, the quality of the output text of the second stage is evaluated to determine the standardized requirement text that conforms to the Chinese EARS paradigm.
2. The Chinese requirements normalization method based on a large language model and the EARS paradigm according to claim 1 is characterized in that: The English EARS paradigm patterns include Ubiquitous, Event-driven, State-driven, Optional and Complex; The Chinese EARS paradigm template includes: under the <precondition>, the <executing subject> should <perform action> with <target effect>; the <precondition> and the <target effect> represent optional elements, and the <executing subject> and the <perform action> represent mandatory elements.
3. The Chinese requirements normalization method based on a large language model and the EARS paradigm according to claim 1 is characterized in that: The method further comprises: According to the first-stage demand text processing task, a preset first-stage prompt word is constructed, wherein the preset first-stage prompt word is used to perform action uniqueness decomposition processing, symbol standardization processing, and pronoun disambiguation processing on the original demand text; According to the second-stage required text processing tasks, a preset second-stage prompt word is constructed, wherein the preset second-stage prompt word is used to perform grammatical structure conversion processing, semantic concretization processing, and terminology standardization processing on the output text of the first stage; A few-sample learning strategy is adopted to embed a preset number of standardized examples into the preset first-stage prompt words and the preset second-stage prompt words respectively.
4. The Chinese requirements normalization method based on a large language model and the EARS paradigm according to claim 1 is characterized in that: The step of inputting the original requirement text and the preset first-stage prompt words into the preset large language model to determine the first-stage output text includes: According to the preset first-stage prompt words, the original requirement text is subjected to action uniqueness decomposition processing to determine the atomic requirements of a single action; Performing symbol normalization processing on the atomic requirements of the single action to determine the atomic requirements that have undergone symbol normalization processing; Pronoun disambiguation is performed on the atomic requirements that have undergone symbol standardization to determine the output text of the first stage.
5. The Chinese requirements normalization method based on a large language model and the EARS paradigm according to claim 4 is characterized in that: The step of performing action uniqueness decomposition processing on the original requirement text according to the preset first-stage prompt words to determine the atomic requirement of a single action includes: Using a preset verb recognition algorithm to perform action verb detection on the original demand text to determine the action verbs in the original demand text; Performing parallel logical connectives detection on the original demand text to determine the parallel logical connectives in the original demand text; Perform action splitting on the original requirement text according to the action verbs and the parallel logical connectives to determine the atomic requirements of the single action; The performing symbol normalization processing on the atomic requirements of the single action to determine the atomic requirements after the symbol normalization processing includes: Remove the brackets from the atomic requirements of the single action; Replacing the symbol " / " in the atomic requirement of the single action with the Chinese expression "or", determining the atomic requirement after symbol standardization; The performing pronoun disambiguation processing on the atomic requirements that have undergone symbol normalization processing to determine the output text of the first stage includes: The pronouns in the atomic requirements that have undergone symbol standardization are replaced with entity names to determine the output text of the first stage.
6. The Chinese requirements normalization method based on a large language model and EARS paradigm according to claim 1 is characterized in that: The step of inputting the first-stage output text and the preset second-stage prompt words into the preset large language model, performing structural conversion according to the Chinese EARS paradigm template, and determining the second-stage output text includes: Converting the output text of the first stage into text corresponding to the Chinese ERAS paradigm template; Convert the passive voice in the text corresponding to the Chinese ERAS paradigm template into the active voice; Convert the vague expressions in the text corresponding to the Chinese ERAS paradigm template into specific expressions; Convert the unverifiable statements in the text corresponding to the Chinese ERAS paradigm template into testable statements; The non-primary <target effect> in the text corresponding to the Chinese ERAS paradigm template is removed to determine the output text of the second stage.
7. The Chinese requirements normalization method based on a large language model and EARS paradigm according to claim 1 is characterized in that: The preset evaluation indicators include EARS paradigm consistency index, grammatical correctness index, and semantic integrity index; The quality of the output text of the second stage is evaluated according to the preset evaluation indicators to determine the standardized requirement text that conforms to the Chinese EARS paradigm, including: Performing EARS paradigm consistency testing on the output text of the second stage using the EARS paradigm consistency index to determine the requirement text that has undergone the EARS paradigm consistency testing; Using the grammatical correctness index to perform grammatical correctness detection processing on the requirement text that has undergone the EARS paradigm consistency detection, and determining the requirement text that has undergone the grammatical correctness detection processing; The semantic integrity index is used to perform semantic integrity detection on the requirement text that has undergone grammatical correctness detection to determine the standardized requirement text that conforms to the Chinese EARS paradigm.
8. A Chinese requirements normalization system based on a large language model and the EARS paradigm, characterized by: include: Chinese EARS paradigm template construction module, used to convert English EARS paradigm patterns into Chinese EARS paradigm templates based on Chinese grammatical structure; The first-stage requirement text processing module is used to input the original requirement text and the preset first-stage prompt words into the preset large language model to determine the first-stage output text; The second-stage demand text processing module is used to input the first-stage output text and the preset second-stage prompt words into the preset large language model, perform structural conversion according to the Chinese EARS paradigm template, and determine the second-stage output text; The quality evaluation module is used to evaluate the quality of the output text of the second stage according to the preset evaluation indicators and determine the standardized requirement text that conforms to the Chinese EARS paradigm.
9. A non-transitory computer-readable storage medium having a computer program stored thereon, characterized in that: When the program is executed by a processor, the steps of the method according to any one of claims 1 to 7 are implemented.
10. An electronic device, characterized in that: include: a memory having a computer program stored thereon; A processor, configured to execute the computer program in the memory to implement the steps of the method according to any one of claims 1 to 7.
Citation Information
Patent Citations
Process and system for automatic generation of functional architecture documents and software design and analysis specification documents from natural language
CA3139543A1
Avionics field demand standardization method based on formal conversion rule
CN112099764A
Extension method based on semi-structured natural language EARS demand template
CN114692588A
Complex system demand integrity modeling and evaluation supporting method
CN119166868A
AADL model automatic generation method based on large language model
CN119272803A