Software requirement specification document automatic generation method based on large language model
Through the automatic generation method of software requirements standardized documents based on the BERT-GCN model and large language model, the problems of low generation efficiency and error prone in the existing technology are solved, and efficient and accurate software requirements document generation is achieved to adapt to the needs of multiple industries and complex scenarios.
Patent Information
- Application Number
- CN202510580895.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-05-06
- Publication Date
- 2025-08-22
AI Technical Summary
Existing methods generate software requirements specification documents inefficient and error-prone, making it difficult to adapt to rapidly changing market and technological environments.
Text preprocessing and classifier based on the BERT-GCN model are used to generate software requirements specification documents in combination with large language models, including text preprocessing, BERT-GCN model training, text multi-classification and large language models to generate standardized documents, and standardized generation is used using ISO/IEC/IEEE 29148 standard template and LangChain framework.
It improves the generation efficiency and accuracy of software requirements specification documents, reduces the possibility of human error, adapts to multiple industries and complex scenarios, meets industry standards, and reduces the time cost of traditional handwriting.
Smart Images

Figure CN120524932A_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the technical field of software engineering, and in particular relates to a method for automatically generating a software requirement specification document based on a large language model. Background Art
[0002] Requirements analysis plays a crucial role in the software development lifecycle. A software requirements specification (SRS) details user expectations for the target software system's functional requirements, performance metrics, behavioral characteristics, and other aspects. Requirements documents are not only the cornerstone of software design but also provide guidance and guidance throughout the development process. They enable development teams to gain a deep understanding of actual business needs, effectively reducing unnecessary development work and avoiding excessive time spent on erroneous requirements. Furthermore, requirements documents provide clear standards and a basis for final software testing and acceptance, ensuring that software deliverables meet user expectations and business needs.
[0003] With the rapid development of technologies like networking, big data, and artificial intelligence, the amount of information is exploding. Automatically generating software requirement specifications (SRS) is gradually replacing traditional manual methods and becoming an inevitable trend in the industry. Automatic document generation methods can efficiently process and analyze large amounts of data, quickly and accurately generating requirements documents. This not only improves work efficiency but also reduces the risk of human error. Furthermore, automatically generated SRSs can better adapt to the rapidly changing market and technological environment, providing more flexible and dynamic support for software development.
[0004] During the software requirements acquisition phase, clients often don't provide a concise, comprehensive, and clearly organized list of requirements. Requirements analysts must categorize the vast amount of requirements they receive, eliminating requirements irrelevant to software development, such as requirements for new employee training and project constraints. Software requirements analysts analyze the information provided by clients to obtain software-related business requirements, use cases or scenarios, business rules, functional requirements, quality attributes, external interface requirements, constraints, data definitions, and roles. Based on this information, they use a large language model to analyze and generate a complete and standardized software requirements document. Summary of the Invention
[0005] The purpose of the present invention is to provide a method and system for automatically generating software requirement specification documents based on a large language model, so as to solve the problem that existing methods for generating software requirement specification documents are inefficient and prone to errors.
[0006] To solve the above technical problems, the technical solution adopted by the present invention is a method for automatically generating a software requirement specification document based on a large language model, comprising the following steps:
[0007] S1: Text preprocessing: Label the sentences in the software requirement customer feedback data and divide the dataset into training and validation sets;
[0008] S2: Training the requirements classifier: Classify the text in the application dataset, design and train the BERT-GCN model, and summarize different categories of information into different dimensions related to software requirements;
[0009] S3: Text multi-classification task: Input the customer opinion data to be processed into the trained demand classifier to classify the demand text and output the classified labeled text;
[0010] S4: Generate standard requirement documents: Input the classified labeled text into the large language model, design the corresponding output prompt template, and guide the large language model to generate standardized software requirement specification documents.
[0011] Furthermore, the text preprocessing in step S1 includes:
[0012] S11: Segment customer feedback data by sentence, using regular expressions combined with Chinese punctuation to split long text into independent sentences;
[0013] S12: Use the simhash deduplication algorithm to remove semantically duplicated statements and retain unique content;
[0014] S13: Standardize and clean the text, including deleting irrelevant symbols, restoring abbreviations, and unifying the text format;
[0015] S14: Label the cleaned statements based on the preset requirement category label set.
[0016] Furthermore, the BERT-GCN model in step S2 includes: a BERT semantic feature extraction module, a multi-head self-attention mechanism, a two-layer graph convolutional network, and a final fully connected classification layer;
[0017] The construction of the BERT-GCN model includes: obtaining the contextual semantic representation of each text through the BERT model and outputting the token-level embedding representation; extracting the [CLS] vector as the global feature of the text and capturing the global semantic interaction through the multi-head self-attention mechanism; stretching the token embedding into the graph convolution input, propagating the semantic features of the nodes in the graph through a two-layer graph convolutional network structure, and enhancing the internal structural information of the text; splicing the attention feature with the first node output of the graph convolutional network and inputting it into the fully connected classification layer to generate the final classification probability distribution, and selecting the category with the largest probability value as the predicted category.
[0018] Furthermore, the semantic feature update function of the nodes of the graph convolutional network is:
[0019]
[0020] Among them H (l) Represents the node feature matrix of the lth layer, whose dimension is N*D l , where N is the number of nodes, D l is the characteristic dimension of the layer; H (l+1) Represents the output feature matrix of the l+1 layer, whose dimension is N*D l+1 ; It is a modified version of the adjacency matrix A, which adds self-connections to A and is expressed as I is a diagonal matrix; for The degree matrix of and yes The inverse operation of the square root of is used for normalization to ensure that the influence of node degree is balanced during information transmission; W (l) is the weight matrix of layer l, used to perform linear transformation, and its dimension is D l *D l+1 ; σ is a nonlinear activation function.
[0021] Furthermore, the training of the BERT-GCN model in step S2 includes: dividing the processed data into a training set, a validation set, and a test set, and using a data loader to input the model in batches for training: using cross entropy as the loss function and combining it with the Adam optimizer to update the parameters; after each training cycle, evaluating the model performance on the validation set, calculating the loss, Hamming Accuracy, and Micro F1 value to determine the model training status.
[0022] Furthermore, the step S4 includes:
[0023] Model interface initialization and environment configuration: By setting the environment variables OPENAI_API_KEY and DEEPSEEK_BASE_URL, complete the API communication interface initialization operation with the target large language model;
[0024] Standardized template construction: define software requirement specification templates that comply with ISO / IEC / IEEE 29148 standards;
[0025] Structured demand classification processing: Receive and input the structured natural language demand text provided by the user, call the local predefined text classification module, and perform semantic understanding and classification processing on the original demand text;
[0026] Prompt construction and model invocation: The structured requirement text that has been categorized and organized is formatted by category and used as part of the input prompt. The ChatPromptTemplate provided by the LangChain framework is used to construct system role and user role prompts, forming a conversation context format that conforms to the input specifications of the large language model.
[0027] Large language model response generation: Based on the constructed input prompts and standardized templates, the specified large language model is called to generate the software requirements specification content that meets the standards and output the results in Markdown format;
[0028] Document generation quality assessment: By introducing a preset document assessment module, the quality of the SRS document content generated by the model is scored and graded. The assessment dimensions include software requirement dimension assessment and document scope assessment; based on the assessment score results, the optimal generation result is selected.
[0029] The beneficial effects of the present invention are:
[0030] 1. Based on the BERT-GCN model and combining semantic and graph structure features, this invention can accurately identify and classify demand information in natural language, thereby improving the efficiency and accuracy of demand processing. The document format generated by the large language model guided by the structured prompt template is standardized and clearly structured, meeting industry standards.
[0031] 2. This invention supports extracting demand information from multiple sources (such as customer communication meeting records, interview minutes, etc.), which can comprehensively cover user needs, enhance the practicality of documents, and adapt to complex scenarios; by generating filled SRS documents through a large language model, it significantly reduces the time cost of traditional manual document writing and reduces the possibility of human error.
[0032] 3. The present invention is not only suitable for the generation of software requirement documents in multiple industries and scenarios, but can also be flexibly expanded to more complex requirement management tasks; it comprehensively integrates deep learning technology, template optimization and large language model capabilities, providing an efficient, intelligent and standardized solution, solving the problem of low efficiency and error-proneness in generating software requirement specification documents using existing methods. BRIEF DESCRIPTION OF THE DRAWINGS
[0033] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the following briefly introduces the drawings required for use in the embodiments or the description of the prior art. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative work.
[0034] Figure 1It is a schematic flow chart of the method of the present invention.
[0035] Figure 2 It is a structural schematic diagram of the present invention. DETAILED DESCRIPTION
[0036] The following will clearly and completely describe the technical solutions in the embodiments of the present invention in conjunction with the accompanying drawings. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without making creative efforts are within the scope of protection of the present invention.
[0037] like Figure 1-2 As shown in the figure, a method for automatically generating a software requirement specification document based on a large language model is provided in an embodiment, comprising the following steps:
[0038] S1: Text preprocessing: Label the sentences in the software requirement customer feedback data and divide the dataset into training and validation sets;
[0039] Text preprocessing includes:
[0040] S11: Segment customer feedback data by sentence, using regular expressions combined with Chinese punctuation to split long text into independent sentences;
[0041] S12: Use the simhash deduplication algorithm to remove semantically duplicated statements and retain unique content;
[0042] S13: Standardize and clean the text, including deleting irrelevant symbols, restoring abbreviations, and unifying the text format;
[0043] S14: Label the cleaned statements based on the preset requirement category label set;
[0044] The categories of classification include:
[0045] (a) Business requirements: Focus on the business value that the product is expected to achieve, such as financial returns and market share, and describe the core expectations of customers and the development organization for the product;
[0046] (b) Use cases and scenarios: Use cases provide an overall description of user goals or business tasks, while scenarios break down the details into specific operation paths, presenting how users interact in different situations.
[0047] (c) Business rules: define the operations that can be performed under specific conditions and clarify the user's behavior norms in specific scenarios;
[0048] (d) Functional requirements: describe the observable behavior of the system under specific conditions and the operations that users can perform, clarifying the functional performance of the system;
[0049] (e) Quality attributes: focus on the performance and performance standards of the system when performing a certain behavior or operation, such as response time, reliability, etc.
[0050] (f) External interface requirements: describe in detail the interaction between the system and the external environment, including input and output, data transmission, etc.
[0051] (g) Constraints: restrictions imposed on the design and implementation, which dictate the scope and choices available to developers in their solutions;
[0052] (h) Data definition: covers the detailed specifications of data items, including format, data type, allowed values, default values, etc., and describes the details of complex business data structures;
[0053] (i) Roles: define the responsibilities of different users or participants and clarify the permissions and functions of each type of user in the system;
[0054] (j) Content not related to requirements: including new employee training and project constraints;
[0055] This classification method helps to systematically understand and meet user needs, ensures that every aspect is fully considered, and provides a solid foundation for generating standardized requirements documents.
[0056] S2: Training the requirements classifier: Classify the text in the application dataset, design and train the BERT-GCN model, and summarize different categories of information into different dimensions related to software requirements;
[0057] The construction of the BERT-GCN model includes:
[0058] Data preprocessing and label encoding: Clean the original dataset and standardize its labels. Use text sentences as input features and perform label encoding on their classification results to form labeled data that can be used for supervised training. Use LabelEncoder to numerically encode the classification results to complete the structured processing.
[0059] Text segmentation and embedding encoding: Use the tokenizer in the pre-trained BERT model to segment and encode text data, converting text sentences into fixed-length token sequences as input for the subsequent BERT model.
[0060] The BERT model extracts the [CLS] tag features of the text input as a representation of global semantics. The BERT model consists of an input layer, an embedding layer, a bidirectional Transformer encoder, and an output layer. The input layer processes the sentence into a sequence X. seq ={X1,...X n}, input it into the embedding layer to obtain the text embedding vector E={E1,...E n}, the encoder then encodes the contextual semantics of the sentence and finally outputs the text semantic features H = {h1,...h n};
[0061] Among them, n is the number of participles, l c is the output dimension of the last layer of BERT; X i represents the original input representation of the i-th word; E i Represents the embedding vector of the i-th word (including word, position, and segmentation information); H i Represents the contextual semantic representation of the i-th word, which is the output vector after passing through the multi-layer Transformer encoder; R represents a set of real numbers, indicating that all elements in the matrix or vector are real numbers;
[0062] Constructing the internal graph structure of the text: For each input text, a graph structure is constructed within the local window, with the token as the node of the graph structure. Based on the set fixed sliding window size (the window size is 2), edges with a relative distance not exceeding the window size are constructed between the tokens, thereby forming a preliminary edge set (Edge Index) to capture the semantic connection between local contexts. In order to further enhance the representation ability of the node itself, self-loop connections are introduced, that is, an edge is added to each node itself, so that the node can retain its own feature information when propagating in the graph neural network. The final internal graph structure of the text can be represented as a local semantic graph, whose nodes are token embedding vectors and the edges characterize the adjacency relationship between tokens. This graph structure is used as the input of the graph convolutional network (GCN) to realize the structured modeling of text features;
[0063] The graph convolutional network uses the GCN algorithm, which updates node feature representations through two layers of GCN and improves classification accuracy by leveraging semantic relevance between contexts. The idea behind GCN is to update a node by aggregating features from surrounding nodes. The GCN part uses a two-layer graph convolutional network to perform structural enhancement on token embeddings by aggregating node adjacency features. The first layer of GCN performs structural propagation on the initial BERT output, aggregating semantic information from neighboring nodes within the window. The second layer of GCN further optimizes and updates the first layer output, simplifying the node feature update function to:
[0064]
[0065] Among them H (l) Represents the node feature matrix of the lth layer, whose dimension is usually N*D l , where N is the number of nodes, D l is the characteristic dimension of the layer; H (l+1) Represents the output feature matrix of the l+1 layer, whose dimension is usually N*D l+1 ; It is a modified version of the adjacency matrix A, in which self-connections are usually added (i.e., a diagonal matrix I, so that each node is connected to itself), expressed as for The degree matrix of and yes The inverse operation of the square root of is used for normalization to ensure that the influence of node degree is balanced during information transmission; W (l) is the weight matrix of layer l, used to perform linear transformation, and its dimension is D l *D l+1 ;σ is a nonlinear activation function;
[0066] The overall structure of the model includes a BERT semantic feature extraction module, a multi-head self-attention mechanism, a two-layer graph convolutional network (GCN), and a final fully connected classification layer. Specifically, it involves: obtaining the contextual semantic representation of each text through the BERT model and outputting a token-level embedding representation; extracting the [CLS] vector as the global feature of the text and capturing global semantic interactions through a multi-head self-attention mechanism; stretching the token embedding into the graph convolution input, propagating the semantic features of the nodes in the graph through a two-layer GCN structure, and enhancing the internal structural information of the text; concatenating the attention feature with the first node of the GCN output (the node corresponding to [CLS]) and inputting it into the fully connected layer to generate the final classification probability distribution, and selecting the category with the largest probability value as the predicted category;
[0067] BERT-GCN model training involves dividing the processed data into training, validation, and test sets, and using the data loader to feed the model batches for training. The model uses cross entropy as the loss function and the Adam optimizer for parameter updates. After each training cycle, the model performance is evaluated on the validation set, calculating the loss, Hamming Accuracy, and Micro F1 score to determine the model training status.
[0068] S3: Text multi-classification task: Input the customer opinion data to be processed into the trained demand classifier to classify the demand text, and output the classified labeled text.
[0069] S4: Generate standard requirements documents: Input the classified labeled text into the large language model, design the corresponding output prompt template, and guide the large language model to generate standardized software requirements specification documents;
[0070] Generating standard requirement documents includes:
[0071] Model interface initialization and environment configuration: First, by setting the environment variables OPENAI_API_KEY and DEEPSEEK_BASE_URL, complete the API communication interface initialization operation with the target large language model (DeepSeek, GPT-3). The setting of these environment parameters ensures the authentication, security and interface accessibility during the model call process, providing a basic guarantee for the subsequent generation process;
[0072] Standardized template construction: Secondly, a software requirements specification template that complies with the ISO / IEC / IEEE 29148 standard is defined. The template includes but is not limited to the following chapter structure: introduction, general description, functional requirements, non-functional requirements, external interface requirements, appendix, etc. This standardized template is used to standardize the document structure of the model output to ensure the consistency and readability of the generated results;
[0073] Structured requirements classification: The system then receives and inputs the structured natural language requirements text provided by the user. It then calls a predefined local text classification module to perform semantic understanding and classification on the original requirements text, categorizing the statements into: business requirements, use cases and scenarios, business rules, functional requirements, quality attributes, external interface requirements, constraints, data definitions, roles, and content unrelated to requirements, thereby improving the logical coherence and semantic accuracy of the subsequently generated text.
[0074] Prompt construction and model invocation: Format the structured requirement text by category and use it as part of the input prompt. Use the ChatPromptTemplate provided by the LangChain framework to construct system role and user role prompts, forming a conversation context format that conforms to the input specifications of the large language model.
[0075] Large language model response generation: Based on the constructed input prompts and standardized templates, the specified large language model (DeepSeek, GPT-3) is called to generate the software requirements specification content that meets the standards and output the results in Markdown format;
[0076] Document Generation Quality Assessment: Finally, we use a pre-defined document assessment module to assess the quality of the SRS document content generated by the model. This assessment covers software requirements and document scope. Based on the assessment scores, we select the optimal generated document.
[0077] S5: Quality Assessment and Verification: Perform a quality assessment on the generated software requirements specification document, and output the assessment results from two dimensions: requirements scope and document scope. The assessment dimensions for requirements scope include clarity, completeness, and verifiability; the assessment dimensions for document scope include clarity, completeness, and conciseness. Document quality assessment includes both expert scoring and automatic scoring.
[0078] The expert scoring module anonymizes the generated requirement documents to ensure the objectivity and fairness of the review process. Subsequently, the document is scored by an independent review module based on the preset quality assessment parameters. The scoring adopts the Likert five-point method, and the experts give a quantitative evaluation of 1 to 5 points for each indicator. The system digitizes the scoring results of each expert on each evaluation item and calculates the average value of all experts on the same indicator as the final score of this dimension. The quality assessment parameters cover two dimensions: "requirement scope assessment" and "document performance assessment". The final scoring results are output in a graded quantitative form to comprehensively reflect the quality level of the document;
[0079] Document dimension scoring includes: catalog item matching: extract and save catalog items from the software requirement specification, and use the dictionary matching method to match them with the pre-stored standard catalog. For each successfully matched catalog item, the weight corresponding to the standard catalog item is accumulated to calculate the structural integrity of the document; imperative sentence detection: use the dictionary matching algorithm to search for pre-stored imperative words. If an imperative word is found, the sentence in which it is located is determined to be an imperative sentence. Further calculate the ratio of the number of imperative sentences to the total number of sentences in the document to obtain the conciseness of the document; ambiguous sentence detection: also use the dictionary matching algorithm to search for pre-stored ambiguous words and identify ambiguous sentences in the document. Count the number of ambiguous sentences and assess the clarity score of the document based on the preset clarity level;
[0080] The requirement dimension scoring includes: Based on the combination of the pre-trained BERT language model and the CNN classifier, the document is classified sentence by sentence to identify "ambiguous requirements", "incomplete requirements" or "unverifiable requirements". For each defective requirement identified, a score is assigned with a weight of 5;
[0081] Finally, the document dimension score and the requirement dimension score are added together to obtain the overall quality score of the software requirement specification.
[0082] As an example, a software requirements specification is a document that contains the specifications of a piece of software. It covers the following aspects, as shown below:
[0083] - Background of the problem
[0084] -Stakeholders / Users
[0085] -Functional requirements
[0086] -Performance requirements
[0087] -Design constraints
[0088] -External interface
[0089] -Security requirements
[0090] -Application use cases
[0091] - Glossary
[0092] As an example,
[0093] Input: The classification result is "Functional Requirements" and the statement is "The system needs to support multiple users logging in simultaneously."
[0094] As an embodiment, the evaluation method for generating the specification document in step S4 includes:
[0095] In order to conduct a fair and accurate evaluation of the SRS document, we anonymized the generated requirements document and invited six independent reviewers who were not involved in the generation process to score it. These scoring experts all have at least three years of development experience and are familiar with the best practices in software development. They evaluated the requirements and overall scope of the document. The scoring adopts the Likert five-point scale. First, the document specifications are divided into the requirements scope (clarity, comprehensibility, correctness, verifiability) and document scope (consistency, non-redundancy, completeness, conciseness) according to the indicators. The experts evaluate according to the corresponding indicators and finally score according to the evaluation of each indicator.
[0096] Each embodiment in this specification is described in a related manner. Similar parts between the various embodiments can be referred to in conjunction with each other. Each embodiment focuses on the differences between the other embodiments. In particular, the system embodiment is generally similar to the method embodiment, so the description is relatively simple. For related parts, refer to the description of the method embodiment.
[0097] The above description is only a preferred embodiment of the present invention and is not intended to limit the scope of protection of the present invention. Any modifications, equivalent replacements, improvements, etc. made within the spirit and principles of the present invention are included in the scope of protection of the present invention.
Claims
1. A method for automatically generating software requirement specification documents based on a large language model, characterized in that: The following steps are involved: S1: Text preprocessing: Label the sentences in the software requirement customer feedback data and divide the dataset into training and validation sets; S2: Training the requirements classifier: Classify the text in the application dataset, design and train the BERT-GCN model, and summarize different categories of information into different dimensions related to software requirements; S3: Text multi-classification task: Input the customer opinion data to be processed into the trained demand classifier to classify the demand text and output the classified labeled text; S4: Generate standard requirement documents: Input the classified labeled text into the large language model, design the corresponding output prompt template, and guide the large language model to generate standardized software requirement specification documents.
2. The method for automatically generating software requirement specification documents based on a large language model according to claim 1, characterized in that: The text preprocessing of step S1 includes: S11: Segment customer feedback data by sentence, using regular expressions combined with Chinese punctuation to split long text into independent sentences; S12: Use the simhash deduplication algorithm to remove semantically duplicated statements and retain unique content; S13: Standardize and clean the text, including deleting irrelevant symbols, restoring abbreviations, and unifying the text format; S14: Label the cleaned statements based on the preset requirement category label set.
3. The method for automatically generating software requirement specification documents based on a large language model according to claim 1, characterized in that: The BERT-GCN model in step S2 includes: a BERT semantic feature extraction module, a multi-head self-attention mechanism, a two-layer graph convolutional network, and a final fully connected classification layer; The construction of the BERT-GCN model includes: obtaining the contextual semantic representation of each text through the BERT model and outputting the token-level embedding representation; extracting the [CLS] vector as the global feature of the text and capturing the global semantic interaction through the multi-head self-attention mechanism; stretching the token embedding into the graph convolution input, propagating the semantic features of the nodes in the graph through a two-layer graph convolutional network structure, and enhancing the internal structural information of the text; splicing the attention feature with the first node output of the graph convolutional network and inputting it into the fully connected classification layer to generate the final classification probability distribution, and selecting the category with the largest probability value as the predicted category.
4. The BERT-GCN model structure according to claim 3, characterized in that The semantic feature update function of the nodes of the graph convolutional network is: Among them H (l) Represents the node feature matrix of the lth layer, whose dimension is N*D l , where N is the number of nodes, D l is the characteristic dimension of the layer; H (l+1) Represents the output feature matrix of the l+1 layer, whose dimension is N*D l+1 ; It is a modified version of the adjacency matrix A, which adds self-connections to A and is expressed as I is a diagonal matrix; for The degree matrix of and yes The inverse operation of the square root of is used for normalization to ensure that the influence of node degree is balanced during information transmission; W (l) is the weight matrix of layer l, used to perform linear transformation, and its dimension is D l *D l+1 ; σ is a nonlinear activation function.
5. The method for automatically generating software requirement specification documents based on a large language model according to claim 1, characterized in that: The training of the BERT-GCN model in step S2 includes: dividing the processed data into a training set, a validation set, and a test set, and using a data loader to input the model in batches for training; using cross entropy as the loss function and combining it with the Adam optimizer to update the parameters; after each training cycle, evaluating the model performance on the validation set, calculating the loss, Hamming Accuracy, and Micro F1 value to determine the model training status.
6. The method for automatically generating software requirement specification documents based on a large language model according to claim 1, characterized in that: The step S4 comprises: Model interface initialization and environment configuration: By setting the environment variables OPENAI_API_KEY and DEEPSEEK_BASE_URL, complete the API communication interface initialization operation with the target large language model; Standardized template construction: define software requirement specification templates that comply with ISO / IEC / IEEE 29148 standards; Structured demand classification processing: Receive and input the structured natural language demand text provided by the user, call the local predefined text classification module, and perform semantic understanding and classification processing on the original demand text; Prompt construction and model invocation: The structured requirement text that has been categorized and organized is formatted by category and used as part of the input prompt. The ChatPromptTemplate provided by the LangChain framework is used to construct system role and user role prompts, forming a conversation context format that conforms to the input specifications of the large language model. Large language model response generation: Based on the constructed input prompts and standardized templates, the specified large language model is called to generate the software requirements specification content that meets the standards and output the results in Markdown format; Document generation quality assessment: By introducing a preset document assessment module, the SRS document content generated by the model is scored and graded. The assessment dimensions include software requirement dimension assessment and document scope assessment. Based on the assessment score results, the optimal generation result is selected.
Citation Information
Cited By
Software demand case normativity inspection method, tool and computer program product
CN121833519A
Software requirement use case specification checking method, tool and computer program product
CN121833519B
Large language model driven report generation agent method, system, equipment and medium
CN121859853A