Method and device for identifying rationality of generated content, storage medium and electronic device

By generating business models and business code through language models and using parameters from the previous round to correct the feature vectors of the current round, the problem of poor consistency of generated content is solved, and the accuracy of rationality judgment is improved.

CN118709014BActive Publication Date: 2026-06-16NEUSOFT CORP

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
NEUSOFT CORP
Filing Date
2024-06-26
Publication Date
2026-06-16

AI Technical Summary

Technical Problem

In existing technologies, the business model generated by language models has poor consistency with the business code, resulting in unreasonable business models and business code.

Method used

The system generates business models and business code using a language model, extracts features from each, and uses the parameters from the previous round to correct the feature vectors of the current round. Based on the corrected vectors, it calculates parameters and judges the rationality of the business models and business code.

🎯Benefits of technology

It improves the accuracy of consistency judgment between the generated business model and business code, ensuring the rationality of the generated content.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118709014B_ABST
    Figure CN118709014B_ABST
Patent Text Reader

Abstract

The present disclosure relates to a method and device for identifying the rationality of generated content, a storage medium and an electronic device, and belongs to the technical field of artificial intelligence. The method comprises: processing business description data through a language model to obtain a business model and a business code of a current round, extracting features of the business model and the business code to obtain a first feature vector of the current round and a second feature vector of the current round, correcting the first feature vector of the current round based on a first parameter obtained in a previous round to obtain a first correction vector, and correcting the second feature vector of the current round based on a second parameter obtained in the previous round to obtain a second correction vector, obtaining the first parameter and the second parameter based on the business description data, the first correction vector and the second correction vector, and determining the rationality of the business model and the business code of the current round based on the first parameter and the second parameter. The method can replace manual judgment to determine the rationality of the generated business model and business code.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This disclosure relates to the field of artificial intelligence technology, and more specifically, to a method, apparatus, storage medium, and electronic device for identifying the reasonableness of generated content. Background Technology

[0002] In the field of computer technology, ensuring consistency between the generated business model and the business code is of great significance. Related technologies can use language models to automatically generate business models and business code based on business description data. However, the consistency between the business model and business code generated by language models is often poor, leading to unreasonable results. Summary of the Invention

[0003] The purpose of this disclosure is to provide a method, apparatus, storage medium, and electronic device for identifying the reasonableness of generated content, so as to at least partially solve the above-mentioned technical problems.

[0004] To achieve the above objectives, firstly, this disclosure provides a method for identifying the reasonableness of generated content, including:

[0005] For any round of generation, the business description data is processed by a language model to generate a business model for the current round, and the business description data is processed by a language model to generate business code for the current round.

[0006] Feature extraction is performed on the current round's business model and the current round's business code to obtain a first feature vector corresponding to the current round's business model and a second feature vector corresponding to the current round's business code;

[0007] The first feature vector of the current round is corrected based on the first parameter obtained in the previous round to obtain the first corrected vector of the current round, and the second feature vector of the current round is corrected based on the second parameter obtained in the previous round to obtain the second corrected vector of the current round. The first parameter represents the consistency between the content in the business model and the content in the business code, and the second parameter represents the consistency between the content in the business code and the content in the business model.

[0008] Based on the business description data, the first correction vector of the current round, and the second correction vector of the current round, the first parameter and the second parameter of the current round are obtained;

[0009] Based on the first and second parameters of the current round, the rationality of the business model and business code of the current round is determined.

[0010] Optionally, the business model includes multiple business word segments, and the method further includes:

[0011] Search the preset knowledge graph for the business knowledge corresponding to each of the business word segments;

[0012] Based on the order of each business segment in the business description data, the business knowledge corresponding to each business segment is concatenated to obtain the first concatenation result;

[0013] The first feature vector corresponding to the business model of the current round is obtained through the following steps:

[0014] Feature extraction is performed on the first splicing result to obtain the first feature vector.

[0015] Optionally, the step of extracting features from the current round's business model and the current round's business code to obtain a first feature vector corresponding to the current round's business model and a second feature vector corresponding to the current round's business code includes:

[0016] Feature extraction is performed on the target sequence data to obtain the first intermediate feature vector corresponding to each time step. Each time step corresponds to a sequence position in the target sequence data. The target sequence data is sequence data obtained based on the business model of the current round or sequence data obtained based on the business code of the current round.

[0017] For any two adjacent time steps, based on the first intermediate feature vector corresponding to the previous time step and the first intermediate feature vector corresponding to the adjacent next time step, the first intermediate feature vector corresponding to the adjacent next time step is reconstructed to obtain a reconstructed vector sequence, which includes the reconstructed vectors corresponding to each time step.

[0018] Based on the hierarchical information between each reconstruction vector in the reconstruction vector sequence, feature extraction is performed on the reconstruction vector sequence to obtain the second intermediate feature vector corresponding to each time step;

[0019] Wherein, when the target sequence data is the business model of the current round, the second intermediate feature vectors corresponding to each time step constitute the first feature vector; and when the target sequence data is the business code of the current round, the second intermediate feature vectors corresponding to each time step constitute the second feature vector.

[0020] Optionally, the step of extracting features from the target sequence data to obtain the first intermediate feature vector corresponding to each time step includes:

[0021] The target sequence data is extracted using a first long short-term memory neural network in a forward order to obtain the first sub-feature vector corresponding to each time step.

[0022] The target sequence data is extracted using a second long short-term memory neural network in reverse order to obtain the second sub-feature vector corresponding to each time step;

[0023] Based on the first sub-feature vector corresponding to each time step and the second sub-feature vector corresponding to each time step, the first intermediate feature vector corresponding to each time step is obtained by concatenation.

[0024] Optionally, for any two adjacent time steps, based on the first intermediate feature vector corresponding to the previous time step and the first intermediate feature vector corresponding to the adjacent next time step, the first intermediate feature vector corresponding to the next next time step is reconstructed to obtain a reconstructed vector sequence, including:

[0025] The state transition vector is obtained by processing the first intermediate feature vector corresponding to the previous time step and the first intermediate feature vector corresponding to the adjacent next time step based on the preset state transition function.

[0026] Based on the temporary variable corresponding to the previous time step and the state transition vector, the temporary variable corresponding to the adjacent next time step is obtained.

[0027] The temporary variables corresponding to the next adjacent time step are normalized, and the normalization result is determined as the reconstruction vector corresponding to the next adjacent time step.

[0028] Based on the reconstruction vectors corresponding to each time step, the reconstruction vector sequence is obtained;

[0029] In this sequence, the temporary variable corresponding to the first time step is equal to the feature vector corresponding to the first time step.

[0030] Optionally, the step of extracting features from the reconstructed vector sequence based on the hierarchical information between the reconstructed vectors in the reconstructed vector sequence to obtain the second intermediate feature vector corresponding to each time step includes:

[0031] The reconstructed vector sequence is input into a third long short-term memory neural network to perform the following steps:

[0032] For any two adjacent time steps, based on the feature vector output from the previous time step and the reconstruction vector corresponding to the adjacent subsequent time step, the calculation results of the first input gate, the calculation results of the first forget gate, the calculation results of the output gate, and the candidate state information of the adjacent subsequent time step are obtained respectively.

[0033] Based on the calculation result of the second input gate in the previous time step, the feature vector output in the previous time step, and the reconstruction vector corresponding to the next adjacent time step, the calculation result of the second input gate in the next adjacent time step is obtained.

[0034] Based on the calculation result of the second forget gate in the previous time step, the feature vector output in the previous time step, and the reconstruction vector corresponding to the adjacent subsequent time step, the calculation result of the second forget gate in the adjacent subsequent time step is obtained.

[0035] Based on the calculation results of the second input gate in the adjacent next time step and the calculation results of the second forget gate in the adjacent next time step, the intermediate parameters of the adjacent next time step are obtained.

[0036] The cell state of the next adjacent time step is obtained based on the intermediate parameters of the next adjacent time step, the calculation result of the first forget gate of the next adjacent time step, the cell state of the previous time step, the calculation result of the first input gate of the next adjacent time step, the candidate state information corresponding to the next adjacent time step, the calculation result of the second forget gate of the next adjacent time step, and the calculation result of the second input gate of the next adjacent time step.

[0037] Based on the cell state of the adjacent next time step and the calculation results of the output gate of the adjacent next time step, the second intermediate feature vector corresponding to the next time step is obtained.

[0038] Optionally, obtaining the first and second parameters of the current round based on the business description data, the first correction vector of the current round, and the second correction vector of the current round includes:

[0039] Based on the business description data using the language model, count the first number of business entity vectors that have a reasonable correspondence between the first correction vector of the current round and the second correction vector of the current round;

[0040] Based on the business description data using the language model, count the second number of business entity vectors that have a reasonable correspondence with the first correction vector in the current round in the current round;

[0041] The first parameter of the current round is obtained based on the ratio of the first quantity to the number of vectors included in the first feature vector;

[0042] The second parameter of the current round is obtained based on the ratio of the second quantity to the number of vectors included in the second feature vector.

[0043] Optionally, the step of extracting features from the current round's business model and the current round's business code to obtain a first feature vector corresponding to the current round's business model and a second feature vector corresponding to the current round's business code includes:

[0044] The first feature vector of the current round is obtained by extracting features from the business model of the current round using the first neural network model;

[0045] The second feature vector of the current round is obtained by extracting features from the business code of the current round using a second neural network model.

[0046] The first neural network model and the second neural network model are respectively used as a generative network and an adversarial network, and are trained by generative adversarial methods with the optimization objective of maximizing the first parameter and the second parameter.

[0047] Secondly, embodiments of this disclosure provide an apparatus for identifying the reasonableness of generated content, comprising:

[0048] The generation module is used to perform business model generation processing on the business description data through a language model for any given generation process, to obtain the business model for the current round, and to perform business code generation processing on the business description data through a language model, to obtain the business code for the current round.

[0049] The feature extraction module is used to extract features from the current round's business model and the current round's business code respectively, to obtain a first feature vector corresponding to the current round's business model and a second feature vector corresponding to the current round's business code;

[0050] The feature correction module is used to correct the first feature vector of the current round based on the first parameter obtained in the previous round to obtain the first corrected vector of the current round, and to correct the second feature vector of the current round based on the second parameter obtained in the previous round to obtain the second corrected vector of the current round. The first parameter represents the consistency between the content in the business model and the content in the business code, and the second parameter represents the consistency between the content in the business code and the content in the business model.

[0051] The parameter determination module is used to obtain the first parameter and the second parameter of the current round based on the business description data, the first correction vector of the current round, and the second correction vector of the current round;

[0052] The judgment module is used to determine the rationality of the business model and business code of the current round based on the first parameter and the second parameter of the current round.

[0053] Thirdly, embodiments of this disclosure provide a computer-readable storage medium having a computer program stored thereon that, when executed by a processor, implements the steps of the method described in any of the first aspects.

[0054] Fourthly, embodiments of this disclosure provide an electronic device, including:

[0055] A memory on which computer programs are stored;

[0056] A processor for executing the computer program in the memory to implement the steps of the method of any one of the first aspects.

[0057] Through the above technical solution, for any round of generation process, the business description data is processed by a language model to generate a business model for the current round, and the business code is generated by the language model to generate business code for the current round. Features are extracted from the business model and the business code for the current round to obtain a first feature vector corresponding to the business model and a second feature vector corresponding to the business code for the current round. The first feature vector of the current round is corrected based on the first parameters obtained in the previous round to obtain a first corrected vector for the current round, and the second feature vector of the current round is corrected based on the second parameters obtained in the previous round to obtain a second corrected vector for the current round. Based on the business description data, the first corrected vector, and the second corrected vector of the current round, the first and second parameters of the current round are obtained. Based on the first and second parameters of the current round, the rationality of the business model and business code for the current round is determined.

[0058] As can be seen, the embodiments of this disclosure propose a process to replace manual judgment of the rationality of the generated business model and business code. Furthermore, in any round of generation, the first feature vector and the second feature vector extracted in the current round are corrected by the first parameter and the second parameter obtained in the previous round, and the first parameter and the second parameter of the current round are calculated by the corrected vector. This allows the language model to understand the direction in which the content in the generated business model is consistent with the content in the generated business code, thereby improving the accuracy of subsequent rationality judgments.

[0059] Other features and advantages of this disclosure will be described in detail in the following detailed description section. Attached Figure Description

[0060] The accompanying drawings are provided to further illustrate the present disclosure and form part of the specification. They are used together with the following detailed description to explain the present disclosure, but do not constitute a limitation thereof. In the drawings:

[0061] Figure 1This is a schematic diagram illustrating an application environment as shown in an exemplary embodiment of this disclosure.

[0062] Figure 2 This is a flowchart illustrating an exemplary embodiment of the present disclosure of a method for identifying the reasonableness of generated content.

[0063] Figure 3 This is a flowchart illustrating another method for identifying the reasonableness of generated content, as shown in an exemplary embodiment of this disclosure.

[0064] Figure 4 This is a flowchart illustrating an exemplary embodiment of the present disclosure of an apparatus for identifying the reasonableness of generated content.

[0065] Figure 5 This is a block diagram of an electronic device shown in an exemplary embodiment of the present disclosure. Detailed Implementation

[0066] The specific embodiments of this disclosure will be described in detail below with reference to the accompanying drawings. It should be understood that the specific embodiments described herein are for illustration and explanation only and are not intended to limit this disclosure.

[0067] Please see Figure 1 , Figure 1 This diagram illustrates an application environment for a method for identifying the reasonableness of generated content according to an embodiment of this application. As one implementation, the various steps included in the method for identifying the reasonableness of generated content provided in this embodiment can be applied to the same electronic device. This electronic device can be, for example,... Figure 1 The server 110 shown can be connected to the terminal device 120 via a network. The network serves as a medium for providing a communication link between the server 110 and the terminal device 120. The network can include various connection types, such as wired communication links, wireless communication links, etc., and this embodiment does not limit this.

[0068] It should be understood that Figure 1 The server 110, network, and terminal device 120 shown are merely illustrative. Depending on the implementation requirements, any number of servers, networks, and terminal devices can be included. For example, server 110 can be a physical server or a server cluster consisting of multiple servers, and terminal device 120 can be a mobile phone, tablet, desktop computer, laptop computer, etc. It is understood that embodiments of this application can also allow multiple terminal devices 120 to access server 110 simultaneously.

[0069] As another implementation, the steps included in the method for identifying the reasonableness of generated content provided in this application can be applied to different electronic devices. This application does not limit the electronic devices to which the method for identifying the reasonableness of generated content is applied.

[0070] Figure 2 This is a flowchart illustrating a method for identifying the reasonableness of generated content according to an exemplary embodiment of this disclosure. (Refer to...) Figure 2 The method for identifying the reasonableness of generated content includes the following steps:

[0071] S210: For any round of generation process, the business description data is processed by the language model to generate the business model for the current round, and the business code is generated by the language model to generate the business code for the current round.

[0072] The business description data, also known as business requirement data, describes the functions and objectives to be achieved by the project. In this embodiment, by inputting the business description data into a language model and configuring execution rules for the language model, the function of generating the business model and business code corresponding to the business description data can be realized through the language model.

[0073] The business model can include multiple business-specific word segments, which are obtained by segmenting business description data. The business code can include multiple business entity code objects.

[0074] For example, an execution rule for business code generation processing can be configured as follows: "Generate business entity code objects based on business description data. Each business entity code object should have a name that meets business requirements. The characteristics, properties, or descriptions of each business entity are attributes, and the attributes of an entity must be nouns. The business behaviors that each business entity can perform are described as operations. The operation object can be other business entities or the business entity itself, such as purchasing (operating) medicine (entity) or updating (operating) itself (entity)."

[0075] It is understandable that the content generated by the language model has a random element. Therefore, the business model and business code generated by the language model based on the business description data also have randomness, which makes it impossible to guarantee the consistency of the generated business model and business code. When the consistency of the generated business model and business code is poor, it can be regenerated using the language model until the requirements are met.

[0076] In related technologies, it is necessary to manually determine the consistency between the generated business model and business code. The method of this disclosure can replace manual determination of the consistency between the business model and business code generated in the current round, and thus determine the rationality of the business model and business code generated in the current round.

[0077] S220, extract features from the current round's business model and the current round's business code to obtain the first feature vector corresponding to the current round's business model and the second feature vector corresponding to the current round's business code.

[0078] In this embodiment of the disclosure, features can be extracted from the business model of the current round to obtain the feature vector corresponding to the business model of the current round, i.e., the first feature vector. Features can also be extracted from the business code of the current round to obtain the feature vector corresponding to the business code of the current round, i.e., the second feature vector.

[0079] S230, based on the first parameter obtained in the previous round, the first feature vector of the current round is corrected to obtain the first corrected vector of the current round, and based on the second parameter obtained in the previous round, the second feature vector of the current round is corrected to obtain the second corrected vector of the current round.

[0080] The first parameter represents the consistency between the content in the business model and the content in the business code, while the second parameter represents the consistency between the content in the business code and the content in the business model.

[0081] In this embodiment, the first parameter from the previous round is introduced to modify the first feature vector of the current round so that the language model can understand the direction in which the content in the generated business model is consistent with the content in the generated business code. Similarly, the second parameter from the previous round is introduced to modify the second feature vector of the current round so that the language model can understand the direction in which the content in the generated business code is consistent with the content in the generated business model.

[0082] In some implementations, when the current round is the first round of the language model's generation process, there is no first parameter or second parameter from the previous round. In this case, the first parameter and second parameter from the previous round can be set to preset initial values, such as 0.5.

[0083] In some implementations, the product of the first parameter obtained in the previous round and the first feature vector of the current round can be determined as the first correction vector of the current round. Similarly, the product of the second parameter obtained in the previous round and the second feature vector of the current round can be determined as the second correction vector of the current round.

[0084] S240, based on the business description data, the first correction vector of the current round, and the second correction vector of the current round, obtain the first parameter and the second parameter of the current round.

[0085] In this embodiment of the disclosure, after obtaining the first correction vector and the second correction vector of the current round, the business description data can be used as the business guidance standard, and the first parameter and the second parameter of the current round can be obtained based on the first correction vector and the second correction vector of the current round.

[0086] In some implementations, step S240, based on the business description data, the first correction vector of the current round, and the second correction vector of the current round, obtains the first parameter and the second parameter of the current round, which may include the following steps:

[0087] Based on the business description data using the language model, the following steps are taken: First, count the number of business entity vectors in the current round whose first correction vector has a reasonable correspondence with the second correction vector in the current round. Second, count the number of business entity vectors in the current round whose second correction vector has a reasonable correspondence with the first correction vector in the current round. The first parameter for the current round is obtained based on the ratio of the first number to the number of vectors included in the first correction vector. The second parameter for the current round is obtained based on the ratio of the second number to the number of vectors included in the second correction vector.

[0088] In this embodiment of the disclosure, by inputting business description data, a first correction vector, and a second correction vector into a language model and configuring execution rules for the language model, it is possible to determine whether the correspondence between the content in the first correction vector and the content in the second correction vector is reasonable through the language model, and to count the number of reasonably corresponding contents. That is, to count the first number of business entity vectors in which the first correction vector in the current round has a reasonable correspondence in the second correction vector in the current round.

[0089] For example, the execution rule of a language model can be configured as follows: "Input a first correction vector and a second correction vector, and based on business description data, determine whether the correspondence between the content in the first correction vector and the content in the second correction vector is reasonable, and count the number of reasonably corresponding contents." Through this execution rule, a first count can be obtained.

[0090] For example, another language model's execution rule can be configured as follows: "Input a first correction vector and a second correction vector, and based on business description data, determine whether the correspondence between the content in the second correction vector and the content in the first correction vector is reasonable, and count the number of reasonably corresponding contents." This execution rule yields the second count.

[0091] In some implementations, the first parameter of the current round is obtained based on the ratio of the first quantity to the number of vectors included in the first correction vector, and can be expressed by the following formula:

[0092]

[0093] Among them, g t Let |y| represent the first parameter in round t. t | represents the number of vectors included in the first correction vector of round t, y* t Let |y| represent the second correction vector in round t. t ∩y* t | represents the number of business entity vectors that have a reasonable correspondence with the first modified vector in round t in the second modified vector in round t, which is the first parameter in round t.

[0094] In some implementations, the first parameter of the current round is obtained based on the ratio of the second quantity to the number of vectors included in the second correction vector, and can be expressed by the following formula:

[0095]

[0096] Among them, g* t Let |y| represent the second parameter in round t. t | represents the number of vectors included in the first correction vector of round t, y* t Let |y* represent the second correction vector in round t. t ∩y t | represents the number of business entity vectors that have a reasonable correspondence with the first modified vector in round t, i.e., the second parameter in round t.

[0097] In some implementations, the first parameter of the current round can be obtained by a language model based on the ratio of the first quantity to the number of vectors included in the first correction vector; similarly, the second parameter of the current round can be obtained by a language model based on the ratio of the second quantity to the number of vectors included in the second correction vector.

[0098] S250 determines the rationality of the business model and business code for the current round based on the first and second parameters of the current round.

[0099] In some implementations, the rationality of the business model and business code in the current round is determined based on the first and second parameters of the current round. This can be achieved if the first parameter of the current round is greater than a first preset threshold and the second parameter of the current round is greater than a second preset threshold, in which case the business model and business code of the current round are determined to be rational. Otherwise, the business model and business code of the current round are determined to be unreasonable. In this case, the next round of generation process can be initiated, and the above method for identifying the rationality of the generated content can be repeated until the business model and business code generated by the language model are deemed reasonable.

[0100] In the above technical solution, for any round of generation, the business description data is processed by a language model to generate a business model for the current round, and the business code is generated by the language model to generate business code for the current round. Features are extracted from the business model and the business code for the current round to obtain a first feature vector corresponding to the business model and a second feature vector corresponding to the business code for the current round. The first feature vector of the current round is corrected based on the first parameters obtained in the previous round to obtain a first corrected vector for the current round, and the second feature vector of the current round is corrected based on the second parameters obtained in the previous round to obtain a second corrected vector for the current round. Based on the business description data, the first corrected vector, and the second corrected vector of the current round, the first and second parameters of the current round are obtained. Based on the first and second parameters of the current round, the rationality of the business model and business code for the current round is determined.

[0101] As can be seen, the embodiments of this disclosure propose a process to replace manual judgment of the rationality of the generated business model and business code. Furthermore, in any round of generation, the first feature vector and the second feature vector extracted in the current round are corrected by the first parameter and the second parameter obtained in the previous round, and the first parameter and the second parameter of the current round are calculated by the corrected vector. This allows the language model to understand the direction in which the content in the generated business model is consistent with the content in the generated business code, thereby improving the accuracy of subsequent rationality judgments.

[0102] As can be seen from the foregoing, a business model may include multiple business word segments. In this case, the method of this disclosure embodiment may further include the following steps:

[0103] Search for the business knowledge corresponding to each business segment in the preset knowledge graph; according to the order of each business segment in the business description data, concatenate the business knowledge corresponding to each business segment to obtain the first concatenation result.

[0104] Accordingly, the first feature vector corresponding to the business model of the current round is obtained through the following steps:

[0105] Feature extraction is performed on the first concatenation result to obtain the first feature vector.

[0106] In this embodiment of the disclosure, the preset knowledge graph can be a knowledge graph of the domain to which the business project belongs.

[0107] In this embodiment of the disclosure, each business word is first queried in a preset knowledge graph. Each business word will obtain a matching knowledge in the knowledge graph. Then, according to the order of each business word in the business description data, the business knowledge corresponding to each business word is concatenated to obtain a first concatenation result. Then, feature extraction can be performed on the first concatenation result to obtain a first feature vector.

[0108] In some implementations, the process of generating the current round's business model and obtaining the first concatenation result can be achieved through a language model.

[0109] For example, the execution rule of a language model can be configured as follows: "The input business description data is segmented into words. Each segment should be queried in the imported knowledge graph to obtain the most matching knowledge. The query result should be the content that exists in the imported knowledge graph and accurately match the business description data. The obtained knowledge is connected according to the order of the segmented words to form the first concatenation result."

[0110] By using the above method, the first feature vector can be located in relevant industry knowledge by querying the knowledge graph that corresponds to the business word segmentation, thereby compressing the dimension of the first feature vector.

[0111] In some implementations, step S120, which involves extracting features from the current round's business model and the current round's business code to obtain a first feature vector corresponding to the current round's business model and a second feature vector corresponding to the current round's business code, may include the following steps:

[0112] Feature extraction is performed on the target sequence data to obtain the first intermediate feature vector corresponding to each time step. Each time step corresponds to a sequence position in the target sequence data. The target sequence data is either sequence data obtained based on the business model of the current round or sequence data obtained based on the business code of the current round. For any two adjacent time steps, based on the first intermediate feature vector corresponding to the previous time step and the first intermediate feature vector corresponding to the adjacent next time step, the first intermediate feature vector corresponding to the adjacent next time step is reconstructed to obtain a reconstructed vector sequence. The reconstructed vector sequence includes the reconstructed vectors corresponding to each time step. Based on the hierarchical information between the reconstructed vectors in the reconstructed vector sequence, feature extraction is performed on the reconstructed vector sequence to obtain the second intermediate feature vector corresponding to each time step.

[0113] Specifically, when the target sequence data is the business model of the current round, the second intermediate feature vectors corresponding to each time step constitute the first feature vector; when the target sequence data is the business code of the current round, the second intermediate feature vectors corresponding to each time step constitute the second feature vector.

[0114] In this embodiment of the disclosure, the process of feature extraction for the current round of business model or the current round of business code is consistent.

[0115] For example, when performing the above feature extraction steps on the current round of business model, the target sequence data can be obtained based on the current round of business model. For instance, the target sequence data can be obtained by directly concatenating the business segments included in the business model in order, or, as in the aforementioned embodiment, by concatenating the business knowledge corresponding to each business segment in order to obtain a first concatenation result, which is the sequence data. In this case, the first feature vector corresponding to the current round of business model can be constructed based on the second intermediate feature vectors corresponding to each time step.

[0116] For example, when extracting features from the business code of the current round, the target sequence data can be obtained based on the business code of the current round. For instance, the target sequence data can be obtained by directly concatenating the business entity code objects included in the business code in sequence. In this case, the second feature vector corresponding to the business code of the current round can be constructed based on the second intermediate feature vectors corresponding to each time step.

[0117] In this embodiment of the disclosure, the process of feature extraction from the target sequence data can be understood as a feature capture process, used to obtain high-dimensional features of the relationships between the target sequence data, i.e., the first intermediate feature vector, in order to obtain better feature representation. Optionally, feature extraction from the target sequence data can be performed using a sequence data processing model.

[0118] In this embodiment of the disclosure, for any two adjacent time steps, the first intermediate feature vector corresponding to the adjacent next time step is reconstructed based on the first intermediate feature vector corresponding to the previous time step and the first intermediate feature vector corresponding to the adjacent next time step, thereby obtaining a reconstructed vector sequence. Through this process, the vector of each time step is adjusted and updated based on the vector of the previous time step and the vector of the current time step. By recursively applying this process, the entire vector sequence can be reconstructed, making the obtained reconstructed vector sequence more reasonable and consistent in the entire sequence, thereby obtaining a better feature representation effect.

[0119] In this embodiment of the disclosure, the process of extracting features from the reconstructed vector sequence based on the hierarchical information between each reconstructed vector in the reconstructed vector sequence can be understood as a structural parsing process. In this process, by integrating the hierarchical information into the neural network feature extraction process, the neural network is allowed to automatically learn the hierarchical structural information to obtain better feature representation results.

[0120] It should be noted that, in some implementations, during the process of extracting features from the current round's business model and the current round's business code to obtain the first feature vector corresponding to the current round's business model and the second feature vector corresponding to the current round's business code, one or more of the above-mentioned processes to improve the feature expression effect can be selected according to actual needs.

[0121] In some implementations, feature extraction of the target sequence data to obtain the first intermediate feature vector corresponding to each time step may include the following steps:

[0122] The first long short-term memory neural network extracts features from the target sequence data in a forward order to obtain the first sub-feature vector corresponding to each time step; the second long short-term memory neural network extracts features from the target sequence data in a reverse order to obtain the second sub-feature vector corresponding to each time step; based on the first sub-feature vector and the second sub-feature vector corresponding to each time step, the first intermediate feature vector corresponding to each time step is obtained by concatenating them.

[0123] In this embodiment, two independent Long Short-Term Memory (LSTM) neural networks can be set up for feature extraction: a first LSTM neural network and a second LSTM neural network. The first LSTM neural network is used to extract features from the target sequence data in a forward order, while the second LSTM neural network is used to extract features from the target sequence data in a reverse order. Finally, the high-dimensional features output by the two LSTM neural networks are concatenated according to the time step order during feature extraction, and the sub-feature vectors of the same time step are concatenated to obtain the first intermediate feature vector corresponding to each time step. In this way, the weight imbalance caused by the word order of the business description data can be eliminated, thereby obtaining a better feature representation effect.

[0124] In some implementations, for any two adjacent time steps, based on the first intermediate feature vector corresponding to the previous time step and the first intermediate feature vector corresponding to the adjacent next time step, the first intermediate feature vector corresponding to the next next time step is reconstructed to obtain a reconstructed vector sequence, which may include the following steps:

[0125] The first intermediate feature vector corresponding to the previous time step and the first intermediate feature vector corresponding to the adjacent next time step are processed based on the preset state transition function to obtain the state transition vector; based on the temporary variable corresponding to the previous time step and the state transition vector, the temporary variable corresponding to the adjacent next time step is obtained; the temporary variable corresponding to the adjacent next time step is normalized, and the normalization result is determined as the reconstruction vector corresponding to the adjacent next time step; based on the reconstruction vector corresponding to each time step, the reconstruction vector sequence is obtained.

[0126] In this sequence, the temporary variable corresponding to the first time step is equal to the feature vector corresponding to the first time step.

[0127] In this embodiment, a recursive formula can be used for vector reconstruction. Specifically, for each adjacent subsequent time step, its corresponding temporary variable is first calculated. This temporary variable is obtained based on the temporary variable corresponding to the previous time step and the state transition vector. Then, the temporary variable corresponding to the adjacent subsequent time step can be further normalized, thereby determining the normalization result as the reconstruction vector corresponding to the adjacent subsequent time step. Finally, the reconstruction vectors corresponding to each time step can be concatenated to obtain a sequence of reconstruction vectors.

[0128] In some implementations, the sum of the temporary variable corresponding to the previous time step and the state transition vector can be used as the temporary variable corresponding to the adjacent subsequent time step.

[0129] In some implementations, the preset state transition function can be a max function, that is, the maximum value is selected as the state transition vector from the first intermediate feature vector corresponding to the previous time step and the first intermediate feature vector corresponding to the adjacent next time step.

[0130] In some implementations, normalization can be achieved using the softmax function. Normalization transforms temporary variables into a probability distribution, ensuring a reasonable proportional relationship between the vectors in the reconstructed vector sequence.

[0131] In some implementations, the above process can be represented by the following formula:

[0132] δ(y t )=δ(y t-1 )+ψ(y t-1 y t )

[0133] y t =softmax(δ(y) t ))

[0134] Wherein, δ(y) t) represents the temporary variable corresponding to the t-th time step, δ(y) t-1 ) represents the temporary variable corresponding to the (t-1)th time step, ψ(y) t-1 y t ) represents the state transition function acting on the first intermediate eigenvector at time step (t-1) and the first intermediate eigenvector at time step (t). t This represents the reconstruction vector corresponding to the t-th time step.

[0135] In some implementations, feature extraction is performed on the reconstructed vector sequence based on the hierarchical information between the reconstructed vectors in the sequence to obtain the second intermediate feature vector corresponding to each time step. This may include the following steps:

[0136] The reconstructed vector sequence is input into a third long short-term memory neural network to perform the following steps:

[0137] For any two adjacent time steps, based on the feature vector output from the previous time step and the reconstruction vector corresponding to the adjacent subsequent time step, the calculation results of the first input gate, the first forget gate, the output gate, and the candidate state information for the adjacent subsequent time step are obtained respectively. Based on the calculation results of the second input gate from the previous time step, the feature vector output from the previous time step, and the reconstruction vector corresponding to the adjacent subsequent time step, the calculation result of the second input gate for the adjacent subsequent time step is obtained. Based on the calculation results of the second forget gate from the previous time step, the feature vector output from the previous time step, and the reconstruction vector corresponding to the adjacent subsequent time step, the calculation result of the second forget gate for the adjacent subsequent time step is obtained. Based on the adjacent subsequent time steps... The intermediate parameters of the adjacent next time step are obtained by calculating the second input gate of the next time step and the second forget gate of the adjacent next time step. Based on the intermediate parameters of the adjacent next time step, the calculation results of the first forget gate of the adjacent next time step, the unit state of the previous time step, the calculation results of the first input gate of the adjacent next time step, the candidate state information corresponding to the adjacent next time step, the calculation results of the second forget gate of the adjacent next time step, and the calculation results of the second input gate of the adjacent next time step, the unit state of the adjacent next time step is obtained. Based on the unit state of the adjacent next time step and the calculation results of the output gate of the adjacent next time step, the second intermediate feature vector corresponding to the next time step is obtained.

[0138] In this embodiment of the disclosure, a third long short-term memory neural network can be used to extract features from the reconstructed vector sequence to obtain the second intermediate feature vector corresponding to each time step. In this embodiment of the disclosure, neurons in the third long short-term memory neural network are specifically ordered to integrate hierarchical information into the neural network, thereby allowing the neural network to automatically learn the hierarchical information between each reconstructed vector.

[0139] The third long short-term memory neural network in this embodiment, compared with the traditional long short-term memory neural network, adds an input gate (second input gate) and a forget gate (second forget gate) to the existing single input gate (first input gate), single forget gate (first forget gate), and single output gate.

[0140] The data flow of the first input gate, the first forget gate, and the output gate can be referenced from traditional long short-term memory neural networks.

[0141] The computation of the second input gate in the next adjacent time step depends on the output of the second input gate in the previous time step, the feature vector output in the previous time step, and the reconstruction vector corresponding to the next adjacent time step.

[0142] The computation of the second forget gate in the next adjacent time step depends on the output of the second forget gate in the previous time step, the feature vector output in the previous time step, and the reconstruction vector corresponding to the next adjacent time step.

[0143] The calculation of the cell state in the next adjacent time step depends on the calculation results of the second input gate in the next adjacent time step, the calculation results of the second forget gate in the next adjacent time step, the calculation results of the first forget gate in the next adjacent time step, the cell state in the previous time step, the calculation results of the first input gate in the next adjacent time step, and the candidate state information corresponding to the next adjacent time step.

[0144] The calculation of the feature vector output by the adjacent next time step (i.e. the second intermediate feature vector corresponding to the adjacent next time step) depends on the cell state of the adjacent next time step and the calculation results of the output gate of the adjacent next time step.

[0145] In some implementations, the process of extracting features from the reconstructed vector sequence based on the hierarchical information between the reconstructed vectors in the reconstructed vector sequence to obtain the second intermediate feature vector corresponding to each time step can be expressed by the following formula:

[0146] f* t = sigmod(W f*x X t +W f*h h t-1 +b f* )

[0147] i* t =sigmod(W i*x X t +W i*h h t-1 +b i* )

[0148] o* t =sigmod(W o*x X t +W o*h h t-1 +b o* )

[0149] z* t =sigmod(W z*x X t +W z*h h t-1 +b z* )

[0150] f′ t =max(f′ t-1 ,softmax(W f′x X t +W f′h h t-1 +b f′ ))

[0151] i′ t =max(i′ t-1 ,softmax(W i′x X t +W i′h h t-1 +b i′ ))

[0152] ω t =f′ t ⊙i′ t

[0153] c* t =ω t ⊙(f * t ⊙c* t-1 +i* t ⊙z* t )+(f′ t -ω t )⊙c* t-1 +(i′ t -ω t )⊙z* t

[0154] h* t =o*t tanh⊙(c* t )

[0155] Among them, f* t i* represents the result of calculating the first forget gate at time step t. t o* represents the computation result of the first input gate at time step t. t z* represents the calculation result of the output gate at time step t. t f′ represents the candidate state information at time step t. t Let i′ represent the result of the calculation of the second forget gate at time step t. t ω represents the calculation result of the second input gate at time step t. t c* represents the intermediate parameters at time step t. t h* represents the cell state at time step t. t Let X represent the feature vector output at time step t. t h represents the reconstruction vector corresponding to the t-th time step. t-1 W represents the feature vector output at time step (t-1), ⊙ represents the element-wise product. f*x W represents the weight of the corresponding reconstruction vector input in the first forget gate. f*x b represents the weight of the corresponding feature vector input in the first forgetting gate. f* W represents the bias corresponding to the first forget gate. f′x W represents the weights of the corresponding reconstruction vector inputs in the second forget gate. f′h b represents the weight of the corresponding feature vector input in the first forgetting gate. f′ This indicates the bias corresponding to the first forget gate. Additionally, W... i*x W i*h b i* W o*x W o*h b o* W z*x W z*h b z* W i′x W i′h and b i′ The meaning of the symbols can be found in the aforementioned naming method, and will not be repeated here.

[0156] Based on the foregoing, for the sequence data obtained based on the current round's business model, the aforementioned feature extraction process can be performed to obtain the first feature vector corresponding to the current round's business model. Furthermore, for the sequence data obtained based on the current round's business code, the aforementioned feature extraction process can also be performed to obtain the second feature vector corresponding to the current round's business code. In these two execution processes, the model structure is the same, but the model parameters can be different; therefore, the two execution processes can correspond to two different models. Specifically, the model used to obtain the first feature vector of the current round can be a first neural network model, and the model used to obtain the second feature vector of the current round can be a second neural network model.

[0157] In this case, step S220, which involves extracting features from the current round's business model and the current round's business code to obtain the first feature vector corresponding to the current round's business model and the second feature vector corresponding to the current round's business code, may include the following steps:

[0158] The first feature vector of the current round is obtained by extracting features from the business model of the current round using the first neural network model; the second feature vector of the current round is obtained by extracting features from the business code of the current round using the second neural network model.

[0159] The first neural network model and the second neural network model are respectively used as a generative network and an adversarial network, and are trained by generating adversarial methods with the goal of maximizing the first parameter and the second parameter.

[0160] In this embodiment of the disclosure, the first neural network model can be used as a generative network, the second neural network model can be used as an adversarial network, and generative adversarial training can be performed with the goal of maximizing the first parameter and the second parameter to obtain the trained first neural network model and the trained second neural network model.

[0161] Subsequently, the trained first neural network model can be used to extract features from the business model of the current round to obtain the first feature vector of the current round, and the trained second neural network model can be used to extract features from the business code of the current round to obtain the second feature vector of the current round.

[0162] It should be noted that, based on the characteristics of neural network models, the data processing process is similar in both the model training and model application stages. Therefore, in the model training stage, the data processing process of the neural network model can be referred to the data processing process of the neural network model in the model application stage in the aforementioned embodiments. The detailed process of the model training stage will not be repeated in this disclosure embodiment.

[0163] In this embodiment of the disclosure, a first parameter and a second parameter are introduced for calculation during the model training phase, so that the consistency between the business model and the business code can be used as the optimization target of the neural network during the model training process, and the parameters can be tuned.

[0164] Figure 3 This is a flowchart illustrating a method for identifying the reasonableness of generated content according to an exemplary embodiment of this disclosure. (Refer to...) Figure 3 The methods for identifying the reasonableness of generated content include:

[0165] S310: For any round of generation process, the business description data is processed by the language model to generate the business model for the current round, and the business code is generated by the language model to generate the business code for the current round.

[0166] S320: Search for the business knowledge corresponding to each business segmentation included in the business model in the preset knowledge graph. According to the order of each business segmentation in the business description data, concatenate the business knowledge corresponding to each business segmentation to obtain the first concatenation result.

[0167] S330: The first feature vector of the current round is obtained by extracting features from the first concatenation result of the current round through the first neural network model, and the second feature vector of the current round is obtained by extracting features from the business code of the current round through the second neural network model.

[0168] S340, based on the first parameter obtained in the previous round, the first feature vector of the current round is corrected to obtain the first corrected vector of the current round, and based on the second parameter obtained in the previous round, the second feature vector of the current round is corrected to obtain the second corrected vector of the current round.

[0169] S350 uses a language model to count, based on business description data, the first number of business entity vectors that have a reasonable correspondence between the first correction vector in the current round and the second correction vector in the current round, and uses a language model to count, based on business description data, the second number of business entity vectors that have a reasonable correspondence between the second correction vector in the current round and the first correction vector in the current round.

[0170] S360, the first parameter of the current round is obtained based on the ratio of the first quantity to the number of vectors included in the first feature vector, and the second parameter of the current round is obtained based on the ratio of the second quantity to the number of vectors included in the second feature vector.

[0171] S370, based on the first and second parameters of the current round, determines the rationality of the business model and business code of the current round.

[0172] For a detailed description of steps S310-S370, please refer to the foregoing embodiments, and they will not be repeated here.

[0173] By adopting the above technical solution, the rationality of the generated business model and business code can be replaced by manual judgment. In addition, by querying the knowledge corresponding to the business word segmentation in the knowledge graph, the first feature vector can be located to relevant industry knowledge, thereby compressing the dimension of the first feature vector and making it possible to deploy the neural network locally at low cost. Furthermore, since the process of generating the business model and business code, as well as the process of determining the first and second parameters, can be implemented by different devices, the federated learning framework can be used to build the system, which improves data security.

[0174] Based on the same inventive concept, this disclosure provides an apparatus for identifying the reasonableness of generated content. Figure 4 This is a block diagram of an apparatus 400 for identifying the reasonableness of generated content, as shown in an exemplary embodiment of this disclosure, with reference to... Figure 4 The device 400 for identifying the reasonableness of generated content includes:

[0175] The generation module 401 is used to perform business model generation processing on the business description data through a language model for any round of generation process to obtain the business model of the current round, and to perform business code generation processing on the business description data through a language model to obtain the business code of the current round.

[0176] The feature extraction module 402 is used to extract features from the current round business model and the current round business code respectively, to obtain a first feature vector corresponding to the current round business model and a second feature vector corresponding to the current round business code;

[0177] The feature correction module 403 is used to correct the first feature vector of the current round based on the first parameter obtained in the previous round to obtain the first corrected vector of the current round, and to correct the second feature vector of the current round based on the second parameter obtained in the previous round to obtain the second corrected vector of the current round. The first parameter represents the consistency between the content in the business model and the content in the business code, and the second parameter represents the consistency between the content in the business code and the content in the business model.

[0178] The parameter determination module 404 is used to obtain the first parameter and the second parameter of the current round based on the business description data, the first correction vector of the current round, and the second correction vector of the current round;

[0179] The judgment module 405 is used to determine the rationality of the business model and business code of the current round based on the first parameter and the second parameter of the current round.

[0180] Optionally, the business model includes multiple business word segments, and the device 400 for identifying the reasonableness of the generated content further includes:

[0181] The query module is used to search for business knowledge corresponding to each of the business segments in a preset knowledge graph;

[0182] The splicing module is used to splice the business knowledge corresponding to each of the business segments according to the order of each of the business segments in the business description data, so as to obtain a first splicing result;

[0183] Correspondingly, the feature extraction module 402 is also used to extract features from the first splicing result to obtain the first feature vector.

[0184] Optionally, the feature extraction module 402 includes:

[0185] The first processing module is used to extract features from the target sequence data to obtain the first intermediate feature vector corresponding to each time step. Each time step corresponds to a sequence position in the target sequence data. The target sequence data is sequence data obtained based on the business model of the current round or sequence data obtained based on the business code of the current round.

[0186] The second processing module is used to reconstruct the first intermediate feature vector corresponding to the next adjacent time step for any two adjacent time steps based on the first intermediate feature vector corresponding to the previous time step and the first intermediate feature vector corresponding to the next adjacent time step, so as to obtain a reconstructed vector sequence, wherein the reconstructed vector sequence includes the reconstructed vector corresponding to each time step.

[0187] The third processing module is used to extract features from the reconstructed vector sequence based on the hierarchical information between each reconstructed vector in the reconstructed vector sequence, and obtain the second intermediate feature vector corresponding to each time step.

[0188] Wherein, when the target sequence data is the business model of the current round, the second intermediate feature vectors corresponding to each time step constitute the first feature vector; and when the target sequence data is the business code of the current round, the second intermediate feature vectors corresponding to each time step constitute the second feature vector.

[0189] Optionally, the first processing module is further configured to extract features from the target sequence data in a forward order using a first long short-term memory neural network to obtain a first sub-feature vector corresponding to each time step; extract features from the target sequence data in a reverse order using a second long short-term memory neural network to obtain a second sub-feature vector corresponding to each time step; and concatenate the first sub-feature vector and the second sub-feature vector corresponding to each time step to obtain a first intermediate feature vector corresponding to each time step.

[0190] Optionally, the second processing module is further configured to process the first intermediate feature vector corresponding to the previous time step and the first intermediate feature vector corresponding to the adjacent next time step based on a preset state transition function to obtain a state transition vector; obtain the temporary variable corresponding to the adjacent next time step based on the temporary variable corresponding to the previous time step and the state transition vector; normalize the temporary variable corresponding to the adjacent next time step and determine the normalization result as the reconstruction vector corresponding to the adjacent next time step; obtain the reconstruction vector sequence based on the reconstruction vectors corresponding to each time step; wherein the temporary variable corresponding to the first time step in the sequence is equal to the feature vector corresponding to the first time step.

[0191] Optionally, the third processing module is further configured to input the reconstructed vector sequence into a third long short-term memory neural network to perform the following steps through the third long short-term memory neural network:

[0192] For any two adjacent time steps, based on the feature vector output from the previous time step and the reconstruction vector corresponding to the adjacent subsequent time step, the calculation results of the first input gate, the first forget gate, the output gate, and the candidate state information for the adjacent subsequent time step are obtained respectively. Based on the calculation results of the second input gate from the previous time step, the feature vector output from the previous time step, and the reconstruction vector corresponding to the adjacent subsequent time step, the calculation result of the second input gate for the adjacent subsequent time step is obtained. Based on the calculation results of the second forget gate from the previous time step, the feature vector output from the previous time step, and the reconstruction vector corresponding to the adjacent subsequent time step, the calculation result of the second forget gate for the adjacent subsequent time step is obtained. Based on the adjacent subsequent time steps... The intermediate parameters of the adjacent next time step are obtained by calculating the second input gate of the next time step and the second forget gate of the adjacent next time step. Based on the intermediate parameters of the adjacent next time step, the calculation results of the first forget gate of the adjacent next time step, the unit state of the previous time step, the calculation results of the first input gate of the adjacent next time step, the candidate state information corresponding to the adjacent next time step, the calculation results of the second forget gate of the adjacent next time step, and the calculation results of the second input gate of the adjacent next time step, the unit state of the adjacent next time step is obtained. Based on the unit state of the adjacent next time step and the calculation results of the output gate of the adjacent next time step, the second intermediate feature vector corresponding to the next time step is obtained.

[0193] Optionally, the parameter determination module 404 is further configured to: use a language model to count, based on the business description data, a first number of business entity vectors in the current round whose first correction vector has a reasonable correspondence with the second correction vector in the current round; use a language model to count, based on the business description data, a second number of business entity vectors in the current round whose second correction vector has a reasonable correspondence with the first correction vector in the current round; obtain the first parameter of the current round based on the ratio of the first number to the number of vectors included in the first feature vector; and obtain the second parameter of the current round based on the ratio of the second number to the number of vectors included in the second feature vector.

[0194] Optionally, the feature extraction module 402 is further configured to extract features from the current round's business model using a first neural network model to obtain a first feature vector for the current round; and to extract features from the current round's business code using a second neural network model to obtain a second feature vector for the current round; the first neural network model and the second neural network model are respectively used as a generative network and an adversarial network, and are trained by generating adversarial methods with the optimization objective of maximizing the first parameter and the second parameter.

[0195] Regarding the apparatus 400 for identifying the rationality of generated content in the above embodiments, the specific manner in which each module performs its operation has been described in detail in the embodiments related to the method, and will not be elaborated here.

[0196] Based on the same inventive concept, embodiments of this disclosure also provide a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the steps of the method for identifying the reasonableness of generated content as described in any embodiment of this disclosure.

[0197] Based on the same inventive concept, this disclosure also provides an electronic device, including:

[0198] A memory on which computer programs are stored;

[0199] A processor is configured to execute the computer program in the memory to implement the steps of the method for identifying the legitimacy of generated content as described in any embodiment of the present disclosure.

[0200] Figure 5 This is a block diagram illustrating an electronic device 500 according to an exemplary embodiment. For example... Figure 5 As shown, the electronic device 500 may include a processor 501 and a memory 502. The electronic device 500 may also include one or more of a multimedia component 503, an input / output (I / O) interface 504, and a communication component 505.

[0201] The processor 501 controls the overall operation of the electronic device 500 to complete all or part of the steps in the method for identifying the reasonableness of generated content. The memory 502 stores various types of data to support the operation of the electronic device 500. This data may include, for example, instructions for any application or method operating on the electronic device 500, and application-related data such as contact data, sent and received messages, pictures, audio, video, etc. The memory 502 can be implemented by any type of volatile or non-volatile storage device or a combination thereof, such as Static Random Access Memory (SRAM), Electrically Erasable Programmable Read-Only Memory (EEPROM), Erasable Programmable Read-Only Memory (EPROM), Programmable Read-Only Memory (PROM), Read-Only Memory (ROM), magnetic storage, flash memory, magnetic disk, or optical disk. Multimedia component 503 may include a screen and an audio component. The screen may be, for example, a touchscreen, and the audio component is used to output and / or input audio signals. For example, the audio component may include a microphone for receiving external audio signals. The received audio signals may be further stored in memory 502 or transmitted via communication component 505. The audio component also includes at least one speaker for outputting audio signals. I / O interface 504 provides an interface between processor 501 and other interface modules, such as a keyboard, mouse, buttons, etc. These buttons may be virtual or physical buttons. Communication component 505 is used for wired or wireless communication between the electronic device 500 and other devices. Wireless communication may include Wi-Fi, Bluetooth, Near Field Communication (NFC), 2G, 3G, or 4G, or a combination of these. Therefore, the corresponding communication component 505 may include a Wi-Fi module, a Bluetooth module, or an NFC module.

[0202] In an exemplary embodiment, the electronic device 500 may be implemented by one or more application-specific integrated circuits (ASICs), digital signal processors (DSPs), digital signal processing devices (DSPDs), programmable logic devices (PLDs), field-programmable gate arrays (FPGAs), controllers, microcontrollers, microprocessors, or other electronic components to perform the above-described method for identifying the reasonableness of generated content.

[0203] In another exemplary embodiment, a computer-readable storage medium including program instructions is also provided, which, when executed by a processor, implement the steps of the method for identifying the legitimacy of generated content described above. For example, the computer-readable storage medium may be the memory 502 including the program instructions described above, which may be executed by the processor 501 of the electronic device 500 to perform the method for identifying the legitimacy of generated content described above.

[0204] In another exemplary embodiment, a computer program product is also provided, the computer program product comprising a computer program executable by a programmable device, the computer program having a code portion for performing the above-described method for identifying the reasonableness of generated content when executed by the programmable device.

[0205] The preferred embodiments of this disclosure have been described in detail above with reference to the accompanying drawings. However, this disclosure is not limited to the specific details of the above embodiments. Within the scope of the technical concept of this disclosure, various simple modifications can be made to the technical solutions of this disclosure, and these simple modifications all fall within the protection scope of this disclosure.

[0206] It should also be noted that the various specific technical features described in the above specific embodiments can be combined in any suitable manner without contradiction. In order to avoid unnecessary repetition, this disclosure will not describe the various possible combinations separately.

[0207] Furthermore, various different embodiments of this disclosure can be combined in any way, as long as they do not violate the spirit of this disclosure, they should also be regarded as the content disclosed in this disclosure.

Claims

1. A method for identifying the rationality of generated content, characterized in that, include: For any round of generation, the business description data is processed by a language model to generate a business model for the current round, and the business description data is processed by a language model to generate business code for the current round. Feature extraction is performed on the current round's business model and the current round's business code to obtain a first feature vector corresponding to the current round's business model and a second feature vector corresponding to the current round's business code; The first feature vector of the current round is corrected based on the first parameter obtained in the previous round to obtain the first corrected vector of the current round, and the second feature vector of the current round is corrected based on the second parameter obtained in the previous round to obtain the second corrected vector of the current round. The first parameter represents the consistency between the content in the business model and the content in the business code, and the second parameter represents the consistency between the content in the business code and the content in the business model. Based on the business description data, the first correction vector of the current round, and the second correction vector of the current round, the first parameter and the second parameter of the current round are obtained; Based on the first and second parameters of the current round, determine the rationality of the business model and business code of the current round; The business description data is used to describe the functions and objectives that the project needs to accomplish; The business model includes multiple business word segments, which are obtained by segmenting business description data. The business code includes multiple business entity code objects; The process of obtaining the first and second parameters of the current round based on the business description data, the first correction vector of the current round, and the second correction vector of the current round includes: Based on the business description data using the language model, count the first number of business entity vectors that have a reasonable correspondence between the first correction vector of the current round and the second correction vector of the current round; Based on the business description data using the language model, count the second number of business entity vectors that have a reasonable correspondence with the first correction vector in the current round in the current round; The first parameter of the current round is obtained based on the ratio of the first quantity to the number of vectors included in the first feature vector; The second parameter of the current round is obtained based on the ratio of the second quantity to the number of vectors included in the second feature vector.

2. The method according to claim 1, characterized in that, The business model includes multiple business word segmentations, and the method further includes: Search the preset knowledge graph for the business knowledge corresponding to each of the business word segments; Based on the order of each business segment in the business description data, the business knowledge corresponding to each business segment is concatenated to obtain the first concatenation result; The first feature vector corresponding to the business model of the current round is obtained through the following steps: Feature extraction is performed on the first splicing result to obtain the first feature vector.

3. The method according to claim 1, characterized in that, The step of extracting features from the current round's business model and the current round's business code to obtain a first feature vector corresponding to the current round's business model and a second feature vector corresponding to the current round's business code includes: Feature extraction is performed on the target sequence data to obtain the first intermediate feature vector corresponding to each time step. Each time step corresponds to a sequence position in the target sequence data. The target sequence data is sequence data obtained based on the business model of the current round or sequence data obtained based on the business code of the current round. For any two adjacent time steps, based on the first intermediate feature vector corresponding to the previous time step and the first intermediate feature vector corresponding to the adjacent next time step, the first intermediate feature vector corresponding to the adjacent next time step is reconstructed to obtain a reconstructed vector sequence, which includes the reconstructed vectors corresponding to each time step. Based on the hierarchical information between each reconstruction vector in the reconstruction vector sequence, feature extraction is performed on the reconstruction vector sequence to obtain the second intermediate feature vector corresponding to each time step; Wherein, when the target sequence data is the business model of the current round, the second intermediate feature vectors corresponding to each time step constitute the first feature vector; and when the target sequence data is the business code of the current round, the second intermediate feature vectors corresponding to each time step constitute the second feature vector.

4. The method according to claim 3, characterized in that, The step of extracting features from the target sequence data to obtain the first intermediate feature vector corresponding to each time step includes: The target sequence data is extracted using a first long short-term memory neural network in a forward order to obtain the first sub-feature vector corresponding to each time step. The target sequence data is extracted using a second long short-term memory neural network in reverse order to obtain the second sub-feature vector corresponding to each time step; Based on the first sub-feature vector corresponding to each time step and the second sub-feature vector corresponding to each time step, the first intermediate feature vector corresponding to each time step is obtained by concatenation.

5. The method according to claim 3, characterized in that, For any two adjacent time steps, based on the first intermediate feature vector corresponding to the previous time step and the first intermediate feature vector corresponding to the adjacent next time step, the first intermediate feature vector corresponding to the next next time step is reconstructed to obtain a reconstructed vector sequence, including: The state transition vector is obtained by processing the first intermediate feature vector corresponding to the previous time step and the first intermediate feature vector corresponding to the adjacent next time step based on the preset state transition function. Based on the temporary variable corresponding to the previous time step and the state transition vector, the temporary variable corresponding to the adjacent next time step is obtained. The temporary variables corresponding to the next adjacent time step are normalized, and the normalization result is determined as the reconstruction vector corresponding to the next adjacent time step. Based on the reconstruction vectors corresponding to each time step, the reconstruction vector sequence is obtained; In this sequence, the temporary variable corresponding to the first time step is equal to the feature vector corresponding to the first time step.

6. The method according to claim 3, characterized in that, The step of extracting features from the reconstructed vector sequence based on the hierarchical information between the reconstructed vectors in the sequence to obtain the second intermediate feature vector corresponding to each time step includes: The reconstructed vector sequence is input into a third long short-term memory neural network to perform the following steps: For any two adjacent time steps, based on the feature vector output from the previous time step and the reconstruction vector corresponding to the adjacent subsequent time step, the calculation results of the first input gate, the calculation results of the first forget gate, the calculation results of the output gate, and the candidate state information of the adjacent subsequent time step are obtained respectively. Based on the calculation result of the second input gate in the previous time step, the feature vector output in the previous time step, and the reconstruction vector corresponding to the next adjacent time step, the calculation result of the second input gate in the next adjacent time step is obtained. Based on the calculation result of the second forget gate in the previous time step, the feature vector output in the previous time step, and the reconstruction vector corresponding to the adjacent subsequent time step, the calculation result of the second forget gate in the adjacent subsequent time step is obtained. Based on the calculation results of the second input gate in the adjacent next time step and the calculation results of the second forget gate in the adjacent next time step, the intermediate parameters of the adjacent next time step are obtained. The cell state of the next adjacent time step is obtained based on the intermediate parameters of the next adjacent time step, the calculation result of the first forget gate of the next adjacent time step, the cell state of the previous time step, the calculation result of the first input gate of the next adjacent time step, the candidate state information corresponding to the next adjacent time step, the calculation result of the second forget gate of the next adjacent time step, and the calculation result of the second input gate of the next adjacent time step. Based on the cell state of the adjacent next time step and the calculation results of the output gate of the adjacent next time step, the second intermediate feature vector corresponding to the next time step is obtained.

7. The method according to claim 1, characterized in that, The step of extracting features from the current round's business model and the current round's business code to obtain a first feature vector corresponding to the current round's business model and a second feature vector corresponding to the current round's business code includes: The first feature vector of the current round is obtained by extracting features from the business model of the current round using the first neural network model; The second feature vector of the current round is obtained by extracting features from the business code of the current round using a second neural network model. The first neural network model and the second neural network model are respectively used as a generative network and an adversarial network, and are trained by generative adversarial methods with the optimization objective of maximizing the first parameter and the second parameter.

8. A device for identifying the rationality of generated content, characterized in that, The device includes: The generation module is used to perform business model generation processing on the business description data through a language model for any given generation process, to obtain the business model for the current round, and to perform business code generation processing on the business description data through a language model, to obtain the business code for the current round. The feature extraction module is used to extract features from the current round's business model and the current round's business code respectively, to obtain a first feature vector corresponding to the current round's business model and a second feature vector corresponding to the current round's business code; The feature correction module is used to correct the first feature vector of the current round based on the first parameter obtained in the previous round to obtain the first corrected vector of the current round, and to correct the second feature vector of the current round based on the second parameter obtained in the previous round to obtain the second corrected vector of the current round. The first parameter represents the consistency between the content in the business model and the content in the business code, and the second parameter represents the consistency between the content in the business code and the content in the business model. The parameter determination module is used to obtain the first parameter and the second parameter of the current round based on the business description data, the first correction vector of the current round, and the second correction vector of the current round; The judgment module is used to determine the rationality of the business model and business code of the current round based on the first parameter and the second parameter of the current round; The business description data is used to describe the functions and objectives that the project needs to accomplish; The business model includes multiple business word segments, which are obtained by segmenting business description data. The business code includes multiple business entity code objects; The parameter determination module is further configured to: use a language model to count, based on the business description data, a first number of business entity vectors in the current round whose first correction vector has a reasonable correspondence with the second correction vector in the current round; use a language model to count, based on the business description data, a second number of business entity vectors in the current round whose second correction vector has a reasonable correspondence with the first correction vector in the current round; obtain the first parameter of the current round based on the ratio of the first number to the number of vectors included in the first feature vector; and obtain the second parameter of the current round based on the ratio of the second number to the number of vectors included in the second feature vector.

9. A computer-readable storage medium having a computer program stored thereon, characterized in that, When executed by a processor, the program implements the steps of the method according to any one of claims 1 to 7.

10. An electronic device, characterized in that, include: A memory on which computer programs are stored; A processor for executing the computer program in the memory to implement the steps of the method according to any one of claims 1 to 7.