Artificial intelligence-based lesson generation method and interactive system

CN122596057APending Publication Date: 2026-08-18JD100 COM
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202610747887.3
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-05-28
Publication Date
2026-08-18

AI Technical Summary

Technical Problem

远远达不到准确的找到一个包含学生提供的部分信息的内容相似的完整课文

Benefits of technology

[0062]本发明实施例还提供了一种基于人工智能的课文生成方法及交互系统。

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122596057A_ABST
    Figure CN122596057A_ABST
Patent Text Reader

Abstract

This invention discloses an artificial intelligence-based text generation method and interactive system, relating to the field of computer technology. It utilizes a similarity discrimination network to detect keyword associations. By acquiring partial text paragraphs and similar text paragraphs, it detects keyword associations in three directions: the association between keywords in the partial text paragraphs and similar text paragraphs, the dependency relationship between keywords in similar text paragraphs, and the number of spaces between keywords in similar text paragraphs, thus obtaining keyword association feature vectors. It then constructs the network structure and acquires features of a semantic recognition network, and uses the text discrimination network to perform similarity ranking to obtain the generated text. This achieves the technical effect of more accurately finding texts with similar content and structure to user-provided sentences and generating complete texts.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of computer technology, and more specifically, to a text generation method and interactive system based on artificial intelligence. Background Technology

[0002] Because the text has a regularity in its context, it cannot be generated arbitrarily based on keywords; the integrity of the text must be maintained.

[0003] Early technologies relied primarily on pre-defined templates or rules, resulting in mechanical and inflexible content generation. With the emergence of deep learning models such as Recurrent Neural Networks (RNNs) and Transformers, relevance has been significantly improved, enabling the detection of texts that meet the requirements.

[0004] While early deep learning models could generate fluent text, they lacked precise control over the article's topic, required vocabulary, and structure (such as verses / choruses), making them impractical. They could only perform 1-to-1 matching or rely solely on the probability of keyword occurrences. This fell far short of accurately finding a complete text that contained partial information provided by a student.

[0005] The question is how to enable machines to automatically generate high-quality, highly relevant personalized texts based on specific input requirements. Summary of the Invention

[0006] The purpose of this invention is to provide an artificial intelligence-based text generation method and interactive system to solve the above-mentioned problems existing in the prior art.

[0007] In a first aspect, embodiments of the present invention provide an interactive method for generating texts based on artificial intelligence, comprising:

[0008] Obtain partial text paragraphs and p stored complete texts; the partial text paragraphs represent paragraph text information containing multiple keywords used to generate complete texts; the stored complete texts represent the text information of complete texts stored in the database;

[0009] Keyword matching is performed on the aforementioned text paragraphs to obtain a keyword sequence; the keyword sequence includes multiple text constraint keywords arranged in chronological order; the text constraint keywords represent keywords that must exist in the text.

[0010] Based on multiple text constraint keywords and p stored complete texts, q similar texts are obtained; the similar texts are stored complete texts that contain similar text paragraphs; the similar text paragraphs are paragraphs that are similar to some text paragraphs and contain multiple keywords;

[0011] By using a similarity discrimination network, based on multiple similar texts and keyword sequences, the association relationship of keywords is detected, and keyword association feature vectors are obtained;

[0012] Based on the associated feature vectors, a text discrimination network is used to generate a text; the generated text represents a stored complete text that is similar to similar text paragraphs.

[0013] Optionally, the step of detecting the association relationship of keywords based on multiple similar texts and keyword sequences through a similarity discrimination network to obtain a keyword association feature vector includes:

[0014] Keywords were extracted from the similar text paragraphs to obtain keyword values ​​and keyword counts;

[0015] Based on the keyword values ​​and keyword sequences, the association between keywords in some text paragraphs and similar text paragraphs is detected to obtain a first keyword feature vector; the first keyword feature vector represents the feature of the state in which keywords in similar text paragraphs appear in some text paragraphs.

[0016] Using a semantic recognition network, based on the similar text paragraphs and the first keyword feature vector, the semantic features of the similar text paragraphs are detected to obtain the second keyword feature vector; the second keyword feature vector represents the feature that records the dependency relationship of keywords in the similar text paragraphs to determine whether the similar text paragraphs are similar to some text paragraphs.

[0017] Based on the similar text paragraphs and keyword sequences, the overall correlation between keywords in the similar text paragraphs is determined, and a third keyword feature vector is obtained; the third keyword feature vector represents the feature that determines whether a similar text paragraph is similar to a partial text paragraph by the number of characters between the keywords in the similar text paragraphs.

[0018] The feature vectors of the first keyword, the second keyword, and the third keyword are input into a fully connected neural network for feature fusion to obtain the keyword association feature vector.

[0019] Optionally, the step of detecting the association between keywords in a portion of the text and similar text paragraphs based on the keyword values ​​and keyword sequences to obtain the first keyword feature vector includes:

[0020] Based on the keyword values, similar text paragraphs, and keyword sequences, multiple keyword matching values ​​are obtained; the keyword matching values ​​indicate whether the keywords in the similar text paragraphs appear in some text paragraphs.

[0021] Obtain a two-dimensional matrix; the columns of the two-dimensional matrix represent the keyword arrangement subscripts; the first row of the two-dimensional matrix represents the keywords; the second row represents whether the keywords in similar text paragraphs appear in some text paragraphs;

[0022] Following the order of keywords in similar text paragraphs, fill the first row of the two-dimensional matrix with the values ​​of multiple keywords and fill the second row of the two-dimensional matrix with the corresponding keyword matching values ​​to obtain the first keyword matrix;

[0023] Input the first keyword matrix into the first keyword feature network, extract the variation features of keywords in similar text paragraphs, and obtain the first keyword feature vector.

[0024] Optionally, the first keyword feature network includes a 2*1 two-dimensional convolutional kernel and a fully connected convolutional network;

[0025] In the two-dimensional convolution kernel, 2 corresponds to the row of the first keyword matrix, and 1 corresponds to the column of the first keyword matrix;

[0026] With a stride of 1, the two-dimensional convolution kernel is convolved with the first keyword matrix to obtain the first feature vector; each index of the first feature vector corresponds to one keyword.

[0027] The first feature vector is input into a fully connected convolutional network to obtain the first keyword feature vector.

[0028] Optionally, the step of detecting semantic features of similar text paragraphs through a semantic recognition network, based on the similar text paragraphs and the first keyword feature vector, to obtain the second keyword feature vector includes:

[0029] Encode multiple keywords in the similar text paragraphs into multiple similar text vectors;

[0030] Multiple similar text vectors are input into a multi-head attention mechanism to detect the correlation between the multiple similar text vectors and obtain multiple second attention feature vectors; the second attention feature vector is a vector that contains the dependency relationship features of multiple keywords in similar text paragraphs;

[0031] The second attention feature vector is fused with the corresponding values ​​in the first feature vector to obtain the second fused feature vector; the second fused feature vector represents a feature vector containing the dependency relationship of multiple keywords in similar text paragraphs and the similarity relationship between keywords in similar text paragraphs and some text paragraphs.

[0032] The second fused feature vector is input into the feedforward neural network for feature extraction to obtain the second feature vector; multiple similar text vectors correspond to multiple second feature vectors;

[0033] Multiple second feature vectors are input into the discriminative neural network to obtain the second keyword feature vector.

[0034] Optionally, the step of determining the overall correlation between keywords in similar text paragraphs to obtain a third keyword feature vector based on the similar text paragraphs includes:

[0035] Based on similar text paragraphs, obtain the number of characters between two adjacent keywords to get multiple interval lengths;

[0036] By sorting the multiple interval lengths, similarity vectors are obtained;

[0037] The first feature vector is input into the second convolutional network to obtain the second association vector; the second association vector represents the feature of the relationship between two adjacent keywords.

[0038] The second association vector is added to the similarity vector to obtain the second fusion vector;

[0039] The second fusion vector is input into the second fully connected neural network to obtain the third keyword feature vector.

[0040] Optionally, the second convolutional network contains 1*2 two-dimensional convolutional kernels.

[0041] Optionally, based on the keyword values, similar text paragraphs, and keyword sequences, multiple keyword matching values ​​are obtained, including:

[0042] Obtain initial matching values; each initial matching value corresponds to one keyword in a similar text paragraph; all initial matching values ​​are 0.

[0043] Extract one keyword from similar text paragraphs as the first keyword;

[0044] In the keyword sequence, check if the first keyword exists;

[0045] If it exists, set the initial matching value corresponding to the first keyword to 1; otherwise, set the initial matching value corresponding to the first keyword to 2 to obtain the keyword matching value.

[0046] Iterate through multiple keywords in similar text paragraphs to obtain multiple keyword matching values.

[0047] Optionally, the search based on multiple text constraint keywords and p stored complete texts yields q similar texts, including:

[0048] In p stored complete texts, determine whether all text constraint keywords exist;

[0049] If all the text constraint keywords exist, the stored complete text is taken as the first stored complete text;

[0050] Traverse the first complete text and check the length of the paragraph containing all the text's constraint keywords as the first keyword window;

[0051] If the length of the first keyword window is less than the length threshold, the paragraph corresponding to the first keyword window will be regarded as a similar text paragraph.

[0052] n first keyword windows correspond to m similar text paragraphs, where m is greater than or equal to 0, and less than or equal to n;

[0053] If m is greater than 1, the first complete text corresponding to the similar text paragraph is taken as the similar text;

[0054] For each p complete text stored, q similar texts are obtained, where q is greater than or equal to 0 and less than or equal to p.

[0055] Secondly, embodiments of the present invention provide an interactive text generation system based on artificial intelligence, comprising:

[0056] The acquisition module is used to acquire partial text paragraphs and p stored complete texts; the partial text paragraphs represent paragraph text information containing multiple keywords used to generate complete texts; the stored complete texts represent the text information of complete texts stored in the database.

[0057] The keyword extraction module is used to match keywords in the selected text paragraphs to obtain a keyword sequence; the keyword sequence includes multiple text constraint keywords arranged in chronological order; the text constraint keywords represent keywords that must exist in the text.

[0058] A text content matching model is used to obtain q similar texts based on multiple text constraint keywords and p stored complete texts; the similar texts are stored complete texts that contain similar text paragraphs; the similar text paragraphs are paragraphs that are similar to some text paragraphs and contain multiple keywords;

[0059] The keyword feature extraction module is used to detect the association between keywords based on multiple similar texts and keyword sequences through a similarity discrimination network, and obtain keyword association feature vectors.

[0060] The text generation module is used to generate texts based on associated feature vectors and through a text discrimination network; the generated texts represent stored complete texts that are similar to similar text paragraphs.

[0061] Compared with the prior art, the embodiments of the present invention achieve the following beneficial effects:

[0062] This invention also provides a text generation method and interactive system based on artificial intelligence.

[0063] In this invention, by detecting partial text paragraphs, the keywords and structure of these paragraphs can be directly obtained, thereby finding related complete texts. First, keyword sequences are detected from the provided partial text paragraphs, containing keywords and their connection structures. The keyword sequences are then used to find complete texts containing all the text's constraint keywords, resulting in similar texts. Next, the association between keywords is detected in three directions: the relationship between partial and similar text paragraphs, the dependency relationship between keywords in similar text paragraphs, and the number of characters between keywords in similar text paragraphs. Utilizing the special structure of the first keyword feature network, a first feature vector and a first keyword feature vector with special meaning are extracted. Then, a semantic recognition network is constructed based on the first feature vector, modifying the network structure and feature acquisition. This achieves a more accurate technical effect of finding texts similar to the provided sentence content and structure, and generating complete texts. Attached Figure Description

[0064] Figure 1 This is a flowchart of an interactive text generation method based on artificial intelligence provided in an embodiment of the present invention. Detailed Implementation

[0065] The present invention will now be described in detail with reference to the accompanying drawings.

[0066] This invention relates to an artificial intelligence-based text generation method and interactive system that uses user-provided content and structure to generate texts.

[0067] Example 1:

[0068] like Figure 1 As shown in the figure, this embodiment of the invention provides an interactive method for generating texts based on artificial intelligence, the method comprising:

[0069] S101: Obtain partial text paragraphs and p stored complete texts; the partial text paragraphs represent paragraph text information containing multiple keywords used to generate complete texts; the stored complete texts represent the text information of complete texts stored in the database.

[0070] In another embodiment, an AI-based interactive method for generating texts is used, which directly obtains multiple keywords from multiple parts of the text to replace some paragraphs of the text.

[0071] S102: Perform keyword matching on the aforementioned text paragraphs to obtain a keyword sequence; the keyword sequence includes multiple text constraint keywords arranged in chronological order; the text constraint keywords represent keywords that must exist in the text.

[0072] In this embodiment, the selected text paragraphs are matched with keywords stored in the database using the Aho-Corasick algorithm.

[0073] If one keyword appears before another keyword in a certain paragraph of the text, then the keyword with the higher or higher number is considered the same as the other keyword.

[0074] Using the method described above, because some text paragraphs are relatively short, matching is performed directly based on the word frequency of keywords stored in the database. If a method without word frequency analysis were used, and an algorithm automatically extracts keywords from some text paragraphs, errors would be more likely to occur due to the short length of some paragraphs.

[0075] S103: Based on multiple text constraint keywords and p stored complete texts, q similar texts are obtained; the similar texts are stored complete texts that contain similar text paragraphs; the similar text paragraphs are paragraphs that are similar to some text paragraphs and contain multiple keywords.

[0076] S104: Using a similarity discrimination network, based on multiple similar texts and keyword sequences, the association relationship of keywords is detected, and keyword association feature vectors are obtained.

[0077] Then, based on the associated feature vectors, a text discrimination network is used to generate the text; the generated text represents a stored complete text that is similar to similar text paragraphs. Specifically, see S105:

[0078] S105: Based on the associated feature vectors, the text discrimination network is used to sort similarity and generate the text.

[0079] In this embodiment, the text discrimination network is a fully connected neural network (FCNN).

[0080] In this process, the associated feature vectors are input into the text discrimination network to obtain similarity values. These similarity values ​​represent the degree of similarity between similar text paragraphs and the stored complete text. q similar texts correspond to q associated feature vectors. These q associated feature vectors correspond to q similarity values. The q similarity values ​​are then sorted, and the similar text with the highest similarity value is selected as the generated text.

[0081] Optionally, the step of detecting the association relationship of keywords based on multiple similar texts and keyword sequences through a similarity discrimination network to obtain a keyword association feature vector includes:

[0082] Keywords were extracted from the similar text paragraphs to obtain keyword values ​​and keyword counts.

[0083] The keyword count refers to the number of times the keyword corresponding to the keyword value appears in similar text paragraphs. One keyword value corresponds to one keyword count.

[0084] In this embodiment, TF-IDF is used to extract keywords from similar texts.

[0085] The keyword value refers to the numerical value of the keyword after being encoded using TF-IDF.

[0086] Based on the keyword values ​​and keyword sequences, the association between keywords in some text paragraphs and similar text paragraphs is detected to obtain a first keyword feature vector; the first keyword feature vector represents the feature of the state in which keywords in similar text paragraphs appear in some text paragraphs.

[0087] Using a semantic recognition network, based on the similar text paragraphs and the first keyword feature vector, the semantic features of the similar text paragraphs are detected to obtain the second keyword feature vector; the second keyword feature vector represents the feature that records the dependency relationship of keywords in the similar text paragraphs to determine whether the similar text paragraphs are similar to some text paragraphs.

[0088] Based on the similar text paragraphs and keyword sequences, the overall correlation between keywords in the similar text paragraphs is determined, resulting in a third keyword feature vector. The third keyword feature vector represents the feature that determines whether a similar text paragraph is similar to a partial text paragraph by the number of characters between the keywords in the similar text paragraphs.

[0089] The feature vectors of the first keyword, the second keyword, and the third keyword are input into a fully connected neural network (FCNN) for feature fusion to obtain the keyword association feature vector.

[0090] Optionally, the step of detecting the association between keywords in a portion of the text and similar text paragraphs based on the keyword values ​​and keyword sequences to obtain the first keyword feature vector includes:

[0091] Based on the keyword values, similar text paragraphs, and keyword sequences, multiple keyword matching values ​​are obtained; the keyword matching values ​​indicate whether the keywords in the similar text paragraphs appear in some text paragraphs.

[0092] Obtain a two-dimensional matrix; the columns of the two-dimensional matrix represent the keyword arrangement subscripts; the first row of the two-dimensional matrix represents the keywords; the second row represents whether the keywords in similar text paragraphs appear in some text paragraphs.

[0093] Using the methods described above, we can construct matrices to find the relationships between multiple keywords in similar text paragraphs and certain text paragraphs.

[0094] Following the order of keywords in similar text paragraphs, fill the first row of the two-dimensional matrix with the values ​​of multiple keywords and fill the second row of the two-dimensional matrix with the corresponding keyword matching values ​​to obtain the first keyword matrix;

[0095] Input the first keyword matrix into the first keyword feature network, extract the variation features of keywords in similar text paragraphs, and obtain the first keyword feature vector.

[0096] Using the above method, the keywords of the first keyword matrix and the features of whether they appear in certain paragraphs of the text are obtained through the structure and convolution method of the convolution kernel in the first keyword feature network targeting the first keyword matrix.

[0097] Optionally, the first keyword feature network includes a 2*1 two-dimensional convolutional kernel and a fully connected convolutional network (FCN).

[0098] In the two-dimensional convolution kernel, 2 corresponds to the row of the first keyword matrix, and 1 corresponds to the column of the first keyword matrix.

[0099] With a stride of 1, the two-dimensional convolution kernel is convolved with the first keyword matrix to obtain the first feature vector; each index of the first feature vector corresponds to one keyword.

[0100] Specifically, a 2D convolutional kernel is convolved with the first keyword matrix to obtain a 1*h*c feature map. Here, h represents the number of rows in the first keyword matrix, and c represents the number of channels in the 2*1 2D convolutional kernel of the first keyword feature network. The flatten() function in Python is then used to transform the feature map into a first feature vector.

[0101] The first feature vector is input into a fully connected convolutional network (FCN) to obtain the first keyword feature vector.

[0102] Optionally, the step of detecting semantic features of similar text paragraphs through a semantic recognition network, based on the similar text paragraphs and the first keyword feature vector, to obtain the second keyword feature vector includes:

[0103] In this embodiment, the semantic recognition network is a modified Transformer model.

[0104] Encode multiple keywords in the similar text paragraphs into multiple similar text vectors.

[0105] In this embodiment, multiple keywords are searched for the numerical values ​​corresponding to the stored words in the database to obtain similar text vectors.

[0106] Multiple similar text vectors are input into a multi-head attention mechanism to detect the correlation between them, resulting in multiple second attention feature vectors. The second attention feature vector is a vector containing the dependency features of multiple keywords in similar text paragraphs.

[0107] Using the above method, the second attention feature vector represents the importance of multiple keywords in similar text paragraphs for similar text paragraphs and partial text paragraphs in similarity discrimination.

[0108] The second attention feature vector is fused with the corresponding value in the first feature vector to obtain the second fused feature vector; the second fused feature vector represents a feature vector containing the dependency relationship of multiple keywords in similar text paragraphs and the similarity relationship between keywords in similar text paragraphs and some text paragraphs.

[0109] The second fused feature vector is input into a feedforward neural network (FFN) for feature extraction to obtain a second feature vector; multiple similar text vectors correspond to multiple second feature vectors.

[0110] Among them, one second feature vector corresponds to one keyword in a paragraph of the text;

[0111] Multiple second feature vectors are input into the discriminative neural network to obtain the second keyword feature vector; the second keyword feature vector is used to determine whether similar text paragraphs are similar to some text paragraphs.

[0112] The discriminant neural network is a fully connected neural network (FCNN).

[0113] In this embodiment, the characteristics of the second keyword feature vector are determined by the fact that during training, similar text paragraphs and some text paragraphs are labeled with a value of 1, while similar text paragraphs and some text paragraphs are labeled with a value of 0 if they differ from each other. In this embodiment, the overall meaning of the similarity or difference in the historical data of similar text paragraphs and some text paragraphs used for training is labeled by experts.

[0114] Optionally, the step of determining the overall correlation between keywords in similar text paragraphs and keyword sequences to obtain a third keyword feature vector includes:

[0115] Based on similar text paragraphs, obtain the number of characters between two adjacent keywords to get multiple interval lengths.

[0116] By sorting the multiple interval lengths, similarity vectors are obtained.

[0117] The number of elements in the similarity vector is equal to the number of keyword matching values ​​minus 1.

[0118] The first feature vector is input into the second convolutional network to obtain the second association vector; the second association vector represents the feature of the relationship between two adjacent keywords.

[0119] Using the above method, since similarity vectors represent the word count relationship between two adjacent keywords, the fusion process requires a relation-to-relationship representation to perform the addition and fusion.

[0120] The second correlation vector is fused with the similarity vector to obtain the second fused vector.

[0121] In this embodiment, fusion is performed by addition.

[0122] The second fusion vector is input into the second fully connected neural network to obtain the third keyword feature vector.

[0123] In this embodiment, the second fully connected neural network is a fully connected neural network (FCNN).

[0124] Optionally, the second convolutional network contains 1*2 two-dimensional convolutional kernels.

[0125] Optionally, based on the keyword values, similar text paragraphs, and keyword sequences, multiple keyword matching values ​​are obtained, including:

[0126] Obtain initial matching values; each initial matching value corresponds to one keyword in a similar text paragraph; all initial matching values ​​are 0.

[0127] Extract one keyword from similar text paragraphs as the first keyword.

[0128] In the keyword sequence, check if the first keyword exists.

[0129] The method uses Euclidean distance to calculate the similarity between keyword values ​​and the converted values ​​of keywords in certain text paragraphs. If the similarity value is 0, it is considered that a primary keyword exists. The association between the keywords and their converted values ​​in the selected text paragraphs is stored in a database.

[0130] If it exists, set the initial matching value corresponding to the first keyword to 1; otherwise, set the initial matching value corresponding to the first keyword to 2 to obtain the keyword matching value.

[0131] In this context, 1 indicates that a keyword in a similar text paragraph exists in both the similar text paragraph and some other text paragraphs. 2 indicates that a keyword in a similar text paragraph does not exist in the similar text paragraph, but exists in some other text paragraphs.

[0132] Iterate through multiple keywords in similar text paragraphs to obtain multiple keyword matching values.

[0133] The above method can be used to detect whether multiple keywords in similar text paragraphs appear in some text paragraphs.

[0134] Optionally, the search based on multiple text constraint keywords and p stored complete texts yields q similar texts, including:

[0135] In p stored complete texts, determine whether all text constraint keywords exist.

[0136] The process involves matching words from the complete text with keywords stored in the database to obtain multiple stored keywords. Euclidean distance is then used to determine if a stored keyword matches a keyword constrained by the text. If they match, the matching process stops, and the next stored keyword is compared to determine if it matches a keyword constrained by the text.

[0137] Among them, the positions of stored keywords that are the same as the keywords constrained in the text are retained.

[0138] If all the text constraint keywords exist, the stored complete text will be used as the first stored complete text.

[0139] Traverse the first complete text and check the length of the paragraph containing all the text's constraint keywords as the first keyword window.

[0140] If the length of the first keyword window is less than the length threshold, the paragraph corresponding to the first keyword window will be considered as a similar text paragraph.

[0141] In this embodiment, the length threshold is the number of text constraint keywords multiplied by 16. For example, if there are 5 text constraint keywords, then if 5 text constraint keywords appear in a paragraph of 80 characters, then this paragraph is considered a similar text paragraph.

[0142] Among them, the first complete text storage contains n paragraphs that contain all the text constraint keywords, and n first keyword windows are obtained.

[0143] n first keyword windows correspond to m similar text paragraphs, where m is greater than or equal to 0 and less than or equal to n.

[0144] Meanwhile, the above method compares the n first keyword windows. There are cases where the length of the first keyword window is greater than or equal to the length threshold. Therefore, m is greater than or equal to 0 and less than or equal to n.

[0145] If m is greater than 1, the first complete text corresponding to the similar text paragraph is taken as the similar text.

[0146] For each p complete text stored, q similar texts are obtained, where q is greater than or equal to 0 and less than or equal to p.

[0147] Where p, n, m, and q are positive integers.

[0148] Example 2:

[0149] Based on the above-described AI-based interactive text generation method, this embodiment of the invention also provides an AI-based interactive text generation system, the system comprising:

[0150] The acquisition module is used to acquire partial text paragraphs and p stored complete texts; the partial text paragraphs represent paragraph text information containing multiple keywords used to generate complete texts; the stored complete texts represent the text information of complete texts stored in the database.

[0151] The keyword extraction module is used to match keywords in the selected text paragraphs to obtain a keyword sequence; the keyword sequence includes multiple text constraint keywords arranged in chronological order; the text constraint keywords represent keywords that must exist in the text.

[0152] A text content matching model is used to obtain q similar texts based on multiple text constraint keywords and p stored complete texts; the similar texts are stored complete texts that contain similar text paragraphs; the similar text paragraphs are paragraphs that are similar to some text paragraphs and contain multiple keywords;

[0153] The keyword feature extraction module is used to detect the association between keywords based on multiple similar texts and keyword sequences through a similarity discrimination network, and obtain keyword association feature vectors.

[0154] The text generation module is used to generate texts based on associated feature vectors and through a text discrimination network; the generated texts represent stored complete texts that are similar to similar text paragraphs.

[0155] The algorithms and displays provided herein are not inherently related to any particular computer, virtual system, or other device. Various general-purpose systems can also be used in conjunction with the teachings herein. The required structure for constructing such systems is apparent from the above description. Furthermore, this invention is not directed to any particular programming language. It should be understood that the contents of the invention described herein can be implemented using various programming languages, and the above description of specific languages ​​is for the purpose of disclosing the best mode of implementation of the invention.

[0156] Numerous specific details are set forth in the specification provided herein. However, it will be understood that embodiments of the invention may be practiced without these specific details. In some instances, well-known methods, structures, and techniques have not been shown in detail so as not to obscure the understanding of this specification.

[0157] The various component embodiments of the present invention can be implemented in hardware, or as software modules running on one or more processors, or a combination thereof. Those skilled in the art will understand that microprocessors or digital signal processors (DSPs) can be used in practice to implement some or all of the functions of some or all of the components in the apparatus according to embodiments of the present invention. The present invention can also be implemented as a device or apparatus program (e.g., a computer program and computer program product) for performing part or all of the methods described herein. Such programs implementing the present invention can be stored on a computer-readable medium or can be in the form of one or more signals. Such signals can be downloaded from an Internet website, provided on a carrier signal, or provided in any other form.

Claims

1. An interactive method for generating texts based on artificial intelligence, characterized in that, include: Retrieve partial text paragraphs and store p complete texts; Keyword matching was performed on the aforementioned text paragraphs to obtain a keyword sequence; Based on multiple text constraint keywords and p stored complete texts, q similar texts are obtained; By using a similarity discrimination network, based on multiple similar texts and keyword sequences, the association relationship of keywords is detected, and keyword association feature vectors are obtained; Based on the associated feature vectors, the generated text is obtained through the text discrimination network.

2. The interactive text generation method based on artificial intelligence according to claim 1, characterized in that, The method involves using a similarity discrimination network to detect the association between keywords based on multiple similar texts and keyword sequences, thereby obtaining a keyword association feature vector, including: Keywords were extracted from the similar text paragraphs to obtain keyword values ​​and keyword counts; Based on the keyword values ​​and keyword sequences, the association between keywords in some text paragraphs and similar text paragraphs is detected to obtain a first keyword feature vector; the first keyword feature vector represents the feature of the state in which keywords in similar text paragraphs appear in some text paragraphs. Using a semantic recognition network, based on the similar text paragraphs and the first keyword feature vector, the semantic features of the similar text paragraphs are detected to obtain the second keyword feature vector; the second keyword feature vector represents the feature that records the dependency relationship of keywords in the similar text paragraphs to determine whether the similar text paragraphs are similar to some text paragraphs. Based on the similar text paragraphs and keyword sequences, the overall correlation between keywords in the similar text paragraphs is determined, and a third keyword feature vector is obtained; the third keyword feature vector represents the feature that determines whether a similar text paragraph is similar to a partial text paragraph by the number of characters between the keywords in the similar text paragraphs. The feature vectors of the first keyword, the second keyword, and the third keyword are input into a fully connected neural network for feature fusion to obtain the keyword association feature vector.

3. The interactive text generation method based on artificial intelligence according to claim 2, characterized in that, The step of detecting the association between keywords in a portion of the text and similar text paragraphs based on the keyword values ​​and keyword sequences, and obtaining a first keyword feature vector, includes: Based on the keyword values, similar text paragraphs, and keyword sequences, multiple keyword matching values ​​are obtained; the keyword matching values ​​indicate whether the keywords in the similar text paragraphs appear in some text paragraphs. Obtain a two-dimensional matrix; the columns of the two-dimensional matrix represent the keyword arrangement subscripts; the first row of the two-dimensional matrix represents the keywords; the second row represents whether the keywords in similar text paragraphs appear in some text paragraphs; Following the order of keywords in similar text paragraphs, fill the first row of the two-dimensional matrix with the values ​​of multiple keywords and fill the second row of the two-dimensional matrix with the corresponding keyword matching values ​​to obtain the first keyword matrix; Input the first keyword matrix into the first keyword feature network, extract the variation features of keywords in similar text paragraphs, and obtain the first keyword feature vector.

4. The interactive text generation method based on artificial intelligence according to claim 3, characterized in that, The first keyword feature network comprises a 2*1 two-dimensional convolutional kernel and a fully connected convolutional network; In the two-dimensional convolution kernel, 2 corresponds to the row of the first keyword matrix, and 1 corresponds to the column of the first keyword matrix; With a stride of 1, the two-dimensional convolution kernel is convolved with the first keyword matrix to obtain the first feature vector; each index of the first feature vector corresponds to one keyword. The first feature vector is input into a fully connected convolutional network to obtain the first keyword feature vector.

5. The interactive text generation method based on artificial intelligence according to claim 4, characterized in that, The step of using a semantic recognition network to detect the semantic features of similar text paragraphs based on the similar text paragraphs and the first keyword feature vector, and obtaining the second keyword feature vector, includes: Encode multiple keywords in the similar text paragraphs into multiple similar text vectors; Multiple similar text vectors are input into a multi-head attention mechanism to detect the correlation between the multiple similar text vectors and obtain multiple second attention feature vectors; the second attention feature vector is a vector that contains the dependency relationship features of multiple keywords in similar text paragraphs; The second attention feature vector is fused with the corresponding values ​​in the first feature vector to obtain the second fused feature vector; the second fused feature vector represents a feature vector containing the dependency relationship of multiple keywords in similar text paragraphs and the similarity relationship between keywords in similar text paragraphs and some text paragraphs. The second fused feature vector is input into the feedforward neural network for feature extraction to obtain the second feature vector; multiple similar text vectors correspond to multiple second feature vectors; Multiple second feature vectors are input into the discriminative neural network to obtain the second keyword feature vector.

6. The interactive text generation method based on artificial intelligence according to claim 4, characterized in that, Based on the similar text paragraphs, the overall correlation between keywords in the similar text paragraphs is determined to obtain the third keyword feature vector, including: Based on similar text paragraphs, obtain the number of characters between two adjacent keywords to get multiple interval lengths; By sorting the multiple interval lengths, similarity vectors are obtained; The first feature vector is input into the second convolutional network to obtain the second association vector; the second association vector represents the feature of the relationship between two adjacent keywords. The second association vector is added to the similarity vector to obtain the second fusion vector; The second fusion vector is input into the second fully connected neural network to obtain the third keyword feature vector.

7. The interactive text generation method based on artificial intelligence according to claim 6, characterized in that, The second convolutional network contains 1*2 two-dimensional convolutional kernels.

8. The interactive text generation method based on artificial intelligence according to claim 3, characterized in that, Based on the keyword values, similar text paragraphs, and keyword sequences, multiple keyword matching values ​​are obtained, including: Obtain initial matching values; each initial matching value corresponds to one keyword in a similar text paragraph; all initial matching values ​​are 0. Extract one keyword from similar text paragraphs as the first keyword; In the keyword sequence, check if the first keyword exists; If it exists, set the initial matching value corresponding to the first keyword to 1; otherwise, set the initial matching value corresponding to the first keyword to 2 to obtain the keyword matching value. Iterate through multiple keywords in similar text paragraphs to obtain multiple keyword matching values.

9. The interactive text generation method based on artificial intelligence according to claim 1, characterized in that, The method involves searching based on multiple text-constrained keywords and p stored complete texts to obtain q similar texts, including: In p stored complete texts, determine whether all text constraint keywords exist; If all the text constraint keywords exist, the stored complete text is taken as the first stored complete text; Traverse the first complete text and check the length of the paragraph containing all the text's constraint keywords as the first keyword window; If the length of the first keyword window is less than the length threshold, the paragraph corresponding to the first keyword window will be regarded as a similar text paragraph. n first keyword windows correspond to m similar text paragraphs, where m is greater than or equal to 0, and less than or equal to n; If m is greater than 1, the first complete text corresponding to the similar text paragraph is taken as the similar text; For each p complete text stored, q similar texts are obtained, where q is greater than or equal to 0 and less than or equal to p.

10. An interactive text generation system based on artificial intelligence, characterized in that, include: The acquisition module is used to acquire partial text paragraphs and p complete texts; The keyword extraction module is used to match keywords in the aforementioned text paragraphs to obtain a keyword sequence; A text content matching model is used to obtain q similar texts based on multiple text constraint keywords and p stored complete texts. The keyword feature extraction module is used to detect the association between keywords based on multiple similar texts and keyword sequences through a similarity discrimination network, and obtain keyword association feature vectors. The text generation module is used to generate texts based on associated feature vectors and a text discrimination network.