A content generation method based on artificial intelligence

By processing and analyzing multiple data types, combining grammar and sentiment analysis, selecting appropriate content generation channels, the problems of difficulty in dialogue intention and emotional understanding and insufficient content verification in the existing technology are solved, and high accuracy and correction are achieved Performance content generation.

CN118797067BActive Publication Date: 2024-12-13YIMING UNIVERSAL TECH (BEIJING) CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

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

AI Technical Summary

Technical Problem

Existing artificial intelligence-based content generation methods are difficult to effectively understand the intention and emotions of user conversations, especially lacking an effective content verification mechanism for image data, and relying too much on a single model, it is easy to fail to generate effective content due to local defects of the model.

Method used

Using multiple data types (text, speech, image) for processing, convert image data into text data through image recognition model, and combine grammatical analysis and sentiment analysis to obtain the intention and emotional categories of dialogue data, and select appropriate content generation channels ( Template, rules, neural networks) generate content, and introduce subjective and objective evaluation mechanisms in the process of content generation and correction to ensure the accuracy and readability of the content.

Benefits of technology

It improves user dialogue comprehension ability and content generation accuracy during content generation. Through the use of multi-channel models, content generation failure caused by local defects of the model is avoided, and content correction performance is enhanced.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118797067B_ABST
    Figure CN118797067B_ABST
Patent Text Reader

Abstract

The present 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 includes: obtaining user conversation data, extracting intent type, keywords and emotion type of the conversation data, generating content according to the intent type, keywords and emotion type of the conversation data, verifying and correcting the generated content, recording the user's historical behavior, and obtaining the user's language habits, type preferences and mode preferences. The present invention divides the image data into regions, generates text data corresponding to the image data after analyzing the name, verb and adjective, and performs detailed grammar analysis on the text data, extracts the keywords of the phrases, and performs intent analysis on the text according to the keywords to obtain the intent category of the text data, performs sentiment analysis on the text data through a dictionary, and obtains the detailed sentiment category of the text data, thereby improving the ability to understand the user's conversation.
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) and natural language generation methods based on transformer models. 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] A content generation method based on artificial intelligence, comprising:

[0006] 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 intention and emotion category of the conversation data.

[0007] Text data: Perform grammatical analysis on text data to obtain intent categories and keywords. Grammar analysis includes word class analysis, phrase analysis, sentence pattern analysis, and intent analysis.

[0008] Voice data: Use speech recognition technology to convert voice data into text data;

[0009] Image data: The image data is sent to the image recognition model for content recognition. 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 image data is converted into text data after content recognition;

[0010] Perform grammatical analysis on the converted text data to obtain the intent category; perform text sentiment analysis on the text data and the converted text data to obtain the sentiment category of the conversation data;

[0011] S2. Send the text data, intent category and sentiment category of the user conversation data into the content generation model for content generation;

[0012] The steps for content generation using a content generation model include:

[0013] The text data first enters the channel selection layer of the content generation model, which selects the appropriate channel from the three channels of the content generation model for content generation based on the intent category, keywords, sentiment category, and conversation relevance of the user conversation data;

[0014] The content generation model has three channels, namely template content generation channel, rule content generation channel and 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 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 pre-trained neural network models;

[0015] Enter the content generation layer of the corresponding channel of the content generation model, generate 3 different contents, record the 3 contents generated for the first time as the first contents, obtain the intention category and emotion category of each first content, conduct subjective and objective evaluation on each first content, and obtain the subjective evaluation score PS and objective evaluation score PO of each first content. The subjective evaluation score is based on the matching score of the intention category and emotion category of each first content and the user dialogue, and the objective evaluation score is based on the logic, accuracy and readability evaluation score of each first content; the subjective evaluation score and the objective evaluation score are weighted and summed to obtain the comprehensive evaluation score P of each first content. The calculation formula is: P = α 1 PS+α 2 PO; select the content with the highest comprehensive evaluation score among the three first contents for output, and save the three first contents in the content correction layer of the content generation model;

[0016] After receiving the subsequent user dialogue, each first content is again evaluated subjectively and objectively to obtain a modified evaluation score K of each first content. The modified evaluation score K is obtained by weighted summing the modified subjective evaluation score KS and the modified objective evaluation score KO. The calculation formula is: K = β 1 KS+β 2 KO; the subjective evaluation score is modified based on the matching score of the intent category and the emotion category of each first content and the subsequent user dialogue, and the objective evaluation score is modified based on the logic, accuracy and readability evaluation score of the connection segment between each first content and the subsequent user dialogue; the comprehensive evaluation score and the modified evaluation score of each first content are weighted and summed to obtain the modified selection score;

[0017] If the first content with the highest correction selection score is the same as the first content with the highest comprehensive evaluation score, content generation is performed according to the subsequent user dialogue matching content generation channel. 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 correction selection score and the intention misunderstanding error is output, and content generation is performed according to the first content with the highest correction selection score. The generated content is called the second content;

[0018] The content generation model includes a channel selection layer, a content generation layer, and a content correction layer;

[0019] The channel selection layer is used to select content generation channels based on the intent category, keywords, emotion category, and conversation relevance of the user conversation data. The intent category of the user conversation data is obtained. If the category is a specific domain, the template content generation channel is selected. The complexity of the user conversation is calculated. If the complexity exceeds the set threshold and the intent category is not a specific domain, the rule content generation channel is selected. If the complexity exceeds the set threshold, the neural network content generation channel is selected.

[0020] The calculation formula for complexity is:

[0021] In the formula, θ is the emotion weight, which is used to balance the impact of emotion on complexity, ∑e i represents the sum of the scores of i emotions, HT is the intent category score, ∑H j represents the sum of j keyword scores. The intent category score and keyword score are recorded in the grammar dictionary. n represents the current nth consecutive conversation. diff(HT) represents the difference score between the intent category of the current conversation and the previous conversation. j) is the difference score between the keywords of the current conversation and the previous conversation. The difference score between the intent category and the keyword is obtained by the distance difference in the matrix. If the current conversation is the first conversation, the difference score is recorded as 0. The original complexity is obtained according to the intent category and keywords of the conversation data itself through this formula, and the complexity is further evaluated according to the correlation between the emotion category and the conversation.

[0022] The content generation layer is used to generate content based on the user's intention category and emotion category. In the template content generation channel, the template corresponding to the set intention category is used to replace the variables and value ranges in the template according to the keywords and emotion categories to generate the corresponding content. In the rule content generation channel, the user's intention 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 intention category and emotion category, as well as keyword information, are fed into the pre-trained neural network content generation model to generate content with higher complexity.

[0023] The content correction layer is used to verify and correct the content based on the user's subsequent conversations;

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

[0025] As a preferred technical solution of the present invention, it also includes performing grammatical analysis on the text data to obtain the intent category and keywords;

[0026] Preprocess the text, including text cleaning, data conversion, segmentation and word segmentation; text cleaning, remove extra spaces and formatting marks; data conversion, mark emoticons mixed in the text and convert them into text type data for replacement; segmentation, divide each paragraph into phrases; segmentation, divide phrases into words;

[0027] Part of speech analysis: obtain all possible parts of speech for each word and record these parts of speech as independent parts of speech. Filter the independent parts of speech according to the phrase structure to obtain all possible part of speech combinations of the words in each phrase, record them as associated parts of speech. Filter the associated parts of speech according to the sentence structure to obtain the part of speech of each word in the sentence, record them as the part of speech of the sentence, and add a mark to each corresponding word. Both the phrase structure and the sentence structure are recorded in the grammar dictionary.

[0028] Phrase analysis: obtaining the structural type of a phrase based on the part-of-speech tag of a word, and matching the key words of the phrase in the grammar dictionary based on the structural type and the word;

[0029] Sentence analysis: Match the sentence structure in the grammar dictionary based on the non-phrase part of the sentence to obtain the sentence structure;

[0030] Intent analysis, based on the keywords of the phrases and the sentence structure, derives the intent category and keywords of the text through the syntactic rules in the grammar dictionary.

[0031] As a preferred technical solution of the present invention, sentiment analysis is also included;

[0032] In the text data, emotion-related words are retrieved, and the scores of emotion-related words of each emotion are superimposed. The degree of each emotion is determined according to the score range. The scores of emotion-related words are specifically recorded in the emotion word area in the grammar dictionary. If the emotion of a text data is mild sadness or moderate anger, it is recorded as E D ={S1, F2}.

[0033] As a preferred technical solution of the present invention, it also includes voice data conversion and image data conversion;

[0034] The speech data is converted into text data through a pre-trained speech recognition model;

[0035] The image data is converted into text data after content recognition in the 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;

[0036] The first region division unit divides the objects in the image into regions using Mask R-CNN, outputs the object division mask, and passes the mask to the next sub-unit for object detection;

[0037] 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 identifying the partition 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 identifying 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 identifying 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;

[0038] The fifth text generation unit generates text according to the adjacent relationship of regions and phrases through grammar rules.

[0039] As a preferred technical solution of the present invention, it also includes content verification and correction;

[0040] 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 the subjective evaluation score is calculated. The calculation formula of the subjective evaluation score PS is:

[0041] PS=(1+θ 1 ∑(e Di -e Gi ))(CNT(HT)+CNT(H j ))

[0042] In the formula, θ 1 is the emotional influence weight, ∑(e Di -e Gi ) represents the sum of the differences between each emotion category score of the user dialogue and each emotion category score of the generated content, CNT(HT), CNT(H j ) 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 subjective association between the generated content and the user conversation is obtained through this formula;

[0043] Objective evaluation score calculation: perform logic detection, accuracy detection and readability detection 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 readability formula SMOG.

[0044] Comprehensive evaluation score P = α 1 PS+α 2 PO, selects the generated content output with the highest comprehensive evaluation score and completes content verification;

[0045] Content modification: After obtaining the user's subsequent conversation, obtain the intent category, keywords, and sentiment category of the subsequent conversation, and calculate the modified evaluation score. The calculation formula is: K = β 1 KS+β 2 KO, 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;

[0046] The sum of the modified evaluation score and the comprehensive evaluation score is calculated as the modified selection score V, and the calculation formula is: V = γ 1 P+γ 2K, if the highest values ​​of V and P are the same content, then continue to generate the second content. If the highest values ​​of V and P are not the same content, then output the first content with the highest intention misunderstanding error and V value, and generate content based on the first content with the highest correction selection score. The generated content is called the second content.

[0047] As a preferred technical solution of the present invention, it also includes user behavior analysis;

[0048] Obtain the user's historical behavior and create a usage preference object for each user. The preference object includes the user's language habits, type preferences, and mode preferences.

[0049] Detect the user's language habits and select the language corresponding to the language habits when generating content; detect the user's type preference and generate the content type corresponding to the type preference if the user's content type requirement is not detected when generating content; detect the user's mode preference and select the content generation channel corresponding to the mode preference when generating content;

[0050] Language habits, type preferences, and mode preferences are obtained through the records that need to be modified. Specifically, the initial weights of various categories of the three are consistent. Every time a historical behavior record is generated, the weight ratio of the category to which the record belongs is increased.

[0051] The present invention has the following advantages:

[0052] 1. The present invention generates text data corresponding to the image data after dividing the image data into regions, 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.

[0053] 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.

[0054] 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

[0055] The preferred embodiments of the present invention will be further described in detail below with reference to the accompanying drawings, wherein:

[0056] Figure 1 A flowchart of a method for generating content based on artificial intelligence used in an embodiment of the present invention;

[0057] Figure 2 A workflow diagram of an artificial intelligence-based content generation method adopted in an embodiment of the present invention. DETAILED DESCRIPTION

[0058] 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.

[0059] A content generation method based on artificial intelligence, see Figure 1 and Figure 2 As shown, including:

[0060] 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 intention and emotion category of the conversation data.

[0061] Text data: Perform grammatical analysis on text data to obtain intent categories and keywords. Grammar analysis includes word class analysis, phrase analysis, sentence pattern analysis, and intent analysis.

[0062] Voice data: Use speech recognition technology to convert voice data into text data;

[0063] Image data: The image data is sent to the image recognition model for content recognition. 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 image data is converted into text data after content recognition;

[0064] Perform grammatical analysis on the converted text data to obtain the intent category; perform text sentiment analysis on the text data and the converted text data to obtain the sentiment category of the conversation data;

[0065] Perform grammatical analysis on text data to obtain intent categories and keywords;

[0066] Preprocess the text, including text cleaning, data conversion, segmentation and word segmentation; text cleaning, remove extra spaces and formatting marks; data conversion, mark emoticons mixed in the text and convert them into text type data for replacement; segmentation, divide each paragraph into phrases; segmentation, divide phrases into words;

[0067] Part of speech analysis: obtain all possible parts of speech for each word and record these parts of speech as independent parts of speech. Filter the independent parts of speech according to the phrase structure to obtain all possible part of speech combinations of the words in each phrase, record them as associated parts of speech. Filter the associated parts of speech according to the sentence structure to obtain the part of speech of each word in the sentence, record them as the part of speech of the sentence, and add a mark to each corresponding word. Both the phrase structure and the sentence structure are recorded in the grammar dictionary.

[0068] Phrase analysis: obtaining the structural type of a phrase based on the part-of-speech tag of a word, and matching the key words of the phrase in the grammar dictionary based on the structural type and the word;

[0069] Sentence analysis: Match the sentence structure in the grammar dictionary based on the non-phrase part of the sentence to obtain the sentence structure;

[0070] Intent analysis, based on the keywords of the phrases and the sentence structure, derives the intent category and keywords of the text through the syntactic rules in the grammar dictionary.

[0071] Sentiment analysis;

[0072] In the text data, emotion-related words are retrieved, and the scores of emotion-related words of each emotion are superimposed. The degree of each emotion is determined according to the score range. The scores of emotion-related words are specifically recorded in the emotion word area in the grammar dictionary. If the emotion of a text data is mild sadness or moderate anger, it is recorded as E D ={S1, F2}.

[0073] Voice data conversion and image data conversion;

[0074] The speech data is converted into text data through a pre-trained speech recognition model;

[0075] The image data is converted into text data after content recognition in the 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;

[0076] The first region division unit divides the objects in the image into regions using Mask R-CNN, outputs the object division mask, and passes the mask to the next sub-unit for object detection;

[0077] 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 identifying the partition 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 identifying 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 identifying 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;

[0078] The fifth text generation unit generates text according to the adjacent relationship of regions and phrases through grammar rules.

[0079] S2. The text data, intent category and emotion category 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 the appropriate channel among the three channels of the content generation model is selected according to the intent category, keywords, emotion category and conversation relevance of the user conversation data for content generation.

[0080] The content generation model has three channels, namely template content generation channel, rule content generation channel and 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 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 pre-trained neural network models;

[0081] Enter the content generation layer of the corresponding channel of the content generation model, generate 3 different contents, record the 3 contents generated for the first time as the first contents, obtain the intention category and emotion category of each first content, conduct subjective and objective evaluation on each first content, and obtain the subjective evaluation score PS and objective evaluation score PO of each first content. The subjective evaluation score is based on the matching score of the intention category and emotion category of each first content and the user dialogue, and the objective evaluation score is based on the logic, accuracy and readability evaluation score of each first content; the subjective evaluation score and the objective evaluation score are weighted and summed to obtain the comprehensive evaluation score P of each first content, and the calculation formula is P = α 1 PS+α 2PO; select the content with the highest comprehensive evaluation score among the three first contents for output, and save the three first contents in the content correction layer of the content generation model;

[0082] After receiving the subsequent user dialogue, each first content is again evaluated subjectively and objectively to obtain a modified evaluation score K of each first content. The modified evaluation score K is obtained by weighted summing the modified subjective evaluation score KS and the modified objective evaluation score KO. The calculation formula is: K = β 1 KS+β 2 KO; the subjective evaluation score is modified based on the matching score of the intent category and the emotion category of each first content and the subsequent user dialogue, and the objective evaluation score is modified based on the logic, accuracy and readability evaluation score of the connection segment between each first content and the subsequent user dialogue; the comprehensive evaluation score and the modified evaluation score of each first content are weighted and summed to obtain the modified selection score;

[0083] If the first content with the highest correction selection score is the same as the first content with the highest comprehensive evaluation score, content generation is performed according to the subsequent user dialogue matching content generation channel. 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 correction selection score and the intention misunderstanding error is output, and content generation is performed according to the first content with the highest correction selection score. The generated content is called the second content;

[0084] The content generation model includes a channel selection layer, a content generation layer, and a content correction layer;

[0085] The channel selection layer is used to select content generation channels based on the intent category, keywords, emotion category, and conversation relevance of the user conversation data. The intent category of the user conversation data is obtained. If the category is a specific domain, the template content generation channel is selected. The complexity of the user conversation is calculated. If the complexity exceeds the set threshold and the intent category is not a specific domain, the rule content generation channel is selected. If the complexity exceeds the set threshold, the neural network content generation channel is selected.

[0086] The calculation formula for complexity is:

[0087] In the formula, θ is the emotion weight, which is used to balance the impact of emotion on complexity, ∑e i represents the sum of the scores of i emotions, HT is the intent category score, ∑H j represents the sum of j keyword scores. The intent category score and keyword score are recorded in the grammar dictionary. n represents the current nth consecutive conversation. diff(HT) represents the difference score between the intent category of the current conversation and the previous conversation. j) is the difference score between the keywords of the current conversation and the previous conversation. The difference score between the intent category and the keyword is obtained by the distance difference in the matrix. If the current conversation is the first conversation, the difference score is recorded as 0. The original complexity is obtained according to the intent category and keywords of the conversation data itself through this formula, and the complexity is further evaluated according to the correlation between the emotion category and the conversation.

[0088] The content generation layer is used to generate content based on the user's intention category and emotion category. In the template content generation channel, the template corresponding to the set intention category is used to replace the variables and value ranges in the template according to the keywords and emotion categories to generate the corresponding content. In the rule content generation channel, the user's intention 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 intention category and emotion category, as well as keyword information, are fed into the pre-trained neural network content generation model to generate content with higher complexity.

[0089] The content correction layer is used to verify and correct the content based on the user's subsequent conversations.

[0090] Content verification and correction;

[0091] 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 the subjective evaluation score is calculated. The formula for the subjective evaluation score is:

[0092] PS=(1+θ 1 ∑(e Di -e Gi ))(CNT(HT)+CNT(H j ))

[0093] In the formula, θ 1 is the emotional influence weight, ∑(e Di -e Gi ) represents the sum of the differences between each emotion category score of the user dialogue and each emotion category score of the generated content, CNT(HT), CNT(H j ) 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 subjective association between the generated content and the user conversation is obtained through this formula;

[0094] Objective evaluation score calculation: perform logic detection, accuracy detection and readability detection 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 readability formula SMOG.

[0095] Comprehensive evaluation score P = α 1 PS+α 2 PO, selects the generated content output with the highest comprehensive evaluation score and completes content verification;

[0096] Content modification: After obtaining the user's subsequent conversation, obtain the intent category, keywords, and sentiment category of the subsequent conversation, and calculate the modified evaluation score. The calculation formula is: K = β 1 KS+β 2 KO, 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;

[0097] Calculate the sum of the modified evaluation score and the comprehensive evaluation score as the modified selection score V = γ 1 P+γ 2 K, if the highest values ​​of V and P are the same content, then continue to generate the second content. If the highest values ​​of V and P are not the same content, then output the first content with the highest intention misunderstanding error and V value, and generate content based on the first content with the highest correction selection score. The generated content is called the second content.

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

[0099] User behavior analysis;

[0100] Obtain the user's historical behavior and create a usage preference object for each user. The preference object includes the user's language habits, type preferences, and mode preferences.

[0101] Detect the user's language habits and select the language corresponding to the language habits when generating content; detect the user's type preference and generate the content type corresponding to the type preference if the user's content type requirement is not detected when generating content; detect the user's mode preference and select the content generation channel corresponding to the mode preference when generating content;

[0102] Language habits, type preferences, and mode preferences are obtained through the records that need to be modified. Specifically, the initial weights of various categories of the three are consistent. Every time a historical behavior record is generated, the weight ratio of the category to which the record belongs is increased.

[0103] 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, It is 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 intention and emotion category of the conversation data. Text data: Perform grammatical analysis on text data to obtain intent categories and keywords. Grammar analysis includes word class analysis, phrase analysis, sentence pattern analysis, and intent analysis. Voice data: Use speech recognition technology to convert voice data into text data; Image data: The image data is sent to the image recognition model for content recognition. 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 image data is converted into text data after content recognition; Perform grammar analysis on the converted text data to obtain the intent category; perform text sentiment analysis on the text data and the converted text data to obtain the sentiment category of the conversation data; S2. Send the text data, intent category and sentiment category of the user conversation data into the content generation model for content generation; The steps for content generation using a content generation model include: The text data first enters the channel selection layer of the content generation model, which selects the appropriate channel from the three channels of the content generation model for content generation based on the intent category, keywords, sentiment 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 respectively 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, rule matching generation generates content by matching rules; neural network generation generates content by pre-trained neural network models; enter the content generation layer of the corresponding channel of the content generation model, generate three different contents, record the first three contents generated as the first contents, obtain the intent category and emotion category of each first content, perform subjective and objective evaluation on each first content, and obtain the subjective evaluation score PS and objective evaluation score PO of each first content, the subjective evaluation score is based on the matching score of the intent category and emotion category of each first content with the user conversation, and the objective evaluation score is based on the logic, accuracy and readability evaluation score of each first content; the subjective evaluation score and the objective evaluation score are weighted and summed to obtain the comprehensive evaluation score P of each first content, and the calculation formula is: P = α 1 PS+α 2 PO; select the content with the highest comprehensive evaluation score among the three first contents for output, and save the three first contents in the content correction layer of the content generation model; After receiving the subsequent user dialogue, each first content is again evaluated subjectively and objectively to obtain a modified evaluation score K of each first content. The modified evaluation score K is obtained by weighted summing the modified subjective evaluation score KS and the modified objective evaluation score KO. The calculation formula is: K = β 1 KS+β 2 KO; the subjective evaluation score is modified based on the matching score of the intent category and the emotion category of each first content and the subsequent user dialogue, and the objective evaluation score is modified based on the logic, accuracy and readability evaluation score of the connection segment between each first content and the subsequent user dialogue; the comprehensive evaluation score and the modified evaluation score of each first content are weighted and summed to obtain the modified selection score; If the first content with the highest correction selection score is the same as the first content with the highest comprehensive evaluation score, content generation is performed according to the subsequent user dialogue matching content generation channel. 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 correction selection score and the intention misunderstanding error is output, and content generation is performed according to the first content with the highest correction selection score. The generated 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 content generation channels based on the intent category, keywords, emotion category, and conversation relevance of the user conversation data. The intent category of the user conversation data is obtained. If the category is a specific domain, the template content generation channel is selected. The complexity of the user conversation is calculated. If the complexity exceeds the set threshold and the intent category is not a specific domain, the rule content generation channel is selected. If the complexity exceeds the set threshold, the neural network content generation channel is selected. The calculation formula for complexity is: In the formula, θ is the emotion weight, which is used to balance the impact of emotion on complexity, ∑e i represents the sum of the scores of i emotions, HT is the intent category score, ∑H j represents the sum of j keyword scores. The intent category score and keyword score are recorded in the grammar dictionary. n represents the current nth consecutive conversation. diff(HT) represents the difference score between the intent category of the current conversation and the previous conversation. j ) is the difference score between the keywords of the current conversation and the previous conversation. The difference score between the intent category and the keyword is obtained by the distance difference in the matrix. If the current conversation is the first conversation, the difference score is recorded as 0. The original complexity is obtained according to the intent category and keywords of the conversation data itself through this formula, and the complexity is further evaluated according to the correlation between the emotion category and the conversation. The content generation layer is used to generate content based on the user's intention category and emotion category. In the template content generation channel, the template corresponding to the set intention category is used to replace the variables and value ranges in the template according to the keywords and emotion categories to generate the corresponding content. In the rule content generation channel, the user's intention 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 intention category and emotion category, as well as keyword information, are fed into 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; 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, It is characterized in that It also includes grammatical analysis of text data to obtain intent categories and keywords; Preprocess the text, including text cleaning, data conversion, section processing and word segmentation; text cleaning, removing extra spaces and formatting marks; Data conversion: marking the emoticons mixed in the text and converting them into text data for replacement; segmentation processing: dividing each paragraph into phrases; Segmentation processing, dividing phrases into words; Part of speech analysis: obtain all possible parts of speech for each word and record these parts of speech as independent parts of speech. Filter the independent parts of speech according to the phrase structure to obtain all possible part of speech combinations of the words in each phrase, record them as associated parts of speech. Filter the associated parts of speech according to the sentence structure to obtain the part of speech of each word in the sentence, record them as the part of speech of the sentence, and add a mark to each corresponding word. Both the phrase structure and the sentence structure are recorded in the grammar dictionary. Phrase analysis: obtaining the structural type of a phrase based on the part-of-speech tag of a word, and matching the key words of the phrase in the grammar dictionary based on the structural type and the word; Sentence analysis: Match the sentence structure in the grammar dictionary based on the non-phrase part of the sentence to obtain the sentence structure; Intent analysis, based on the keywords of the phrase and the sentence structure, derives the intent category and keywords of the text through the syntactic rules in the grammar dictionary.

3. A method for generating content based on artificial intelligence according to claim 1, It is 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, It is characterized in that It also includes voice data conversion and image data conversion; The speech data is converted into text data through a pre-trained speech recognition model; The image data is converted into text data after content recognition in the 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 region division unit divides the objects in the image into regions using Mask R-CNN, outputs the object 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 identifying the partition 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 identifying 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 identifying 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, It is characterized in that 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 the subjective evaluation score is calculated. The calculation formula of the subjective evaluation score PS is: PS=(1+θ 1 ∑(e Di -e Gi ))(CNT(HT)+CNT(H j )) In the formula, θ 1 is the emotional influence weight, ∑(e Di -e Gi ) represents the sum of the differences between each emotion category score of the user dialogue and each emotion category score of the generated content, CNT(HT), CNT(H j ) 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 subjective association between the generated content and the user conversation is obtained through this formula; Objective evaluation score calculation: perform logic detection, accuracy detection and readability detection 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 readability formula SMOG. Comprehensive evaluation score P = α 1 PS+α 2 PO, selects the generated content output with the highest comprehensive evaluation score and completes 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: K = β 1 KS+β 2 KO, 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 test, accuracy test and readability test of the connection segment between the first content and the user's subsequent dialogue; The sum of the modified evaluation score and the comprehensive evaluation score is calculated as the modified selection score V, and the calculation formula is: V = γ 1 P+γ 2 K, if the highest values ​​of V and P are the same content, then continue to generate the second content. If the highest values ​​of V and P are not the same content, then output the first content with the highest intention misunderstanding error and V value, and generate content based on the first content with the highest correction selection score. The generated content is called the second content.

6. A method for generating content based on artificial intelligence according to claim 1, It is characterized in that It also includes user behavior analysis; Obtain the user's historical behavior and create a usage preference object for each user. The preference object includes the user's language habits, type preferences, and mode preferences. Detect the user's language habits and select the language corresponding to the language habits when generating content; detect the user's type preference and generate the content type corresponding to the type preference if the user's content type requirement is not detected when generating content; detect the user's mode preference and select the content generation channel corresponding to the mode preference when generating content; Language habits, type preferences, and mode preferences are obtained through the records that need to be modified. Specifically, the initial weights of various categories of the three are consistent. Every time a historical behavior record is generated, the weight ratio of the category to which the record belongs is increased.