Content generation method based on artificial intelligence

Through multiple types of processing of user data and a multi-channel content generation mechanism, combined with subjective and objective evaluations, the problems of difficulty in understanding dialogue intentions and emotions and insufficient image data processing in the existing technology are solved, and efficient and accurate content generation is achieved. and corrections.

CN118797067AActive Publication Date: 2024-10-18YIMING UNIVERSAL TECH (BEIJING) CO LTD
View PDF 5 Cites 0 Cited by

Patent Information

Application Number
CN202411280564.5
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-09-13
Publication Date
2024-10-18
Estimated Expiration
2044-09-13

AI Technical Summary

Technical Problem

Existing content generation methods based on artificial intelligence are difficult to effectively understand the intentions and emotions of user conversations. In particular, they lack effective content verification mechanisms and correction mechanisms for image data. They are overly dependent on a single model and may fail to generate effective content due to local defects in the model. .

Method used

By obtaining the user's text, voice and image data, different types of data are processed to obtain intent and emotion categories, and the corresponding text data is generated by combining grammar analysis, speech recognition and image recognition models; then the data is fed into the content generation model , using a multi-channel generation mechanism (templates, rules, neural networks) and conducting subjective and objective evaluations to select the most matching content and make content corrections in subsequent conversations.

Benefits of technology

It improves the user's dialogue understanding ability during the content generation process, ensures the accuracy and correction performance of the generated content, prevents content generation failure due to local defects in the model, and improves resource utilization efficiency.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118797067A_ABST
    Figure CN118797067A_ABST
Patent Text Reader

Abstract

The invention discloses a content generation method based on artificial intelligence, and relates to the technical field of content generation. A content generation method based on artificial intelligence comprises the steps of obtaining dialogue data of a user, extracting an intention type, a keyword and an emotion type of the dialogue data, generating content according to the intention type, the keyword and the emotion type of the dialogue data, verifying and correcting the generated content, and recording historical behaviors of the user. And obtaining language habits, type preferences and mode preferences of the user. According to the method, the text data corresponding to the image data are generated after region division and name, verb and adjective analysis are carried out on the image data, detailed grammar analysis is carried out on the text data, keywords of phrases are extracted, intention analysis is carried out on the text according to the keywords, and the intention category of the text data is obtained; the text data is subjected to sentiment analysis through the dictionary, the detailed sentiment category of the text data is obtained, and the ability of understanding the dialogue of the user is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of content generation, and in particular to a content generation method based on artificial intelligence. Background Art

[0002] With the rapid development of the Internet and the popularization of informatization, users' demand for high-quality content is increasing. Traditional content creation methods usually rely on manual editing and creation. However, this method is not only time-consuming and labor-intensive, but the quality of creation is limited by the editor's personal ability and experience. In addition, in the face of large-scale content demand, traditional methods are difficult to achieve rapid response and efficient output.

[0003] Artificial intelligence technology, especially the development of deep learning-based natural language processing (NLP) and generative adversarial networks (GAN) and other methods, has provided new solutions for automatic content generation. By training models to understand and generate natural language text, artificial intelligence technology can generate a large amount of high-quality content in a short period of time, including but not limited to news articles, product descriptions, market reports, social media posts, etc.

[0004] At present, a variety of AI-based content generation methods have been proposed and applied, such as text generation methods based on recurrent neural networks (RNNs), natural language generation methods based on transformer models, etc. These methods have improved the efficiency and quality of text generation to a certain extent, but there are still some problems and challenges. They cannot effectively understand the intentions and emotions of user conversations, cannot effectively identify multiple types of conversations, and lack effective content verification and correction mechanisms, especially for image data. Content generation is overly dependent on a single model, which can easily lead to failure to generate effective content due to local defects in the model. Summary of the invention

[0005] The present invention provides a content generation method based on artificial intelligence, comprising: S1. Acquire user dialogue data, including three types of data: text, voice and image, perform different processing on each type of dialogue data, and obtain the intention and emotion category of the dialogue data; Text data: Perform grammatical analysis on the text data to obtain the intention category and keywords, and the grammatical analysis includes word class analysis, phrase analysis, sentence pattern analysis and intention analysis; Voice data: Use voice recognition technology to convert the voice data into text data; Image data: Send the image data into an image recognition model for content recognition, and the image recognition model is composed of 5 sub-units, namely, a first area division unit, a second noun acquisition unit, a third verb acquisition unit, a fourth adjective acquisition unit and a fifth text generation unit, and the image data is converted into text data after content recognition; Perform grammatical analysis on the converted text data to obtain the intention category; Perform text emotion analysis on the text data and the converted text data to obtain the emotion category of the dialogue data; S2.The text data, intent categories and emotion categories of the user conversation data are sent to the content generation model for content generation. The text data first enters the channel selection layer of the content generation model, and selects the appropriate channel of the content generation model for content generation according to the intent categories, keywords, emotion categories and conversation relevance of the user conversation data. The content generation model has three channels, namely the template content generation channel, the rule content generation channel and the neural network content generation channel. The three channels perform template matching generation, rule matching generation and neural network generation according to the intent categories and emotion categories of the user conversation data respectively. Template matching generation generates content by replacing variables with matching templates, and rule matching generates content by replacing variables with matching templates. The matching generation generates content through matching rules; the neural network generation generates content through a pre-trained neural network model; enters the content generation layer of the content generation model, generates 3 different contents, records the first generated content as the first content, obtains the intent category and emotion category of each first content, conducts subjective and objective evaluations on the first content, and obtains the subjective evaluation score and objective evaluation score of the first content. The subjective evaluation score is based on the matching score of the intent category and emotion category of the generated content and the user dialogue, and the objective evaluation score is based on the logic, accuracy and readability evaluation score of the generated content; the subjective evaluation score and the objective evaluation score are weighted and summed to obtain the comprehensive score of the first content Evaluation score, select the content with the highest comprehensive evaluation score of the first content to output, and save the first content in the content correction layer of the content generation model; after receiving the subsequent user dialogue, perform subjective and objective evaluations on the first content again to obtain a corrected evaluation score for the first content, the corrected evaluation score is obtained by weighted summation of the corrected subjective evaluation score and the corrected objective evaluation score, the corrected subjective evaluation score is based on the matching score of the intent category and the emotion category of the first content and the subsequent user dialogue, the corrected objective evaluation score is based on the logic, accuracy and readability evaluation score of the connection segment between the first content and the subsequent user dialogue, the comprehensive evaluation score of the first content and the corrected evaluation score are weighted Sum the results to get the corrected selection score; if the corrected selection score is consistent with the content corresponding to the comprehensive evaluation score of the first content, then the content generation channel is matched according to the subsequent user dialogue to generate content. In the continuous dialogue, the content generated by the content generation channel according to the subsequent user dialogue is called the second content; otherwise, the first content with the highest intention understanding error and correction score is output, and the content is generated according to the corrected first content. In the continuous dialogue, the content generated by the content generation according to the corrected first content is called the second content; S3. Record the historical behavior of each user and obtain the user's language habits, generation type preferences, and generation mode preferences. .

[0006] As a preferred technical solution of the present invention, it also includes grammatical analysis of text data to obtain intent categories and keywords; preprocessing of text, including text cleaning, data conversion, segmentation processing and word segmentation processing; text cleaning, removing redundant spaces and formatting marks; data conversion, marking emoticons mixed in the text and converting them into text type data for replacement; segmentation processing, dividing each paragraph into phrases; segmentation processing, dividing phrases into words; word class analysis, obtaining all possible word classes for each word, recording them as independent word classes, screening independent word classes according to phrase structure, and obtaining all possible word class combinations of words in each phrase. The related word classes are screened according to the sentence structure to obtain the part of speech of each word in the sentence, which is recorded as the part of speech of the sentence, and marked on each corresponding word; the phrase structure and sentence structure are both recorded in the grammar dictionary; phrase analysis, obtains the structural type of the phrase according to the part of speech tag of the word, and matches the keywords of the phrase in the grammar dictionary according to the structural type and the word; sentence pattern analysis, matches the sentence structure in the grammar dictionary according to the non-phrase part of the sentence, and obtains the sentence structure of the sentence; intention analysis, according to the keywords of the phrase and the sentence structure of the sentence, derives the intention category and keywords of the text through the syntactic rules in the grammar dictionary.

[0007] As a preferred technical solution of the present invention, it also includes sentiment analysis; by searching for sentiment-related words in the text data, the sentiment-related words of each sentiment retrieved are scored, the degree of each sentiment is determined according to the score range, and the score of the sentiment-related words is specifically recorded in the sentiment word area in the grammar dictionary. If the sentiment of a text data is mild sadness or moderate anger, it is recorded as E D ={S1, F2}.

[0008] As a preferred technical solution of the present invention, it also includes voice data conversion and image data conversion; the voice data is converted into text data through a pre-trained voice recognition model; the image data is converted into text data after content recognition in the image recognition model, and the image recognition model is composed of 5 sub-units, namely, a first area division unit, a second noun acquisition unit, a third verb acquisition unit, a fourth adjective acquisition unit and a fifth text generation unit; the first area division unit, through Mask R-CNN divides the objects in the image into regions, outputs the object's division mask, and passes the mask to the next sub-unit for object detection; the second noun acquisition unit, the third verb acquisition unit and the fourth adjective acquisition unit are constructed through a convolutional neural network. The three units correspond to different hidden layers in the convolutional neural network. The second noun acquisition unit is the hidden layer of the first three layers. By recognizing the division mask, the corresponding object recognition result, that is, the object noun, is obtained. The third verb acquisition unit is the hidden layer of the fifth to seventh layers. By recognizing the output of the second noun acquisition unit, the verb recognition result corresponding to the object is obtained. The fourth adjective acquisition unit is the hidden layer of the eighth to tenth layers. By recognizing the output of the third verb acquisition unit, the adjective recognition result of the object is obtained. The fourth hidden layer of the model is used to obtain the adjacent relationship between different regions. The hidden layers of the three units are connected by 3 fully connected layers; finally, the corresponding phrases of each region and the adjacent relationship between the regions are output; the fifth text generation unit generates text according to the adjacent relationship and phrases of the regions through grammar rules.

[0009] As a preferred technical solution of the present invention, the content generation model includes a channel selection layer, a content generation layer and a content correction layer; the channel selection layer is used to select a content generation channel according to the intention category, keywords, emotion category and conversation relevance of the user conversation data, obtain the user's intention category, if the category is a specific field, select the template content generation channel, calculate the complexity of the user conversation, if the complexity exceeds the set threshold and the intention category is not a specific field, select the rule content generation channel, if the complexity exceeds the set threshold, select the neural network content generation channel; the calculation formula of the complexity is: in the formula is the emotion weight, which is used to balance the impact of emotion on complexity. is the sum of the sentiment scores, with mild being 1 and moderate being 2. HT is the intention category score. is the sum of the keyword scores. The intent category scores and keyword scores are recorded in the grammar dictionary. n indicates that the current conversation is the nth consecutive conversation. Indicates the difference score between the intent category of the current conversation and the previous conversation, is the difference score between the keywords of the current conversation and the previous conversation. The difference score is obtained by the distance difference in the matrix. If the current conversation is the first conversation, the difference score is 0. This formula can be used to obtain the original complexity based on the intent category and keywords of the conversation data itself, and further evaluate the complexity based on the correlation between the emotion category and the conversation. The content generation layer is used to generate content based on the user's intent category and emotion category. In the template content generation channel, the template corresponding to the set intent category is used to replace the variables and value ranges in the template according to the keywords and emotion category to generate the corresponding content. In the rule content generation channel, the user's intent category and emotion category are used to match the rules in the rule library, and the corresponding content is generated according to the rule logic. In the neural network content generation channel, the user's intent category, emotion category, and keyword information are sent to the pre-trained neural network content generation model to generate content with higher complexity. The content correction layer is used to verify and correct the content according to the user's subsequent conversation.

[0010] As a preferred technical solution of the present invention, it also includes content verification and correction; content verification, grammar analysis and sentiment analysis are performed on the generated content to obtain the content category, keywords and sentiment category of each generated content, and calculate the subjective evaluation score. The formula for the subjective evaluation score is: in the formula is the emotional impact weight, represents the sum of the differences between the sentiment category score of each user conversation and the score of each sentiment category of the generated content, Respectively represent the association scores of the intent category and keywords between the user conversation text and the generated content, which are obtained through the association vector in the grammar dictionary; the formula can be used to obtain the subjective association between the generated content and the user conversation; objective evaluation score calculation, logic detection, accuracy detection and readability detection are performed on the generated content to obtain the objective evaluation score PO. The logic detection calculates the semantic similarity of adjacent sentences in the generated content to obtain the logic score. The accuracy detection calculates the accuracy rate of all verifiable facts in the generated content to obtain the accuracy score. The readability detection calculates the readability score of the generated content through the SMOG readability formula; The comprehensive evaluation score P = α1PS + α2PO, select the generated content output with the highest comprehensive evaluation score to complete content verification; content correction, after obtaining the user's subsequent conversation, obtain the intent category, keywords and emotion category of the subsequent conversation, and calculate the revised evaluation score. The calculation formula is: , where KS is the subjective evaluation part of the revised evaluation, and the calculation method is consistent with PS. KO is the objective evaluation part of the revised evaluation, which is obtained by scoring the logic detection, accuracy detection and readability detection of the connection segment between the first content and the user's subsequent dialogue; the sum of the revised selection score and the comprehensive evaluation score V=γ1P+γ2K is calculated. If the highest values ​​of V and P are the same content, continue to generate the second content. If the highest values ​​of V and P are not the same content, output the first content with the highest output intention misunderstanding error and the highest V value, and generate the second content based on the revised first content.

[0011] As a preferred technical solution of the present invention, it also includes user behavior analysis; obtaining the historical behavior of users, establishing a usage preference object for each user, the preference object including the user's language habits, type preferences, and mode preferences; detecting the user's language habits, and when generating content, preferably selecting the language corresponding to the language habits; detecting the user's type preferences, and when generating content, if the user's content type requirements are not detected, then generating the content type corresponding to the type preference; detecting the user's mode preferences, and when generating content, preferably selecting the content generation channel corresponding to the mode preference; language habits, type preferences, and mode preferences are obtained through the records to be modified, specifically, the initial weights of the three categories are consistent, and each time a historical behavior record is generated, the weight proportion of the category is increased.

[0012] The present invention has the following advantages: 1. The present invention generates text data corresponding to the image data after performing region division on the image data, analyzing the names, verbs and adjectives, and performing detailed grammatical analysis on the text data. After obtaining the correct word classes of the words in the text, the phrases in the text are obtained, and the keywords of the phrases are extracted. The text is analyzed for intent based on the keywords to obtain the intent categories of the text data. The text data is analyzed for sentiment through a dictionary to obtain the detailed sentiment categories of the text data, thereby improving the ability to understand user conversations during the content generation process.

[0013] 2. The present invention sets up a contextual verification and correction mechanism based on intent and emotion, and introduces subjective and objective divisions into the verification and correction mechanism. When generating content, the multiple generated contents are verified, and the content that best matches the intent and emotion is obtained for output. Based on subsequent conversations, the generated content is verified again and selectively corrected, thereby improving the accuracy of content generation and the content correction performance during the content generation process.

[0014] 3. The present invention sets up a multi-channel content generation model, in which the three channels are based on templates, rules and neural networks respectively, and calculates complexity to select a suitable channel. Through this multi-channel approach, the resource utilization capability is improved and the inability to generate effective content due to local defects of the model is prevented. BRIEF DESCRIPTION OF THE DRAWINGS

[0015] The preferred embodiments of the present invention will be further described in detail below with reference to the accompanying drawings, wherein: Figure 1 A flowchart of a method for generating content based on artificial intelligence used in an embodiment of the present invention; Figure 2 A workflow diagram of an artificial intelligence-based content generation method adopted in an embodiment of the present invention. DETAILED DESCRIPTION

[0016] In order to make the purpose, technical solution and advantages of the embodiments of the present invention clearer, the technical solution in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.

[0017] A content generation method based on artificial intelligence, see Figure 1 and Figure 2As shown, it includes: S1. Acquire the user's conversation data, including three types of data: text, voice and image, and perform different processing on each type of conversation data to obtain the intention and emotion category of the conversation data; Text data: Perform grammatical analysis on the text data to obtain the intention category and keywords. The grammatical analysis includes word class analysis, phrase analysis, sentence analysis and intention analysis; Voice data: Use voice recognition technology to convert voice data into text data; Image data: Send the image data to the image recognition model for content recognition. The image recognition model consists of 5 sub-units, namely the first area division unit, the second noun acquisition unit, the second noun classification ... The image data is converted into text data after content recognition; the converted text data is subjected to grammatical analysis to obtain the intent category; the text data and the converted text data are subjected to text sentiment analysis to obtain the sentiment category of the dialogue data; the text data is subjected to grammatical analysis to obtain the intent category and keywords; the text is preprocessed, including text cleaning, data conversion, section processing and word segmentation processing; text cleaning, removing redundant spaces and formatting marks; data conversion, marking the emoticons mixed in the text and converting it into text type data for processing. Line replacement; Section processing, divide each paragraph into phrases; Section processing, divide phrases into words; Part of speech analysis, obtain all possible parts of speech for each word, record them as independent parts of speech, filter independent parts of speech according to phrase structure, obtain all possible part of speech combinations of words in each phrase, record them as associated parts of speech, filter associated parts of speech according to sentence structure, obtain the part of speech of each word in the sentence, record them as sentence parts of speech, and add marks to each corresponding word; Both phrase structure and sentence structure are recorded in the grammar dictionary; Phrase analysis, obtain the structural type of the phrase according to the part of speech tag of the word, match the structure type and word in the grammar dictionary Keywords of phrases; sentence analysis, match the sentence structure in the grammar dictionary according to the non-phrase part of the sentence to obtain the sentence structure; intention analysis, according to the keywords of the phrase and the sentence structure, the grammatical rules in the grammar dictionary are used to obtain the intention category and keywords of the text; sentiment analysis: in the text data, by retrieving sentiment-related words, the scores of the sentiment-related words of each sentiment retrieved are superimposed, and the degree of each emotion is determined according to the score range. The score of the sentiment-related word is specifically recorded in the sentiment word area in the grammar dictionary. If the sentiment of a text data is mild sadness or moderate anger, it is recorded as E D={S1, F2}; voice data conversion and image data conversion; voice data is converted into text data through the pre-trained voice recognition model; image data is converted into text data after content recognition in the image recognition model. The image recognition model consists of 5 sub-units, namely the first area division unit, the second noun acquisition unit, the third verb acquisition unit, the fourth adjective acquisition unit and the fifth text generation unit; the first area division unit, through Mask R-CNN divides the objects in the image into regions, outputs the object's division mask, and passes the mask to the next sub-unit for object detection; the second noun acquisition unit, the third verb acquisition unit and the fourth adjective acquisition unit are constructed through a convolutional neural network. The three units correspond to different hidden layers in the convolutional neural network. The second noun acquisition unit is the hidden layer of the first three layers. By recognizing the division mask, the corresponding object recognition result, that is, the object noun, is obtained. The third verb acquisition unit is the hidden layer of the fifth to seventh layers. By recognizing the output of the second noun acquisition unit, the verb recognition result corresponding to the object is obtained. The fourth adjective acquisition unit is the hidden layer of the eighth to tenth layers. By recognizing the output of the third verb acquisition unit, the adjective recognition result of the object is obtained. The fourth hidden layer of the model is used to obtain the adjacent relationship between different regions. The hidden layers of the three units are connected by 3 fully connected layers; finally, the corresponding phrases of each region and the adjacent relationship of the region are output; the fifth text generation unit generates text according to the adjacent relationship and phrases of the region through grammar rules; S2. Send the text data, intent category and emotion category of the user dialogue data to the content generation In the model, content generation is carried out. The text data first enters the channel selection layer of the content generation model, and the appropriate channel of the content generation model is selected for content generation according to the intent category, keywords, emotion category, and conversation relevance of the user conversation data. The content generation model has three channels, namely the template content generation channel, the rule content generation channel, and the neural network content generation channel. The three channels perform template matching generation, rule matching generation, and neural network generation according to the intent category and emotion category of the user conversation data. Template matching generation generates content by replacing variables with matching templates, and rule matching generation generates content by matching rules. Neural network generation generates content through a pre-trained neural network model. Entering the content generation layer of the content generation model, three different contents are generated, and the first generated content is recorded as the first content. The intent category and emotion category of each first content are obtained, and the first content is subjectively and objectively evaluated to obtain the subjective evaluation score and objective evaluation score of the first content. The subjective evaluation score is based on the matching score of the intent category and emotion category of the generated content and the user conversation, and the objective evaluation score is based on the logic, accuracy, and readability evaluation score of the generated content.The subjective evaluation score and the objective evaluation score are weightedly summed to obtain the comprehensive evaluation score of the first content, the content with the highest comprehensive evaluation score of the first content is selected for output, and the first content is saved in the content correction layer of the content generation model; after receiving the subsequent user dialogue, the first content is again subjectively and objectively evaluated to obtain the revised evaluation score of the first content, and the revised evaluation score is obtained by weighted summing the revised subjective evaluation score and the revised objective evaluation score, the revised subjective evaluation score is based on the matching score of the intent category and the emotion category of the first content and the subsequent user dialogue, and the revised objective evaluation score is based on the logic, accuracy and readability evaluation score of the connection segment between the first content and the subsequent user dialogue, and the comprehensive evaluation score of the first content and the revised evaluation score are weighted summed to obtain the revised selection score; if the revised selection score is consistent with the content corresponding to the comprehensive evaluation score of the first content, the content generation channel is matched according to the subsequent user dialogue for content generation. Generation, in a continuous conversation, the content generated by matching the content generation channel with the subsequent user conversation is called the second content; otherwise, the first content with the highest intention understanding error and correction score is output, and content generation is performed based on the corrected first content. In a continuous conversation, the content generated based on the corrected first content is called the second content; the content generation model includes a channel selection layer, a content generation layer, and a content correction layer; the channel selection layer is used to select the content generation channel according to the intention category, keywords, emotion category, and conversation relevance of the user conversation data, obtain the user's intention category, if the category is a specific field, select the template content generation channel, calculate the complexity of the user conversation, if the complexity exceeds the set threshold and the intention category is not a specific field, select the rule content generation channel, if the complexity exceeds the set threshold, select the neural network content generation channel; the complexity calculation formula is:; in the formula is the emotion weight, which is used to balance the impact of emotion on complexity. is the sum of the sentiment scores, with mild being 1 and moderate being 2. HT is the intention category score. is the sum of the keyword scores. The intent category scores and keyword scores are recorded in the grammar dictionary. n indicates that the current conversation is the nth consecutive conversation. Indicates the difference score between the intent category of the current conversation and the previous conversation, is the difference score between the keywords of the current conversation and the previous conversation. The difference score is obtained by the distance difference in the matrix. If the current conversation is the first conversation, the difference score is 0. This formula can be used to obtain the original complexity based on the intent category and keywords of the conversation data itself, and further evaluate the complexity based on the correlation between the emotion category and the conversation. The content generation layer is used to generate content based on the user's intent category and emotion category. In the template content generation channel, the template corresponding to the set intent category is used to replace the variables and value ranges in the template according to the keywords and emotion category to generate the corresponding content. In the rule content generation channel, the user's intent category and emotion category are used to match the rules in the rule library, and the corresponding content is generated according to the rule logic. In the neural network content generation channel, the user's intent category, emotion category, and keyword information are sent to the pre-trained neural network content generation model to generate content with higher complexity. The content correction layer is used to verify and correct the content according to the user's subsequent conversation.

[0018] As a preferred technical solution of the present invention, it also includes content verification and correction; content verification, grammar analysis and sentiment analysis are performed on the generated content to obtain the content category, keywords and sentiment category of each generated content, and calculate the subjective evaluation score. The formula for the subjective evaluation score is: in the formula is the emotional impact weight, represents the sum of the differences between the sentiment category score of each user conversation and the score of each sentiment category of the generated content, Respectively represent the association scores between the user conversation text and the intent category and keywords of the generated content, which are obtained through the association vector in the grammar dictionary; the formula can be used to obtain the subjective association between the generated content and the user conversation; objective evaluation score calculation, logic detection, accuracy detection and readability detection are performed on the generated content to obtain the objective evaluation score PO. The logic detection obtains the logic score by calculating the semantic similarity of adjacent sentences in the generated content. The accuracy detection obtains the accuracy score by calculating the accuracy of all verifiable facts in the generated content. The readability detection calculates the readability score of the generated content through the SMOG readability formula; the comprehensive evaluation score P=α1PS+α2PO, selects the generated content with the highest comprehensive evaluation score to output and completes the content verification; content correction, after obtaining the user's subsequent conversation, obtains the intent category, keywords and emotion category of the subsequent conversation, and calculates the corrected evaluation score. The calculation formula is: , where KS is the subjective evaluation part of the revised evaluation, and the calculation method is consistent with PS. KO is the objective evaluation part of the revised evaluation, which is obtained by scoring the logic detection, accuracy detection and readability detection of the connection segment between the first content and the user's subsequent dialogue; the sum of the revised selection score and the comprehensive evaluation score V=γ1P+γ2K is calculated. If the highest values ​​of V and P are the same content, continue to generate the second content. If the highest values ​​of V and P are not the same content, output the first content with the highest output intention misunderstanding error and the highest V value, and generate the second content based on the revised first content.

[0019] S3. Record each user’s historical behavior and obtain the user’s language habits, generation type preferences, and generation mode preferences.

[0020] Obtain the user's historical behavior and establish a usage preference object for each user, which includes the user's language habits, type preferences, and mode preferences; detect the user's language habits, and when generating content, preferably select the language corresponding to the language habits; detect the user's type preferences, and when generating content, if the user's content type requirements are not detected, then generate the content type corresponding to the type preference; detect the user's mode preferences, and when generating content, preferably select the content generation channel corresponding to the mode preference; language habits, type preferences, and mode preferences are obtained through the records that need to be modified, specifically, the initial weights of the three categories are consistent, and each time a historical behavior record is generated, the weight proportion of that category is increased.

[0021] It should be understood by those skilled in the art that the modules or steps of the present invention described above can be implemented by a general-purpose computing device, they can be concentrated on a single computing device, or distributed on a network composed of multiple computing devices, and optionally, they can be implemented by a program code executable by a computing device, so that they can be stored in a storage device and executed by the computing device, and in some cases, the steps shown or described can be executed in a different order than that here, or they can be made into individual integrated circuit modules, or multiple modules or steps therein can be made into a single integrated circuit module for implementation. Thus, the present invention is not limited to any specific combination of hardware and software.

Claims

1. A content generation method based on artificial intelligence, characterized in that: include: S1. Obtain the user's conversation data, including three types of data: text, voice and image. Perform different processing on each type of conversation data to obtain the intent and emotion category of the conversation data; Text data: Perform grammatical analysis on the text data to obtain the intent category and keywords. The grammatical analysis includes word class analysis, phrase analysis, sentence pattern analysis and intent analysis; Voice data: Use voice recognition technology to convert the voice data into text data; Image data: Send the image data to the image recognition model for content recognition. The image recognition model consists of 5 sub-units, namely the first area division unit, the second noun acquisition unit, the third verb acquisition unit, the fourth adjective acquisition unit and the fifth text generation unit. The image data is converted into text data after content recognition; Perform grammatical analysis on the converted text data to obtain the intent category; Perform text emotion analysis on the text data and the converted text data to obtain the emotion category of the conversation data; S2. Send the text data, intent category and emotion category of the user conversation data into the content generation model for content generation. The text data first enters the channel selection layer of the content generation model, and selects the appropriate channel of the content generation model for content generation according to the intent category, keywords, emotion category and conversation relevance of the user conversation data. The content generation model has three channels, namely, the template content generation channel, the rule content generation channel and the neural network content generation channel. The three channels perform template matching generation, rule matching generation, and neural network generation respectively according to the intent category and emotion category of the user conversation data; template matching generation generates content by replacing variables with matching templates, rule matching generation generates content by matching rules; neural network generation generates content by using a pre-trained neural network model; Enter the content generation layer of the content generation model, generate 3 different contents, record the first generated content as the first content, obtain the intent category and emotion category of each first content, conduct subjective and objective evaluations on the first content, and obtain the subjective evaluation score and objective evaluation score of the first content. The subjective evaluation score is based on the matching score of the intent category and emotion category of the generated content and the user dialogue, and the objective evaluation score is based on the logic, accuracy and readability evaluation score of the generated content; weighted sum of the subjective evaluation score and the objective evaluation score to obtain the comprehensive evaluation score of the first content, select the content with the highest comprehensive evaluation score of the first content for output, and save the first content in the content correction layer of the content generation model; after receiving subsequent user dialogues, conduct subjective evaluation on the first content again and objective evaluation to obtain a revised evaluation score of the first content, the revised evaluation score is obtained by weighted summing the revised subjective evaluation score and the revised objective evaluation score, the revised subjective evaluation score is based on the matching score of the intent category and the emotion category of the first content and the subsequent user dialogue, the revised objective evaluation score is based on the logic, accuracy and readability evaluation score of the connection segment between the first content and the subsequent user dialogue, the comprehensive evaluation score of the first content and the revised evaluation score are weighted summed to obtain a revised selection score; if the revised selection score is consistent with the content corresponding to the comprehensive evaluation score of the first content, then content generation is performed according to the subsequent user dialogue matching content generation channel, and in the continuous dialogue, the content generated according to the subsequent user dialogue matching content generation channel is called the second content; Otherwise, the first content with the highest intention understanding error and correction score is output, and content generation is performed based on the corrected first content. In the continuous dialogue, the content generated based on the corrected first content is called the second content; S3. Record each user’s historical behavior and obtain the user’s language habits, generation type preferences, and generation mode preferences.

2. A method for generating content based on artificial intelligence according to claim 1, characterized in that: It also includes grammatical analysis of text data to obtain intent categories and keywords; preprocessing of text, including text cleaning, data conversion, segmentation and word segmentation; text cleaning, removing extra spaces and formatting marks; data conversion, marking emoticons mixed in the text and converting them into text type data for replacement; segmentation, dividing each paragraph into phrases; Segment processing, dividing phrases into words; word class analysis, obtaining all possible word classes for each word, recording them as independent word classes, screening independent word classes according to phrase structure, obtaining all possible word class combinations of words in each phrase, recording them as associated word classes, screening associated word classes according to sentence structure, obtaining the word class of each word in the sentence, recording them as sentence word classes, and adding marks to each corresponding word; phrase structure and sentence structure are recorded in the grammar dictionary; Phrase analysis: Get the structure type of the phrase according to the part-of-speech tag of the word, and match the keywords of the phrase in the grammar dictionary according to the structure type and the word; sentence analysis: Match the sentence structure in the grammar dictionary according to the non-phrase part of the sentence to get the sentence structure; intention Analysis, based on the keywords of the phrases and the sentence structure, the text's intention category and keywords are obtained through the syntactic rules in the grammar dictionary.

3. A method for generating content based on artificial intelligence according to claim 1, characterized in that: It also includes sentiment analysis; by searching for sentiment-related words in the text data, the scores of the sentiment-related words of each sentiment retrieved are superimposed, and the degree of each emotion is determined according to the score range. The scores of the sentiment-related words are specifically recorded in the sentiment word area in the grammar dictionary. If the sentiment of a text data is mild sadness or moderate anger, it is recorded as E D ={S1, F2}.

4. A method for generating content based on artificial intelligence according to claim 1, characterized in that: It also includes voice data conversion and image data conversion; voice data is converted into text data through a pre-trained voice recognition model; image data is converted into text data after content recognition in an image recognition model. The image recognition model consists of five sub-units, namely the first area division unit, the second noun acquisition unit, the third verb acquisition unit, the fourth adjective acquisition unit and the fifth text generation unit; the first area division unit, through Mask R-CNN divides the objects in the image into regions, outputs the object's division mask, and passes the mask to the next sub-unit for object detection; the second noun acquisition unit, the third verb acquisition unit, and the fourth adjective acquisition unit are constructed through a convolutional neural network. The three units correspond to different hidden layers in the convolutional neural network. The second noun acquisition unit is the hidden layer of the first three layers. By recognizing the division mask, the corresponding object recognition result, that is, the object noun, is obtained. The third verb acquisition unit is the hidden layer of the fifth to seventh layers. By recognizing the output of the second noun acquisition unit, the corresponding verb recognition result of the object is obtained. The fourth adjective acquisition unit is the hidden layer of the eighth to tenth layers. By recognizing the output of the third verb acquisition unit, the adjective recognition result of the object is obtained. The fourth hidden layer of the model is used to obtain the adjacent relationship between different regions. The hidden layers of the three units are connected through 3 fully connected layers; finally, the corresponding phrase of each region and the adjacent relationship between the region are output; The fifth text generation unit generates text according to the adjacent relationship of regions and phrases through grammar rules.

5. A method for generating content based on artificial intelligence according to claim 1, characterized in that: The content generation model includes a channel selection layer, a content generation layer, and a content correction layer; the channel selection layer is used to select a content generation channel based on the intent category, keywords, emotion category, and conversation relevance of the user conversation data, obtain the user's intent category, and if the category is a specific domain, select the template content generation channel, calculate the complexity of the user conversation, and if the complexity exceeds the set threshold and the intent category is not a specific domain, select the rule content generation channel; if the complexity exceeds the set threshold, select the neural network content generation channel; The calculation formula for complexity is: in the formula is the emotion weight, which is used to balance the impact of emotion on complexity. is the sum of the sentiment scores, with mild being 1 and moderate being 2. HT is the intention category score. is the sum of the keyword scores. The intent category scores and keyword scores are recorded in the grammar dictionary. n indicates that the current conversation is the nth consecutive conversation. Indicates the difference score between the intent category of the current conversation and the previous conversation, is the difference score between the keywords of the current conversation and the previous conversation. The difference score is obtained by the distance difference in the matrix. If the current conversation is the first conversation, the difference score is 0. This formula can be used to obtain the original complexity based on the intent category and keywords of the conversation data itself, and further evaluate the complexity based on the correlation between the emotional category and the conversation. The content generation layer is used to generate content based on the user's intent category and emotional category. In the template content generation channel, the template corresponding to the set intent category is used to replace the variables and value ranges in the template according to the keywords and emotional categories to generate the corresponding content. In the rule content generation channel, the user's intent category and emotional category are used to match the rules in the rule library, and the corresponding content is generated according to the rule logic. In the neural network content generation channel, the user's intent category and emotional category, as well as keyword information, are sent to the pre-trained neural network content generation model to generate content with higher complexity. The content correction layer is used to verify and correct the content based on the user's subsequent conversations.

6. A method for generating content based on artificial intelligence according to claim 5, characterized in that: It also includes content verification and correction; content verification, grammar analysis and sentiment analysis of the generated content, obtain the content category, keywords and sentiment category of each generated content, calculate the subjective evaluation score, the formula for the subjective evaluation score is: in the formula is the emotional impact weight, represents the sum of the differences between the sentiment category score of each user conversation and the score of each sentiment category of the generated content, Respectively represent the association scores of the intent category and keywords between the user conversation text and the generated content, which are obtained through the association vector in the grammar dictionary; the formula can be used to obtain the subjective association between the generated content and the user conversation; objective evaluation score calculation, logic detection, accuracy detection and readability detection are performed on the generated content to obtain the objective evaluation score PO, logic detection calculates the semantic similarity of adjacent sentences in the generated content to obtain the logic score, accuracy detection calculates the accuracy rate of all verifiable facts in the generated content to obtain the accuracy score, and readability detection calculates the readability score of the generated content through the SMOG readability formula; comprehensive evaluation score P=α1PS+α2PO, select the generated content with the highest comprehensive evaluation score for output, and complete content verification; Content correction: After obtaining the user's subsequent conversation, obtain the intent category, keywords, and sentiment category of the subsequent conversation, and calculate the correction evaluation score. The calculation formula is: , where KS is the subjective evaluation part of the revised evaluation, and the calculation method is consistent with PS. KO is the objective evaluation part of the revised evaluation, which is obtained by scoring the logic detection, accuracy detection and readability detection of the connection segment between the first content and the user's subsequent dialogue; the sum of the revised selection score and the comprehensive evaluation score V=γ1P+γ2K is calculated. If the highest values ​​of V and P are the same content, continue to generate the second content. If the highest values ​​of V and P are not the same content, output the first content with the highest output intention misunderstanding error and the highest V value, and generate the second content based on the revised first content.

7. A method for generating content based on artificial intelligence according to claim 1, characterized in that: It also includes user behavior analysis; obtaining the user's historical behavior, establishing a usage preference object for each user, the preference object including the user's language habits, type preferences, and mode preferences; detecting the user's language habits, and when generating content, preferably selecting the language corresponding to the language habits; detecting the user's type preferences, and when generating content, if the user's content type requirements are not detected, then generating the content type corresponding to the type preference; detecting the user's mode preferences, and when generating content, preferably selecting the content generation channel corresponding to the mode preference; language habits, type preferences, and mode preferences are obtained through the records to be modified, specifically, the initial weights of the three categories are consistent, and each time a historical behavior record is generated, the weight proportion of that category is increased.

Citation Information

Patent Citations

  • Reply content generation method of dialogue robot and terminal device

    CN109977212A

  • Method and apparatus for dialogue based on recommended verbal skill

    CN115640386A

  • Initial dialogue content generation method and device, medium and computing equipment

    CN116414965A

  • Emotion-guided dialogue content generation method based on crowd intelligence strategy

    CN117668208A

  • Dialog device

    JP2007264229A