Data processing method and device for text generation, equipment and storage medium
By entering the pending text information into the extraction model and analysis model, extracting topic and emotional information, and combining video association information to generate target text, the problem of inefficient browsing and analyzing text is solved, and more efficient text information processing is achieved.
Patent Information
- Application Number
- CN202311577536.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2023-11-23
- Publication Date
- 2025-05-23
AI Technical Summary
In the era of big data, users need to spend a lot of time browsing and analyzing a large amount of text information, resulting in low browsing and analysis efficiency.
By obtaining the pending text information and inputting it into the first extraction model and the second analysis model respectively, the subject information and emotional tendency information are extracted, and the target text information is generated based on the video association information.
Improves the efficiency of browsing and analyzing texts, allowing users to understand the main content and emotional tendencies of the pending text information more quickly.
Smart Images

Figure CN120030191A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of text processing, and in particular to a data processing method, apparatus, device and storage medium for text generation. Background Art
[0002] With the advent of the big data era, people will post various text information on the Internet to express their views and opinions. Users can view these text information on the Internet as a reference for their own views and opinions. However, the amount of these text information is too large, and users need to spend a lot of time browsing these text information. Therefore, the efficiency of browsing and analyzing text is low. Summary of the invention
[0003] The present application provides a data processing method, apparatus, device and storage medium for text generation, aiming to solve the technical problem of low accuracy of film reviews.
[0004] In one aspect, the present application provides a data processing method for text generation, the method comprising:
[0005] Get the text information to be processed;
[0006] Inputting the text information to be processed into a first extraction model to obtain first text information, and inputting the text information to be processed into a second analysis model to obtain second text information;
[0007] Target text information is generated according to the first text information and the second text information.
[0008] In some embodiments of the present application, the step of inputting the text information to be processed into a first extraction model to obtain first text information, and inputting the text information to be processed into a second analysis model to obtain second text information comprises:
[0009] Inputting the to-be-processed text information into a first extraction model, and obtaining the first text information including subject information;
[0010] The text information to be processed is input into a second analysis model, and the obtained second text information includes sentiment tendency information.
[0011] In some embodiments of the present application, the obtaining of text information to be processed includes:
[0012] Acquire real-time comment information of a target video to be analyzed, wherein the real-time comment information includes the real-time comment information of the target video;
[0013] The real-time comment information is used as the text information to be processed.
[0014] In some embodiments of the present application, generating target text information according to the first text information and the second text information includes:
[0015] Obtaining video associated information associated with the target video;
[0016] Sorting the video association information, the subject information and the emotional tendency information to generate a plurality of combination sequences;
[0017] Inputting each of the combined sequences into a language generation model to obtain hidden layer features of each of the combined sequences;
[0018] The target text information is obtained according to the fusion result of the hidden layer features of each of the combined sequences.
[0019] In some embodiments of the present application, the inputting the to-be-processed text information into a second analysis model, and obtaining the second text information including sentiment tendency information, includes:
[0020] Extracting word features in the text information to be processed and time sequence information between each of the word features through the memory network in the second analysis model;
[0021] According to the preset word weight corresponding to the word feature and the time sequence information thereof, the word feature is weighted to obtain a semantic feature;
[0022] The semantic features are input into the activation layer of the second analysis model to obtain the sentiment tendency information.
[0023] In some embodiments of the present application, the inputting of the to-be-processed text information into the first extraction model, and the obtained first text information including subject information, include:
[0024] Based on the text information to be processed being input into the first extraction model, a plurality of topic networks corresponding to the text information to be processed are obtained, wherein the topic networks are composed of a plurality of corresponding keywords;
[0025] The topic information is determined according to the keywords in the topic network and the connection relationships corresponding to the keywords.
[0026] In some embodiments of the present application, after the first extraction model is input based on the text information to be processed to obtain multiple topic networks corresponding to the text information to be processed, the method further includes:
[0027] Calculating the stationary probability value corresponding to each keyword in each topic network, and arranging the keywords based on the stationary probability value;
[0028] The topic network is updated according to a preset number of arranged keywords as core nodes of the topic network.
[0029] On the other hand, the present application provides a data processing device for text generation, the data processing device for text generation comprising:
[0030] An acquisition module is used to acquire text information to be processed;
[0031] A processing module, used for inputting the text information to be processed into a first extraction model to obtain first text information, and inputting the text information to be processed into a second analysis model to obtain second text information;
[0032] A generating module is used to generate target text information according to the first text information and the second text information.
[0033] On the other hand, the present application further provides a data processing device for text generation, the data processing device for text generation comprising:
[0034] one or more processors;
[0035] Memory; and
[0036] One or more applications, wherein the one or more applications are stored in the memory and configured to be executed by the processor to implement the steps of the data processing method for text generation.
[0037] On the other hand, the present application also provides a computer-readable storage medium having a computer program stored thereon, wherein the computer program is loaded by a processor to execute the steps in the data processing method for text generation.
[0038] The technical solution of the embodiment of the present application includes: obtaining text information to be processed; inputting the text information to be processed into the first extraction model to obtain the first text information, inputting the text information to be processed into the second analysis model to obtain the second text information; generating target text information according to the first text information and the second text information. In this way, the text information to be processed that needs to be analyzed is input into the first extraction model and the second analysis model respectively for processing, the important first text information is extracted, and the analysis result of the text information to be processed is obtained as the second text information, so that the target text information generated according to the first text information and the second text information can summarize the text information to be processed and improve the efficiency of browsing and analyzing texts. BRIEF DESCRIPTION OF THE DRAWINGS
[0039] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings required for use in the description of the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative work.
[0040] Figure 1 It is a schematic diagram of an embodiment of a data processing method for text generation provided in an embodiment of the present application;
[0041] Figure 2 It is a flow chart of an embodiment in which the text information to be processed in the data processing method for text generation provided in the embodiment of the present application is real-time comment information;
[0042] Figure 3 A schematic diagram of an embodiment of a flow chart of a second analysis model for extracting sentiment tendency information in a data processing method for text generation provided in an embodiment of the present application;
[0043] Figure 4 It is a schematic flow chart of an embodiment of extracting topic information by a first extraction model in a data processing method for text generation provided in an embodiment of the present application;
[0044] Figure 5 It is a specific scenario diagram of an embodiment of analyzing sentiment tendency information in a data processing method for text generation provided in an embodiment of the present application;
[0045] Figure 6 It is a schematic diagram of the architecture of a second analysis model of an embodiment of the data processing method for text generation provided in the embodiments of the present application;
[0046] Figure 7 It is a schematic diagram of the architecture of a first extraction model of an embodiment of a data processing method for text generation provided in an embodiment of the present application;
[0047] Figure 8 It is a schematic diagram of the structure of an embodiment of a data processing device for text generation provided in an embodiment of the present application;
[0048] Fig. 9 It is a schematic diagram of the structure of an embodiment of a data processing device for text generation provided in an embodiment of the present application. DETAILED DESCRIPTION
[0049] The following will be combined with the drawings in the embodiments of the present application to clearly and completely describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative work are within the scope of the present invention.
[0050] In the description of the present invention, it should be understood that the terms "center", "longitudinal", "lateral", "length", "width", "thickness", "up", "down", "front", "back", "left", "right", "vertical", "horizontal", "top", "bottom", "inside", "outside" and the like indicate positions or positional relationships based on the positions or positional relationships shown in the accompanying drawings, which are only for the convenience of describing the present invention and simplifying the description, rather than indicating or implying that the device or element referred to must have a specific orientation, be constructed and operated in a specific orientation, and therefore cannot be understood as limiting the present invention. In addition, the terms "first" and "second" are only used for descriptive purposes, and cannot be understood as indicating or implying relative importance or implicitly indicating the number of technical features indicated. Therefore, the features defined as "first" and "second" may explicitly or implicitly include one or more of the features. In the description of the present invention, the meaning of "multiple" is two or more, unless otherwise clearly and specifically defined.
[0051] In this application, the word "exemplary" is used to mean "serving as an example, illustration, or illustration." Any embodiment described in this application as "exemplary" is not necessarily to be construed as being preferred or advantageous over other embodiments. The following description is given to enable any person skilled in the art to implement and use the invention. In the following description, details are listed for the purpose of explanation. It should be understood that a person of ordinary skill in the art can recognize that the invention can be implemented without using these specific details. In other instances, well-known structures and processes are not elaborated in detail to avoid obscuring the description of the invention with unnecessary details. Therefore, the present invention is not intended to be limited to the embodiments shown, but is consistent with the widest scope consistent with the principles and features disclosed in this application.
[0052] Users browse text messages posted by other netizens on the Internet as a reference for their own views and opinions. However, the amount of text messages is too large, and users need to spend a lot of time browsing these text messages. Therefore, the efficiency of browsing and analyzing texts is low.
[0053] Based on this, a data processing method, apparatus, device, and storage medium for text generation in an embodiment of the present application are proposed. Hereinafter, through specific exemplary solutions, the content claimed in the claims of the present invention will be explained and illustrated so that those skilled in the art can better understand the protection scope of the claims of the present invention. It can be understood that the following exemplary solutions do not limit the protection scope of the present invention and are only used to explain the present invention.
[0054] As Figure 1 shown, Figure 1 FIG. is a schematic flowchart of an embodiment of a data processing method for text generation in an embodiment of the present application. The data processing method includes the following steps 101 to 103:
[0055] 101. Obtain text information to be processed;
[0056] In this embodiment, first, the text information to be processed is obtained. The text information to be processed responds to the user's selection operation, and the type of the text information to be analyzed is determined according to the user's selection operation, including the published software, published object, publication time, targeted event or object, etc. For example, the user can select the real-time comment information of a certain video as the text information to be processed. After determining the type of the text information to be analyzed, the corresponding text information to be processed is obtained by means of crawling or the like.
[0057] Optionally, after obtaining the text information to be processed, preprocess the text information to be processed. First, divide the continuous text in the text information to be processed into multiple words, and then perform stop word filtering: remove common words that usually do not carry actual meanings from the words, such as "de", "shi", "zai", etc. These words are not important for most natural language processing tasks. Remove special characters, punctuation marks, HTML tags, etc. in the text to clean the text, and convert the text into a unified case form to achieve standardization for further processing. Finally, use the Skip-Gram model to map the words in the text to real number vectors in a high-dimensional space to capture the semantic information of the words. Finally, perform subsequent operations based on the preprocessed text information to be processed.
[0058] 102. Input the text information to be processed into a first extraction model to obtain first text information, and input the text information to be processed into a second analysis model to obtain second text information;
[0059] In the present application, the acquired text information to be processed is input into the first extraction model, and the first extraction model extracts the first text information to be extracted from the text information to be processed according to the extraction parameters and algorithms trained and set in advance. The first text information can be the text content that has appeared in the text to be processed, or can be mapped according to the text content with the same semantics that appears repeatedly in the text to be processed. The main content of the text information to be processed can be understood based on the first text information, so that the user can understand the text information to be processed.
[0060] The acquired text information to be processed is also input into the second analysis model. The second analysis model can perform statistical analysis on the content of the text information to be processed based on the pre-trained and set analysis parameters and algorithms, and obtain the overall views and opinions to be expressed by the text information to be processed as the second text information.
[0061] It should be noted that the time sequence for inputting the acquired text information to be processed into the first extraction model and the second extraction model is not limited.
[0062] 103. Generate target text information according to the first text information and the second text information.
[0063] In this embodiment, the first text information can summarize the content of the text information to be processed, and the second text information is the views and opinions of the text information to be processed that have been analyzed. Combining the first text information and the second text information can provide a more comprehensive understanding of the text information to be processed. In this way, the first text information and the second text information are integrated to generate independent target text information, and the target text information is generated and output, so that the user can have a more comprehensive understanding of the information of the text to be processed based on the target text information.
[0064] In the technical solution disclosed in this embodiment, the text information to be processed is obtained; the text information to be processed is input into the first extraction model to obtain the first text information; the text information to be processed is input into the second analysis model to obtain the second text information; and the target text information is generated according to the first text information and the second text information. In this way, the text information to be processed that needs to be analyzed is input into the first extraction model and the second analysis model respectively for processing, the important first text information is extracted, and the analysis result of the text information to be processed is obtained as the second text information. In this way, the target text information generated according to the first text information and the second text information can summarize the text information to be processed and improve the efficiency of browsing and analyzing texts.
[0065] Further, step 102 includes:
[0066] Inputting the to-be-processed text information into a first extraction model, and obtaining the first text information including subject information;
[0067] The text information to be processed is input into a second analysis model, and the obtained second text information includes sentiment tendency information.
[0068] In this embodiment, the first extraction model can be a topic extraction model. The text information to be processed is input into the first extraction model. The first extraction model can extract topic information that can characterize the main content of the text information to be processed from the text information to be processed. The content of the text information to be processed can be summarized through the topic information, which is more convenient for users to understand the text information to be processed. The second analysis model can be a sentiment analysis model. The text information to be processed is input into the second analysis model. The second analysis model can analyze the sentiment tendency information contained in the text information to be processed. Based on the sentiment tendency information, the overall sentiment expression of the text information to be processed can be characterized, which is more convenient for users to feedback the sentiment contained in the text information to be analyzed. The user can understand the content to be expressed in the text information to be processed through the target text information generated by the topic information and the sentiment tendency information, thereby improving the efficiency of browsing and analyzing texts.
[0069] like Figure 2 As shown, Figure 2 This is a flow chart of an embodiment of the data processing method for text generation provided in the embodiment of the present application, in which the text information to be processed is real-time comment information. Specifically, it includes steps 201 to 202:
[0070] 201. Acquire real-time comment information of a target video to be analyzed, where the real-time comment information includes the real-time comment information of the target video;
[0071] 202. Use the real-time comment information as the text information to be processed.
[0072] In this embodiment, the data processing for text generation can be applied to a data processing device for text generation, and the type and quantity of the data processing device for text generation are not specifically limited, that is, the data processing device for text generation can be a terminal or a server, for example, the data processing device for text generation is a mobile phone. The target text information is composed of subject information and emotional tendency information. When the text information to be analyzed is real-time comment information for a target video, the target file information can be used as a movie review of the target video.
[0073] First, it is necessary to obtain the real-time comment information of the target video to be analyzed. The target video can be a movie, TV series, MV, or self-media video. The real-time comment information corresponding to the target video to be analyzed is obtained. The real-time comment information is the comment information issued in real time for the video, including barrage information. Barrage information refers to the instant comment subtitles sent by the audience when the video is playing. The audience can output the real-time comment information on the screen while watching the video to provide real-time feedback on the current video content. Compared with the comments in the ordinary comment area, the real-time comment information can truly, instantly, and effectively reflect the audience's views on the video. The real-time comment information can ensure that the comments are posted by the audience who have actually watched the video. After determining the target video to be analyzed, the playback platform that can provide real-time comment information can be determined, such as the playback platform corresponding to the target video with barrage function. The real-time comment information on the playback platform can be crawled down by crawling.
[0074] Then the real-time comment information is input as the text information to be processed into the preset first extraction model. The first extraction model has been trained. The first extraction model can identify the description or reaction of the real-time comment information to the video content based on some words, semantics and other information in the real-time comment information, thereby extracting the theme information of the real-time comment information, and the theme information can also be used as the theme information of the target video. The theme information can be a paragraph of text, such as the central idea, or it can be a word, such as "inspirational", "funny", "friendship", "love", etc. According to the theme information, the main content of the real-time comment information can be pointed out, so that the target text information can also generate target text information with substantial content based on the theme information of the real-time comment information, thereby improving the integrity of the target text information.
[0075] The real-time comment information is also input into the second analysis model, which is pre-trained. The second analysis model can analyze the emotional tendency information of the real-time comment information on the target video based on the words and semantic information of the real-time comment information. The emotional tendency information can represent the audience's emotions towards the target video, such as "negative", "neutral", "positive", etc. The emotional tendency information extracted from the real-time comment information can truly feedback the audience's feelings about the target video after watching the film review, so that the target text information can truly reflect the views and opinions of the text information to be processed on the video.
[0076] The topic information can be introduced into the core of the real-time comment information, and the emotional tendency information can truly reflect the audience's emotional tendency towards the video, and can also reflect the objective evaluation of the video. Combining the topic information and emotional tendency information, a document information can be generated as the target text information. Since the target text information includes the summary of the real-time comment information content and the emotional tendency of the real-time comment information to the video content, based on this, the target text information can be used as a review of the target video.
[0077] It should be noted that the first extraction model and the second analysis model are independent models. Extracting the topic information of the real-time comment information based on the first extraction model and extracting the sentiment tendency information of the real-time comment information based on the second analysis model can be performed synchronously or asynchronously, which is not limited here.
[0078] Exemplarily, the real-time comment information of the target movie is obtained and input into the first extraction model and the second analysis model respectively after passing through the preprocessing module to extract the subject information and the sentiment tendency information respectively, and then the video related information is obtained and combined to obtain the target text information as the review of the target movie.
[0079] In an embodiment of the present application, based on the real-time comment information sent by viewers who actually watch the video, the subject information and emotional tendency information of the real-time comment information are extracted, and combined with the generated target text information, the feedback of the real-time comment information on the target video can be truly and accurately summarized.
[0080] Furthermore, step 103 includes:
[0081] Obtaining video associated information associated with the target video;
[0082] Sorting the video association information, the subject information and the emotional tendency information to generate a plurality of combination sequences;
[0083] Inputting each of the combined sequences into a language generation model to obtain hidden layer features of each of the combined sequences;
[0084] The target text information is obtained according to the fusion result of the hidden layer features of each of the combined sequences.
[0085] In this embodiment, in order to make the target text information as a film review more complete, the target text information can also be generated in combination with the video associated information associated with the target video, so that the user can have a preliminary understanding of the target video when reading the target text information. Video associated information is information that can provide a basic introduction to the video. Video associated information can include content such as the production team, introduction, background introduction, long title, etc. Specifically, the corresponding video associated information can be obtained according to the type of the target video. For example, for movies, TV series, etc., the official content introduction can be obtained. Generally speaking, this information can also be crawled on the movie playback platform. For self-media videos, etc., when the title number is greater than a preset threshold, the long title can be used as the video associated information associated with the target video.
[0086] The elements for generating the target text information include the video-related information associated with the target video, the theme information of the target video, and the emotional tendency of the real-time comment information to the target video. Among them, the three types of information are combined in different orders to obtain content with different structures. The order can be set according to the needs. Specifically, the form of the combination sequence is "[start] text 1 [separator] text 2 [separator] text 3 [end]", in which, in order to allow users who read the target text information to have a preliminary understanding of the target video, it is necessary to set text 1 as video-related information, and for emotional tendency information and theme information, the order can be set without setting, then there are two corresponding sortings: video-related information-emotional tendency information-theme information, and video-related information-theme information-emotional tendency information, corresponding to which two combination sequences are obtained: [start] video-related information [separator] emotional tendency information [separator] theme information [end], and [start] video-related information [separator] theme information [separator] emotional tendency information [end].
[0087] After obtaining multiple combination sequences, each combination sequence is input into the language generation model respectively. The language generation model can be a natural language generation model such as GPT (Generative Pre-trained Transformer), which can facilitate deep neural networks to generate and understand natural language text. Optionally, before using the language generation model, the pre-trained language generation model is used together with the prepared data set to fine-tune the language generation model. The fine-tuning process is to input the text examples in the data set into the model, and perform back-propagation optimization based on the output and label of the model (i.e., the pre-given film reviews) to adapt the model building to the task.
[0088] The language generation model includes a coding layer and a fully connected layer, wherein the coding layer is constructed based on the Transformer architecture. After each combination sequence is input into the coding layer of the preset language generation model, the hidden layer features of each combination sequence are obtained. The hidden layer features are generally represented by vectors, which can represent the implicit representation of the text content that can be obtained using the corresponding combination sequence. The hidden layer features of each combination sequence are fused, including adding the two hidden layer features. The fusion result is input into the fully connected layer of the language generation model, and the fusion result is mapped into a comprehensive evaluation of the target video.
[0089] In this embodiment, a language generation model is used to fuse the hidden layer features corresponding to the combined sequence composed of video-related information, theme information and sentiment tendency information associated with the target video in different orders, and then the film review is output. On the one hand, the video content is enriched, and on the other hand, a variety of information is combined to output the target text information, thereby improving the accuracy of the target text information in summarizing the real-time comment information, and being able to truly and accurately summarize the feedback of the real-time comment information on the target video, thereby improving the efficiency of browsing and analyzing texts.
[0090] Furthermore, an embodiment of determining a target video is also provided in the embodiments of the present application, comprising the following steps:
[0091] Receive user-triggered operation information based on the film review query interface;
[0092] Identify the operation information and determine the corresponding video to be analyzed;
[0093] Obtaining function information of the playback platform of the video to be analyzed;
[0094] If the function information includes the barrage function, the video to be analyzed is used as the target video.
[0095] In this embodiment, a separate film review query interface can also be provided. The film review query interface provides a user interface for users to input video names, links and other content, or select target videos that need to be reviewed. According to the user-triggered operation information received by the user in the film review query interface, the query information entered by the user in the interface, or the click information on the video can be determined. The film review query interface provides a video display box and a query box. If the user wants to query the review of a certain video, then the relevant information of the video can be entered in the query box. The video display box can display several videos, and the user can click on the video display box to select the video he needs to view. According to the operation information triggered by the user, the corresponding target video to be analyzed is determined. The target video is the video selected by the user for which the review needs to be queried.
[0096] Optionally, since the target text information is generated as the film review based on the real-time comment information, and the real-time comment information will increase all the time, the direction of the real-time comment information will also change, and the generated film review will also be different. Therefore, the acquired real-time comment information is real-time real-time comment information, and the generated film review is also real-time film review.
[0097] After determining the target video, obtain the playback platform corresponding to the target video to be analyzed for which the user selects to query movie reviews. Generally speaking, most videos are not played across the entire network, but are played on one or two playback platforms. For some videos, the playback platform does not open the bullet screen function, so that the bullet screen information of the video to be analyzed cannot be obtained as real-time comment information. Therefore, it is necessary to obtain the playback platform of the video to be analyzed and obtain the function information corresponding to the playback platform. The function information can determine the playback functions that the playback platform can provide.
[0098] In this embodiment, determine whether it provides a bullet screen function according to the function information of the playback platform. If the function information does not include the bullet screen function, real-time comment information cannot be obtained, and the video to be analyzed cannot be used as the target video to be analyzed. The preset movie review output of the video to be analyzed can be obtained, or a prompt message can be output. If the function information includes the bullet screen function, the video to be analyzed is used as the target video, and the real-time comment information of the target video is obtained to generate target text information as the movie.
[0099] In this way, a movie review query interface is provided as a user interface for the user to select the target video to be analyzed for which the user needs to view the movie review, and determine whether a corresponding movie review can be generated according to its real-time comment information according to the function information of the playback platform of the target video, improving the user experience.
[0100] As Figure 3 shown, Figure 3 This is a schematic flowchart of an embodiment of extracting sentiment tendency information by a second analysis model in the data processing method for text generation provided in the embodiment of the present application. Specifically, it includes steps 301 to 303:
[0101] 301. Extract the word features in the text information to be processed and the temporal information between the word features through the memory network in the second analysis model;
[0102] In this embodiment, the second analysis model is pre-trained and used to extract the sentiment tendency information expressed in the real-time comment information. After inputting the preprocessed real-time comment information into the second analysis model, it can judge the positive evaluation, negative evaluation or neutral evaluation of the text information to be processed on objects such as the target video, that is, the sentiment tendency information. The second analysis model includes a memory network, and the memory network can select a bidirectional long short-term memory network BiLSTM. The memory network can extract the corresponding word features from the single-mode information and retain the temporal information between the word features in the sentences of the text information to be processed, so as to solve the situation of double negation such as "it is not a work as bad as everyone said".
[0103] 302. Weight the word features according to the preset word weights corresponding to the word features and the temporal information to obtain semantic features;
[0104] In this embodiment, since some words have obvious emotional connotations, such as "good-looking" and "speechless", an attention mechanism is introduced based on the memory network. The attention mechanism can set different proportions for word features according to preset word weights, and perform weighted summation of the features based on preset word weights and time series information to obtain semantic features that can represent emotional tendencies.
[0105] For example, Figure 5 As shown, this is the second analysis model of a memory network BiLSTM+attention architecture.
[0106] Reference Figure 6 As shown, let the time step in BiLSTM be t', the time step in Attention Model be t, α <t,t′> Represents y <t>< / t> Should be spent on a <t′> The proportion of attention on <t′> represents the feature vector at time step t', For any time step t in the Attention Model, the sum of all attentions should be 1, that is, c is the weighted sum of the feature vectors obtained in BiLSTM, that is,
[0107] 303. Input the semantic features into the activation layer of the second analysis model to obtain the sentiment tendency information.
[0108] In this embodiment, the semantic features obtained by weighted summation can be mapped to obtain sentiment tendency information. The semantic features are first input into a fully connected layer to represent them as the final semantic vector, and then input into the activation layer (softmax layer) in the second analysis model to determine the sentiment tendency of the text information to be processed, thereby obtaining the sentiment tendency information.
[0109] In the technical solution disclosed in this embodiment, word features in real-time comment information are extracted through the memory network in the second analysis model, and the temporal information between the word features is retained. Weights are introduced to pay extra attention to important word features. The semantic features obtained based on the words can more accurately judge the sentiment tendency information of the text information to be processed, thereby improving the accuracy of generating the target text information, and can truly and accurately summarize the feedback of the real-time comment information on the target video.
[0110] like Figure 4 As shown, Figure 4 This is a flow chart of an embodiment of extracting topic information by a first extraction model in a data processing method for text generation provided in an embodiment of the present application, including the following steps 401 to 402:
[0111] 401, inputting the first extraction model based on the text information to be processed, obtaining a plurality of topic networks corresponding to the text information to be processed, wherein the topic network is composed of a plurality of corresponding keywords;
[0112] In this embodiment, the first extraction model is trained in advance and used to extract the topic network representing the topic in the text information to be processed. There are generally multiple topic networks, each of which is composed of multiple keywords. Keywords can be represented by word vectors, and thus, a connection relationship can be set between each keyword. The topic network is a network structure composed of multiple keywords and the connection relationship between keywords.
[0113] The first extraction model can adopt the LDA (Latent Dirichlet Allocation) model. LDA is a topic modeling technique for text data, which can reveal the potential topic structure in the text collection. LDA assumes that each document is composed of a mixture of multiple topics, and each topic is a probability distribution of multiple words. Through statistical analysis of text data, LDA attempts to find the topics hidden behind the text and determine the topic distribution of each document and the vocabulary distribution of each topic. Using the LFA model, topic structures can be extracted from the text information to be processed. These topic structures can help to outline the text information to be processed from different directions when generating the target text information.
[0114] It should be noted that LDA is an unsupervised learning technique, and the number of topics can be determined using the topic number-perplexity curve. After the LDA model, T topics can be obtained, each with N keywords, and the word embedding of keywords can be obtained using Word2Vec such as the Skip-Gram model.
[0115] Optionally, the crawled text information to be processed can be merged into a document and input into the topic network or model network in units of documents, which can improve processing efficiency and make it easier for the first extraction model to process the text information to be processed.
[0116] 402 , determining the topic information according to the keywords in the topic network and the connection relationships corresponding to the keywords.
[0117] In this embodiment, the first extraction model can extract multiple topic networks from the text information to be processed to represent the core of the text information to be processed, and some or all of the topic networks can be selected to determine the topic information. The keywords in the topic network can reveal the main content of the text information to be processed, and the connection relationship between the keywords can reveal the connection relationship of the main content, so the multiple keywords in the topic network and the connection relationship corresponding to the keywords are output as topic information.
[0118] In the technical solution disclosed in this embodiment, the topic network hidden in the text information to be processed is extracted through the first extraction model, and the keywords and their connection relationships in the topic network are used as topic information, so that the film reviews generated based on the topic information can be consistent with the core of the text information to be processed, thereby improving the accuracy of the film reviews.
[0119] Furthermore, after the first extraction model is input based on the text information to be processed and a plurality of topic networks corresponding to the text information to be processed are obtained, the method further includes:
[0120] For each keyword in the same topic network, the number of outbound links and a preset stable probability value of the inbound keyword pointing to the keyword are obtained, and the stable probability value corresponding to the keyword is calculated according to the number of outbound links and the preset stable probability value of the inbound keyword;
[0121] Based on the stationary probability value in the subject network, the keywords in the subject network are arranged, and according to the arrangement result, the target keyword is determined as the core node of the subject network, and the subject network is updated.
[0122] In this embodiment, after determining the subject network, it is necessary to perform network analysis on the subject network. Network analysis refers to performing network analysis on each subject network G(TP k) is used to calculate the PageRank value (steady probability value) of each node from the network structure characteristics of the topic network. In the extreme case, the probability of accessing each node converges to a stable distribution. At this time, the stable probability value of each node is its PageRank value. The stable probability value can represent the importance of the node, and each node corresponds to a keyword of the topic network. If the keyword is not important relative to the topic network, the attention to the keyword can be reduced and it is not regarded as a core node. Specifically, the core node can be determined for each topic network. For the keywords under the same topic network, the number of outbound links of the inbound keywords pointing to the keywords and the preset stable probability value are obtained. There is an association between keywords in the topic network. This association is pointed to by another keyword, or it may be the execution of other keywords. The more such pointings, the higher the importance of the keyword. The other keywords that execute the keyword are called inbound keywords, and the number of keywords that the keyword points to other keywords is called the number of outbound links. The preset stable probability value is the initial value assigned to each keyword. Generally speaking, the initial values are equal. Then the PageRank value is calculated based on the following formula:
[0123]
[0124] Among them, PR(a) represents the stable probability value of the current keyword a, PR(Ti) represents the stable probability value of the incoming keyword, L(Ti) represents the number of outbound links of the incoming keyword, and i represents the number of iterations. When it is the first iteration, that is, when i=1, PR(Ti) is the preset stable probability value of the incoming keyword, and when i=n, PR(Ti) is the preset stable probability value of the incoming keyword obtained after n-1 iterations. According to the number of outbound links of the incoming keyword and the preset stable probability value, the stable probability value corresponding to the keyword is updated. The stable probability value of the updated keyword and the number of outbound links are used to calculate the stable probability value of its outbound keyword. After continuous iteration, until the stable probability value of each keyword does not change after multiple consecutive iterations, the final stable probability value of each keyword is obtained.
[0125] After calculating the steady-state probability value corresponding to each keyword in the topic network, the keywords are arranged in descending order based on the steady-state probability value, and the topic network is updated according to the preset number of arranged keywords, that is, the top-N nodes are taken as the core nodes of the topic network, the keywords corresponding to the core nodes are the core keywords, and the keywords corresponding to other nodes are the common keywords of the topic, and then the updated topic network is output.
[0126] In this way, through network analysis, the core nodes of the subject network are screened out, so that the subject network focuses more on important keywords. When the subject information is determined based on the subject network to generate target text information, the accuracy of the summary of the text information to be processed can be improved.
[0127] Furthermore, after the first extraction model is input based on the text information to be processed and a plurality of topic networks corresponding to the text information to be processed are obtained, the method further includes:
[0128] For each topic network, calculate the similarity between the keywords in the topic network;
[0129] If the existence similarity is less than the preset similarity, the connection relationship between the corresponding target keywords is deleted to update the corresponding topic network.
[0130] In this embodiment, after determining the topic network, it is also necessary to calculate the similarity propagation of the topic network. The similarity propagation calculation can be performed before the network analysis. Figure 7 Similarity propagation refers to calculating the similarity between keywords in the same topic network. Keywords can be represented by word vectors, so calculating the similarity between keywords can be calculating the cosine similarity between the word vectors corresponding to the keywords. Keywords can be represented by the following formula:
[0131] G(TP k )={V(TP k ), E, W}
[0132] Among them, G(TP k ) represents the network structure of words on topic k, V(TP k ) represents the set of all keywords under the subject network, that is, the set of network nodes;
[0133] W={w|w=Sim(v i , v j )} represents the weight of the edge of the topic network, that is, the similarity between keywords; E = {e|w>ε} represents G(TP k ), when the edge weight w is greater than or equal to the threshold ε, the edge between the nodes is retained, that is, the connection relationship between the two keywords is retained; when the edge weight w is less than the threshold ε, the edge between the nodes is deleted, that is, the connection relationship between the two corresponding target keywords is deleted. In this way, through the calculation of similarity propagation, the connection between keywords with low similarity is removed, making the connection relationship between keywords in the topic network closer, and being able to more accurately perform network analysis and determine accurate topic information. When using the topic information determined according to the topic network to generate target text information, the accuracy of the summary of the text information to be processed can be improved.
[0134] In order to better implement the data processing method for text generation in the embodiment of the present application, based on the data processing method for text generation, the embodiment of the present application also provides a data processing device for text generation, such as Figure 8 As shown, Figure 8 801 is a schematic diagram of an embodiment of a data processing device for text generation, wherein the data processing device for text generation includes the following modules 801 to 803:
[0135] The acquisition module 801 is used to acquire the text information to be processed;
[0136] Processing module 802, used for inputting the text information to be processed into a first extraction model to obtain first text information, and inputting the text information to be processed into a second analysis model to obtain second text information;
[0137] The generating module 803 is configured to generate target text information according to the first text information and the second text information.
[0138] In some embodiments, the acquisition module 801 is further used to acquire real-time comment information of the target video to be analyzed, wherein the real-time comment information includes the real-time comment information of the target video;
[0139] The real-time comment information is used as the text information to be processed.
[0140] The processing module 802 is further used to input the text information to be processed into a first extraction model, and the first text information obtained includes topic information;
[0141] The text information to be processed is input into a second analysis model, and the obtained second text information includes sentiment tendency information.
[0142] The generating module 803 is further used to obtain the video associated information associated with the target video;
[0143] Sorting the video association information, the subject information and the emotional tendency information to generate a plurality of combination sequences;
[0144] Inputting each of the combined sequences into a language generation model to obtain hidden layer features of each of the combined sequences;
[0145] The target text information is obtained according to the fusion result of the hidden layer features of each of the combined sequences.
[0146] In some embodiments, the processing module 802 is further used to extract word features in the text information to be processed and time sequence information between each of the word features through the memory network in the second analysis model;
[0147] According to the preset word weight corresponding to the word feature and the time sequence information thereof, the word feature is weighted to obtain a semantic feature;
[0148] The semantic features are input into the activation layer of the second analysis model to obtain the sentiment tendency information.
[0149] In some embodiments, the processing module 802 is further used to input the first extraction model based on the text information to be processed, and obtain multiple topic networks corresponding to the text information to be processed, wherein the topic network is composed of corresponding multiple keywords;
[0150] The topic information is determined according to the keywords in the topic network and the connection relationships corresponding to the keywords.
[0151] In some embodiments, the processing module 802 is further used to calculate the stationary probability value corresponding to each keyword in each topic network, and arrange the keywords based on the stationary probability value;
[0152] The topic network is updated according to a preset number of arranged keywords as core nodes of the topic network.
[0153] In this embodiment, the data processing device for text generation obtains text information to be processed; inputs the text information to be processed into the first extraction model to obtain the first text information, inputs the text information to be processed into the second analysis model to obtain the second text information; and generates target text information according to the first text information and the second text information. In this way, the text information to be processed that needs to be analyzed is input into the first extraction model and the second analysis model respectively for processing, the important first text information is extracted, and the analysis result of the text information to be processed is obtained as the second text information. In this way, the target text information generated according to the first text information and the second text information can summarize the text information to be processed, thereby improving the efficiency of browsing and analyzing texts.
[0154] The embodiment of the present invention also provides a data processing device for text generation, such as Fig. 9 As shown, Fig. 9 It is a schematic diagram of the structure of an embodiment of a data processing device for text generation provided in an embodiment of the present application.
[0155] The data processing device for text generation integrates any one of the data processing devices for text generation provided in the embodiments of the present invention, and the data processing device for text generation includes:
[0156] one or more processors;
[0157] Memory; and
[0158] One or more applications, wherein the one or more applications are stored in the memory and are configured to be executed by the processor in the steps of the data processing method for text generation described in any of the above-mentioned data processing method embodiments for text generation.
[0159] Specifically, the data processing device for text generation may include one or more processing core processors 901, one or more computer-readable storage media memories 902, a power supply 903, an input unit 904 and other components. Those skilled in the art will understand that Fig. 9 The structure of the data processing device for text generation shown in the figure does not constitute a limitation on the data processing device for text generation, and may include more or fewer components than shown in the figure, or combine certain components, or arrange the components differently.
[0160] The processor 901 is the control center of the data processing device for text generation. It uses various interfaces and lines to connect the various parts of the data processing device for text generation. By running or executing software programs and / or modules stored in the memory 902, and calling the data stored in the memory 902, it executes various functions of the data processing device for text generation and processes data, thereby monitoring the data processing device for text generation as a whole. Optionally, the processor 901 may include one or more processing cores; preferably, the processor 901 may integrate an application processor and a modem processor, wherein the application processor mainly processes the operating system, user interface, and application programs, etc., and the modem processor mainly processes wireless communications. It is understandable that the above-mentioned modem processor may not be integrated into the processor 901.
[0161] The memory 902 can be used to store software programs and modules. The processor 901 executes various functional applications and data processing by running the software programs and modules stored in the memory 902. The memory 902 may mainly include a program storage area and a data storage area, wherein the program storage area may store an operating system, an application required for at least one function (such as a sound playback function, an image playback function, etc.), etc.; the data storage area may store data created according to the use of a data processing device for text generation, etc. In addition, the memory 902 may include a high-speed random access memory, and may also include a non-volatile memory, such as at least one disk storage device, a flash memory device, or other volatile solid-state storage devices. Accordingly, the memory 902 may also include a memory controller to provide the processor 901 with access to the memory 902.
[0162] The data processing device for text generation may also include a power supply 903 for supplying power to various components. Preferably, the power supply 903 may be logically connected to the processor 901 through a power management system, so as to manage charging, discharging, and power consumption through the power management system. The power supply 903 may also include any components such as one or more DC or AC power supplies, recharging systems, power failure detection circuits, power converters or inverters, and power status indicators.
[0163] The data processing device for text generation may also include an input unit 904, which can be used to receive input digital or character information and generate keyboard, mouse, joystick, optical or trackball signal input related to user settings and function control.
[0164] Although not shown, the data processing device for text generation may also include a display unit, etc., which will not be described in detail here. Specifically in this embodiment, the processor 901 in the data processing device for text generation will load the executable files corresponding to the processes of one or more application programs into the memory 902 according to the following instructions, and the processor 901 will run the application programs stored in the memory 902, thereby realizing various functions, as follows:
[0165] Get the text information to be processed;
[0166] Inputting the text information to be processed into a first extraction model to obtain first text information, and inputting the text information to be processed into a second analysis model to obtain second text information;
[0167] Target text information is generated according to the first text information and the second text information.
[0168] A person of ordinary skill in the art will appreciate that all or part of the steps in the various methods of the above embodiments may be completed by instructions, or by controlling related hardware through instructions. The instructions may be stored in a computer-readable storage medium and loaded and executed by a processor.
[0169] To this end, an embodiment of the present invention provides a computer-readable storage medium, which may include: a read-only memory (ROM), a random access memory (RAM), a disk or an optical disk, etc. A computer program is stored thereon, and the computer program is loaded by a processor to execute the steps of any data processing method for text generation provided by an embodiment of the present invention. For example, the computer program may be loaded by a processor to execute the following steps:
[0170] Get the text information to be processed;
[0171] Input the text information to be processed into the first extraction model to obtain the first text information, and input the text information to be processed into the second analysis model to obtain the second text information;
[0172] Generate the target text information according to the first text information and the second text information.
[0173] In the above embodiments, the descriptions of the various embodiments have their own focuses. For the parts not detailed in a certain embodiment, reference may be made to the detailed descriptions of other embodiments above, and will not be elaborated here.
[0174] In specific implementation, the above units or structures can be implemented as independent entities, or can be combined arbitrarily to be implemented as the same or several entities. For the specific implementation of the above units or structures, reference may be made to the method embodiments above, and will not be elaborated here.
[0175] For the specific implementation of the above operations, reference may be made to the previous embodiments, and will not be elaborated here.
[0176] The above has introduced in detail a data processing method for text generation provided by the embodiments of the present application. Specific examples are used in this article to elaborate on the principles and implementation manners of the present invention. The descriptions of the above embodiments are only used to help understand the method and its core idea of the present invention; at the same time, for those skilled in the art, according to the idea of the present invention, there will be changes in the specific implementation manners and application scopes. In summary, the content of this specification should not be construed as a limitation to the present invention.
Claims
1. A data processing method for text generation, It is characterized in that The method comprises: Get the text information to be processed; Inputting the text information to be processed into a first extraction model to obtain first text information, and inputting the text information to be processed into a second analysis model to obtain second text information; Target text information is generated according to the first text information and the second text information.
2. The data processing method according to claim 1, It is characterized in that The step of inputting the text information to be processed into a first extraction model to obtain first text information, and inputting the text information to be processed into a second analysis model to obtain second text information comprises: Inputting the to-be-processed text information into a first extraction model, and obtaining the first text information including subject information; The text information to be processed is input into a second analysis model, and the obtained second text information includes sentiment tendency information.
3. The data processing method according to claim 2, It is characterized in that The obtaining of the text information to be processed includes: Acquire real-time comment information of a target video to be analyzed, wherein the real-time comment information includes the real-time comment information of the target video; The real-time comment information is used as the text information to be processed.
4. The data processing method according to claim 3, It is characterized in that The generating target text information according to the first text information and the second text information includes: Obtaining video associated information associated with the target video; Sorting the video association information, the subject information and the emotional tendency information to generate a plurality of combination sequences; Inputting each of the combined sequences into a language generation model to obtain hidden layer features of each of the combined sequences; The target text information is obtained according to the fusion result of the hidden layer features of each of the combined sequences.
5. The data processing method according to claim 2, It is characterized in that The step of inputting the to-be-processed text information into a second analysis model, and obtaining the second text information including sentiment tendency information, comprises: Extracting word features in the text information to be processed and time sequence information between each of the word features through the memory network in the second analysis model; According to the preset word weight corresponding to the word feature and the time sequence information thereof, the word feature is weighted to obtain a semantic feature; The semantic features are input into the activation layer of the second analysis model to obtain the sentiment tendency information.
6. The data processing method according to claim 2, It is characterized in that The step of inputting the to-be-processed text information into a first extraction model, and obtaining the first text information including subject information, includes: Based on the text information to be processed being input into the first extraction model, a plurality of topic networks corresponding to the text information to be processed are obtained, wherein the topic networks are composed of a plurality of corresponding keywords; The topic information is determined according to the keywords in the topic network and the connection relationships corresponding to the keywords.
7. The data processing method according to claim 6, It is characterized in that After the first extraction model is input based on the text information to be processed to obtain a plurality of topic networks corresponding to the text information to be processed, the method further includes: For each keyword in the same topic network, the number of outbound links and a preset stable probability value of the inbound keyword pointing to the keyword are obtained, and the stable probability value corresponding to the keyword is calculated according to the number of outbound links and the preset stable probability value of the inbound keyword; Based on the stationary probability value in the subject network, the keywords in the subject network are arranged, and according to the arrangement result, the target keyword is determined as the core node of the subject network, and the subject network is updated.
8. A data processing device for text generation, It is characterized in that The data processing device for text generation comprises: An acquisition module is used to acquire text information to be processed; A processing module, used for inputting the text information to be processed into a first extraction model to obtain first text information, and inputting the text information to be processed into a second analysis model to obtain second text information; A generating module is used to generate target text information according to the first text information and the second text information.
9. A data processing device for text generation, It is characterized in that The data processing device for text generation comprises: one or more processors; Memory; and One or more applications, wherein the one or more applications are stored in the memory and are configured to be executed by the processor to implement the steps of the data processing method for text generation described in any one of claims 1 to 7.
10. A computer-readable storage medium, It is characterized in that A computer program is stored thereon, and the computer program is loaded by a processor to execute the steps in the data processing method for text generation as described in any one of claims 1 to 7.