A method for opera text analysis and plot summary extraction
The opera text generation network integrates multi-modal content to generate opera text, and uses the LLM language model for plot summary extraction, which solves the problem of poor results caused by single-modal analysis in the existing technology and achieves a more accurate and rich opera plot. Analysis and summary extraction.
Patent Information
- Application Number
- CN202411001081.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-07-25
- Publication Date
- 2024-10-25
- Estimated Expiration
- 2044-07-25
AI Technical Summary
The existing opera plot analysis and plot summary methods are based on a single large language model, and the object form of text analysis and plot summary is single, resulting in poor results and inability to fully utilize the multiple information of opera scripts, video and audio modalities.
The preset opera text generation network is used to generate multi-modal opera text by integrating time-aligned opera video, audio and script content, and the opera vocal, audio, video and script single-mode encoder and modal fusion network are used to extract rich The content of the opera text is extracted, and the plot summary is extracted through the Embedding model and the LLM language model.
It achieves more accurate and rich opera plot analysis and plot summaries, supports users to understand opera content from multiple angles, and improves the effect of plot summaries.
Smart Images

Figure CN118520075B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of opera analysis, and in particular to a method for opera text analysis and plot summary extraction. Background Art
[0002] Opera is an artistic expression form that integrates multiple modes. Typical operas contain character movements and scenes based on visual information. The character movements are closely integrated with the plot of the opera, presenting the development of the story to the audience and promoting the development of the plot of the opera. The movements combined with the opera script reflect the corresponding personality, emotions and psychology of the characters. For example, elegant movements can create the image of a gentle scholar, while strong movements can create the image of a brave and courageous hero. The delicate gestures and postures of the female role can convey inner emotions such as gentleness and shyness; the manners and gait of the male role can show their firmness, heroism and other personality characteristics; the scene will present the time and space background of the story through specific scenery and environment settings combined with the opera script; based on the auditory singing, recitation, and musical instrument expression, singing and recitation are the singing and recitation of the characters. Existing opera plot analysis and plot summary often use a single large language model for text analysis. The object form of text analysis and plot summary is single and the content is lacking, resulting in poor results. The analysis objects for extracting the summary of the opera plot are distributed in the opera script modality, the opera video modality and the opera audio modality. Each modality has different emphases. It is necessary to integrate the summary analysis objects in multiple modalities in order to conduct more accurate opera analysis and plot summary. Summary of the invention
[0003] In order to solve the above technical problem or at least partially solve the above technical problem, the present invention provides a method for analyzing opera text and extracting plot summaries.
[0004] In a first aspect, the present invention provides a method for analyzing opera text and extracting plot summaries, comprising:
[0005] The opera text is generated by integrating the time-aligned opera video, audio and script content through a preset opera text generation network, wherein the opera text includes multimodal opera scenes, character activities and plot content; the opera text generation network includes: an opera vocal single-mode encoder, an opera audio single-mode encoder, an opera video single-mode encoder, an opera script single-mode encoder, a feedforward network and a modal fusion network, wherein the feedforward network maps the features generated by each single-mode encoder to the same dimension input modal fusion network, and the modal fusion network generates the opera text based on the content features obtained from the multimodal opera content carrier;
[0006] The obtained opera text is segmented according to semantics, and the segmented text content is encoded through the Embedding model to obtain the vector representation of the segmented text content, and the vector representation is used to form a content vector library of the opera text;
[0007] Obtain questions related to the plot summary, encode the question vectors related to the plot summary through the Embedding model, and obtain the opera text vectors that are highly correlated with the questions related to the summary from the vector knowledge base of the opera text through similarity retrieval matching;
[0008] The question vector related to the plot summary and the matched opera text vector are combined to form the LLM language model prompt words, and the LLM language model performs a plot summary based on the content represented by the LLM language model prompt words.
[0009] Furthermore, the opera vocal single-mode encoder comprises: a vocal audio feature encoder based on a convolutional neural network, a first context network based on a Transformer module, a first quantization module, a semantic temporal classification module based on a linear layer and a softmax layer, and a semantic sequence to sequence classification module based on a GRU, an attention mechanism and a semantic sequence to sequence linear layer;
[0010] The human voice audio feature encoder comprises: a stacked multi-channel spatiotemporal one-dimensional convolution, a normalization layer and a GELU activation function layer, and the human voice audio feature encoder extracts a human voice feature vector from a time-aligned opera audio human voice segment;
[0011] The first quantization module compares the human voice feature vector with a codebook vector in a preset codebook, and outputs an index of the codebook vector closest to the human voice feature vector;
[0012] The semantic sequence to sequence classification module includes: GRU, attention weight calculation module and semantic sequence to sequence linear layer.
[0013] Furthermore, the training process of the opera vocal single-mode encoder includes:
[0014] The human voice audio feature encoder and the first context network are trained using unlabeled speech data and the first quantization module. During training, the speech data is input into the human voice audio feature encoder to obtain a human voice feature vector. Before the human voice feature vector is input into the first context network, part of the human voice feature vector is shielded by a random mask. The first context network obtains the predicted context representation of the shielded human voice feature vector based on the preceding features of the shielded human voice feature vector. The loss function used in the training is as follows:
[0015] ,
[0016] ,
[0017] ;
[0018] in, Characterize the human voice feature vector, Represents the corresponding vocal feature vector The first codebook vector of is the total number of codebook vectors in the first codebook, For the codebook vector, is the first heat parameter, is the L2 norm, is the frame count of the vocal feature vector sequence, For the Frame voice feature vector corresponding to codebook vector The probability of To indicate the parameters, The actual codebook vector of the frame voice feature vector is hour, ,otherwise, , is the first loss weight.
[0019] Furthermore, the training process of the opera vocal unimodal encoder includes: training the opera vocal unimodal encoder through the speech data annotated with semantic characters, introducing a semantic temporal classification module based on a linear layer and a Softmax activation function after the first context network during the training process, the semantic temporal classification module classifies the context representation provided by the first context network to obtain the specific semantics represented by the context representation, the quantization module needs to be removed during the training, and the loss function for training the semantic temporal classification module is:
[0020] ;
[0021] in, represents the context representation of the vocal feature vector of the tth frame, Represents the semantic character corresponding to the vocal feature vector of the tth frame, The output of the semantic temporal classification module is based on Predicted The probability of is used to set the initial parameters for the semantic temporal classification module through this training process.
[0022] Furthermore, the training process of the opera human voice single-mode encoder includes: after determining the initial parameters of the semantic temporal classification module, the opera human voice single-mode encoder is trained through the pure human voice opera audio data annotated with semantic characters;
[0023] During the training process, a linear layer and a LeakyReLU activation function are added after the first context network, and the context representation is processed by the linear layer and the LeakyReLU activation function and sent to the semantic temporal classification module and the semantic sequence to sequence classification module respectively, and the classification results of the semantic temporal classification module and the semantic sequence to sequence classification module are weighted to obtain the final opera vocal coding features;
[0024] The loss function for training is:
[0025] ;
[0026] in, , , is the linear layer function, It represents the sequence result after the context representation is processed by the linear layer and the LeakyReLU activation function. ; Based on the output of the time series classification module Predicted The probability of The semantic sequence-to-sequence classification module is based on and The previous prediction results of Predicted The probability of is the weight of the classification result.
[0027] Furthermore, the opera audio single-mode encoder includes: an opera audio feature encoder based on a convolutional neural network, a second context network based on a Transformer module, a second quantization module, a score sequence to sequence classification module and a multi-layer perceptron;
[0028] The opera audio feature encoder comprises: a stacked multi-channel spatiotemporal one-dimensional convolution, a normalization layer and a GELU activation function layer, and the opera audio feature encoder extracts an opera audio feature vector;
[0029] The second quantization module compares the opera audio feature vector extracted by the opera audio feature encoder with the codebook vector in the preset second codebook, and outputs the index of the codebook vector closest to the opera audio feature vector;
[0030] The music score sequence to sequence classification module includes a GRU, an attention weight calculation module and a music score sequence to sequence linear layer.
[0031] Furthermore, the training process of the opera audio single-mode encoder includes:
[0032] The unlabeled opera audio data and the second quantization module are used to train the opera audio feature encoder and the second context network. During training, the opera audio data is input into the opera audio feature encoder to obtain the opera audio feature vector. Before the opera audio feature vector is input into the second context network, part of the opera audio feature vector is shielded by random masking. The second context network obtains the predicted context representation of the shielded opera audio feature vector based on the preceding features of the shielded opera audio feature vector. The loss function used in the training is as follows:
[0033] ,
[0034] ,
[0035] ;
[0036] in, Characterize the opera audio feature vector, Represents the corresponding opera audio feature vector The second codebook vector of is the total number of codebook vectors in the second codebook, For the codebook vector, is the second heat parameter, is the L2 norm, is the frame count of the opera audio feature vector sequence, For the Frame opera audio feature vector corresponding to codebook vector The probability of To indicate the parameters, The actual codebook vector of the frame opera audio feature vector is hour, ,otherwise, , is the second loss weight.
[0037] Furthermore, the training process of the opera audio single-mode encoder includes:
[0038] The single-mode encoder for opera audio is trained by using the opera audio data with music notation and sentiment semantics annotation. During the training process, the music score sequence is introduced into the sequence classification module and the multi-layer perceptron after the second context network.
[0039] The loss function for training is:
[0040] ;
[0041] in, represents a context representation sequence extracted by a second context network; The score sequence to sequence classification module is based on and Prediction results of musical notation annotations of prelude music score Predict the music score notation The probability of It is a multi-layer perceptron based on the concatenation feature of the music sequence to the linear layer output of the sequence Predict emotional semantic labels In the music sequence to sequence classification module, GRU is based on Get the hidden state sequence , for the hidden state sequence After extracting the attention weight from each hidden state, it is weighted with itself, and the weighted features are input into the music score sequence to the sequence linear layer to obtain the musical note features in the music score; the emotional semantic label is predicted based on the fused musical note features through a multi-layer perceptron.
[0042] Furthermore, the opera script single-mode encoder adopts the DeBERTa model to extract the opera script encoding features through the DeBERTa model; the opera video single-mode encoder adopts the Swin Transformer model trained for opera videos to extract scene information and character action information in opera videos, and extracts the opera video encoding features through the Swin Transformer model.
[0043] Furthermore, the modality fusion network includes: a self-attention Transformer encoder with residual connection corresponding to each modality, a cross-attention Transformer encoder and a feedforward network, the outputs of the cross-attention Transformer encoders of each modality are spliced and input into the feedforward network, and a fusion normalization layer is set after the self-attention Transformer encoder, the cross-attention Transformer encoder and the feedforward network respectively; wherein, the Q value corresponding to any modality in the cross-attention Transformer encoder is obtained by splicing the features of other modalities and multiplying them with the weight matrix.
[0044] In a second aspect, the present invention provides a device for implementing a method for analyzing opera texts and extracting plot summaries, comprising: at least one processing unit, the processing unit being connected to a storage unit via a bus unit, the storage unit storing a computer program, and when the computer program is executed by the processing unit, the method for analyzing opera texts and extracting plot summaries is implemented.
[0045] In a third aspect, the present invention provides a computer-readable storage medium storing a computer program, which, when executed by a processor, implements the method of opera text analysis and plot summary extraction.
[0046] The above technical solution provided by the embodiment of the present invention has the following advantages compared with the prior art:
[0047] This application generates a drama text by integrating the multimodal content of the drama video, audio and script that are time-aligned through a preset drama text generation network, and the drama text includes multimodal drama scenes, character activities, and plot content; and generates a drama text by obtaining rich content from the multimodal drama content carrier through the drama text generation network. The drama text obtained by analysis has a better effect than summarizing the plot through the script alone.
[0048] In the opera text generation network of the present application, the opera vocal single-mode encoder and the opera audio single-mode encoder extract audio codes from the opera semantics and opera emotion aspects respectively, supporting the enrichment of the emotions, feelings, and personality aspects of the characters in the opera text; the opera video single-mode encoder of the present application can extract opera video scenes and character action information, supporting the enrichment of the characters and scenes in the opera text.
[0049] This application obtains questions related to the plot summary, encodes the question vector related to the plot summary through the Embedding model, obtains the opera text vector with strong correlation with the question related to the summary from the vector knowledge base of the opera text through similarity retrieval matching; combines the question vector related to the plot summary and the matched opera text vector to form the LLM language model prompt word, and the LLM language model performs the plot summary based on the content represented by the LLM language model prompt word. It supports users to ask questions about any aspect of the plot, retrieves the content related to the question in the opera text, and performs the plot summary based on the matched content through the LLM language model. BRIEF DESCRIPTION OF THE DRAWINGS
[0050] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the invention and, together with the description, serve to explain the principles of the invention.
[0051] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, for ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative labor.
[0052] Figure 1 A flowchart of a method for analyzing opera text and extracting plot summaries provided by an embodiment of the present invention;
[0053] Figure 2 A method architecture diagram for opera text analysis and plot summary extraction provided by an embodiment of the present invention;
[0054] Figure 3 A schematic diagram of a single-mode encoder for opera vocals provided by an embodiment of the present invention;
[0055] Figure 4 A schematic diagram of a Chinese opera audio single-mode encoder provided by an embodiment of the present invention;
[0056] Figure 5 A schematic diagram of a modality fusion network provided by an embodiment of the present invention;
[0057] Figure 6 A schematic diagram of a device for implementing a method for analyzing opera texts and extracting plot summaries provided 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] It should be noted that, in this article, the terms "include", "comprises" or any other variations thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, an element defined by the sentence "comprises a ..." does not exclude the existence of other identical elements in the process, method, article or device including the element.
[0060] Example 1
[0061] like Figure 1 and Figure 2 As shown, the technology of the present invention implements a method for analyzing opera texts and extracting plot summaries, including:
[0062] The opera text is generated by integrating the contents contained in the time-aligned opera video, audio and script through a preset opera text generation network, and the opera text includes multimodal opera scenes, character activities, and plot content; the opera text is generated by acquiring rich content from multimodal opera content carriers through the opera text generation network.
[0063] The opera text generation network includes: an opera vocal single-mode encoder, an opera audio single-mode encoder, an opera video single-mode encoder, an opera script single-mode encoder, a feedforward network and a modal fusion network. The feedforward network maps the features generated by each single-mode encoder to the same dimension input modal fusion network. The modal fusion network generates an opera text based on content features obtained from a multimodal opera content carrier.
[0064] like Figure 3 As shown, the opera vocal single-mode encoder includes: a vocal audio feature encoder based on a convolutional neural network, a first context network based on a Transformer module, a first quantization module, a semantic temporal classification module based on a linear layer and a softmax layer, and a semantic sequence to sequence classification module based on a GRU, an attention mechanism and a semantic sequence to sequence linear layer.
[0065] The human voice audio feature encoder comprises: stacked multi-channel spatiotemporal one-dimensional convolution, normalization layer and GELU activation function layer, and the human voice audio feature encoder extracts a human voice feature vector sequence from time-aligned opera audio human voice clips.
[0066] The first quantization module compares the human voice feature vector with a codebook vector in a preset first codebook, and outputs an index of the codebook vector closest to the human voice feature vector.
[0067] The first context network acquires the vocal feature vector to learn the contextual connection between the vocal feature vectors so as to be able to predict the contextual representation at the next moment based on the contextual representation of the previous vocal feature vector.
[0068] The training process of the opera vocal single-mode encoder is divided into three stages:
[0069] First, the human voice audio feature encoder and the first context network are trained using unlabeled speech data and the first quantization module. During training, the speech data is input into the human voice audio feature encoder to obtain a human voice feature vector. Before the human voice feature vector is input into the first context network, part of the human voice feature vector is shielded by a random mask. The first context network obtains the predicted context representation of the shielded human voice feature vector based on the preceding features of the shielded human voice feature vector. The loss function used in the training is as follows:
[0070] ,
[0071] ,
[0072] ;
[0073] in, Characterize the human voice feature vector, Represents the corresponding vocal feature vector The first codebook vector of is the total number of codebook vectors in the first codebook, For the codebook vector, is the first heat parameter, is the L2 norm, is the frame count of the vocal feature vector sequence, For the Frame voice feature vector corresponding to codebook vector The probability of To indicate the parameters, The actual codebook vector of the frame voice feature vector is hour, ,otherwise, , is the first loss weight.
[0074] The opera vocal unimodal encoder is trained using speech data annotated with semantic characters. During the training process, a semantic temporal classification module based on a linear layer and a Softmax activation function is introduced after the first context network. The semantic temporal classification module classifies the context representation provided by the first context network to obtain the specific semantics represented by the context representation. The quantization module needs to be removed during training. The loss function for training the semantic temporal classification module is:
[0075] ;
[0076] in, represents the context representation of the vocal feature vector of the tth frame, Represents the semantic character corresponding to the vocal feature vector of the tth frame, The output of the semantic temporal classification module is based on Predicted The initial parameters of the semantic temporal classification module are set through this training process.
[0077] After determining the initial parameters of the semantic temporal classification module, the opera vocal single-mode encoder is trained using pure vocal opera audio data annotated with semantic characters. During the training process, a semantic sequence-to-sequence classification module is introduced after the first context network to cooperate with the semantic temporal classification module. Specifically, a linear layer and a LeakyReLU activation function are added after the first context network. After being processed by the linear layer and the LeakyReLU activation function, the context representation is respectively sent to the semantic temporal classification module and the semantic sequence-to-sequence classification module. The classification results of the semantic temporal classification module and the semantic sequence-to-sequence classification module are weighted to obtain the final opera vocal encoding features.
[0078] The semantic sequence to sequence classification module includes: GRU, attention weight calculation module and semantic sequence to sequence linear layer; GRU is based on Get the hidden state sequence , for the hidden state sequence Each hidden state in the extracts the attention weight and weights it with itself, and the weighted features are input into the semantic sequence to sequence linear layer for semantic classification.
[0079] The loss function for training is:
[0080] ;
[0081] in, , , is the linear layer function, It represents the sequence result after the context representation is processed by the linear layer and the LeakyReLU activation function. ; Based on the output of the time series classification module Predicted The probability of The semantic sequence-to-sequence classification module is based on and The previous prediction results of Predicted The probability of is the weight of the classification result.
[0082] See also Figure 4 As shown in the figure, the structure of the opera audio single-mode encoder is similar to that of the opera vocal single-mode encoder, including:
[0083] An opera audio feature encoder based on a convolutional neural network, wherein the opera audio feature encoder has the same structure as a human voice audio feature encoder.
[0084] A second context network based on the Transformer module;
[0085] The second quantization module; the second quantization module compares the opera audio feature vector extracted by the opera audio feature encoder with the codebook vector in the preset second codebook, and outputs the index of the codebook vector closest to the opera audio feature vector; the second context network obtains the opera audio feature vector to learn the contextual connection between the opera audio feature vectors, so as to be able to predict the contextual representation of the next moment based on the contextual representation of the previous opera audio feature vector.
[0086] A score sequence to sequence classification module, the structure of which is similar to that of the semantic sequence to sequence classification module, including a GRU, an attention weight calculation module and a score sequence to sequence linear layer;
[0087] and,Multilayer Perceptron.
[0088] The training process of the opera audio single-mode encoder is as follows:
[0089] First, the unlabeled opera audio data and the second quantization module are used to train the opera audio feature encoder and the second context network; during training, the opera audio data is input into the opera audio feature encoder to obtain the opera audio feature vector, and before the opera audio feature vector is input into the second context network, part of the opera audio feature vector is shielded by random masking, and the second context network obtains the predicted context representation of the shielded opera audio feature vector based on the preceding features of the shielded opera audio feature vector. The loss function used for training the opera audio feature encoder and the second context network using the unlabeled opera audio data and the second quantization module is as follows:
[0090] ,
[0091] ,
[0092] ;
[0093] in, Characterize the opera audio feature vector, Represents the corresponding opera audio feature vector The second codebook vector of is the total number of codebook vectors in the second codebook, For the codebook vector, is the second heat parameter, is the L2 norm, is the frame count of the opera audio feature vector sequence, For the Frame opera audio feature vector corresponding to codebook vector The probability of To indicate the parameters, The actual codebook vector of the frame opera audio feature vector is hour, ,otherwise, , is the second loss weight.
[0094] The opera audio single-mode encoder is trained using opera audio data with music score annotations and emotional semantic annotations. During the training process, a score sequence to sequence classification module and a multi-layer perceptron are introduced after the second context network. The score sequence to sequence classification module includes: GRU, an attention weight calculation module and a score sequence to sequence linear layer.
[0095] The loss function used to train the opera audio single-mode encoder with opera audio data with music score annotations and emotional semantic annotations is:
[0096] ;
[0097] in, represents a context representation sequence extracted by a second context network; The score sequence to sequence classification module is based on and Prediction results of musical notation annotations of prelude music score Predict the music score notation The probability of It is a multi-layer perceptron based on the concatenation feature of the music sequence to the linear layer output of the sequence Predict emotional semantic labels In the music sequence to sequence classification module, GRU is based on Get the hidden state sequence , for the hidden state sequence After extracting the attention weight from each hidden state, it is weighted with itself, and the weighted features are input into the music score sequence to the sequence linear layer to obtain the musical note features in the music score; the emotional semantic label is predicted based on the fused musical note features through a multi-layer perceptron.
[0098] The musical note features are used as the final opera audio encoding features.
[0099] The opera script single-mode encoder adopts the DeBERTa model, and extracts the opera script encoding features through the DeBERTa model.
[0100] The opera video single-mode encoder adopts a Swin Transformer model trained for opera videos to extract scene information and character action information in the opera videos, and extracts opera video coding features through the Swin Transformer model.
[0101] like Figure 5As shown, the modality fusion network includes: a self-attention Transformer encoder using residual connection corresponding to each modality, a cross-attention Transformer encoder and a feedforward network, the outputs of the cross-attention Transformer encoders of each modality are spliced and input into the feedforward network, the self-attention Transformer encoder, the cross-attention Transformer encoder and the feedforward network are respectively provided with a fusion normalization layer; wherein, the Q value corresponding to any modality in the cross-attention Transformer encoder is obtained by splicing the features of other modalities and multiplying them with the weight matrix. The opera video coding features, opera script coding features, opera vocal coding features and opera audio coding features are processed by self-attention and cross-attention respectively, and then the features are spliced and input into the feedforward network, and the opera text segment is obtained based on the output of the feedforward network, and the opera text segment summarizes the multi-modal opera content.
[0102] The method of training the modal fusion network is as follows: extracting scene information and character action information from the time-aligned opera video through the Swin Transformer model; obtaining the time-aligned opera script content and the emotional semantic annotation of the opera; and summarizing the opera text sample based on the opera script, the emotional semantic annotation of the opera, and the scene information and character action information extracted from the opera video. The opera text sample is processed by the language model to obtain different expressions of the opera text sample, thereby expanding the opera text sample. The modal fusion network is trained using the extended opera text sample as data, so that the modal fusion network learns the knowledge of the opera and the opera text sample on the basis of giving each modal encoding feature. According to the similarity between the key scenes, actions, languages, and emotions between the opera text sample and the output of the modal fusion network, the modal feature encoding given by the modal fusion network is constrained to generate the corresponding opera text content.
[0103] The obtained opera text is segmented according to semantics, and the segmented text content is encoded through the Embedding model to obtain the vector representation of the segmented text content, and the vector representation is combined into a content vector library of the opera text.
[0104] Obtain questions related to the plot summary, encode the question vectors related to the plot summary through the Embedding model, and obtain the opera text vectors that are highly correlated with the questions related to the summary from the vector knowledge base of the opera text through similarity retrieval matching.
[0105] The question vector related to the plot summary and the matched opera text vector are combined to form the LLM language model prompt words, and the LLM language model performs a plot summary based on the content represented by the LLM language model prompt words.
[0106] Example 2
[0107] See also Figure 6 As shown, an embodiment of the present invention provides an apparatus for implementing a method for analyzing opera texts and extracting plot summaries, comprising: at least one processing unit, the processing unit being connected to a storage unit via a bus unit, the storage unit being a computer-readable storage medium, and being used to store software programs, computer executable programs, and modules, such as the software programs, computer executable programs, and modules corresponding to a method for analyzing opera texts and extracting plot summaries in an embodiment of the present invention. The processing unit implements the above-mentioned method for analyzing opera texts and extracting plot summaries by running the software programs, computer executable programs, and modules stored in the storage unit, comprising:
[0108] The opera text is generated by integrating the time-aligned opera video, audio and script content through a preset opera text generation network, wherein the opera text includes multimodal opera scenes, character activities and plot content; the opera text generation network includes: an opera vocal single-mode encoder, an opera audio single-mode encoder, an opera video single-mode encoder, an opera script single-mode encoder, a feedforward network and a modal fusion network, wherein the feedforward network maps the features generated by each single-mode encoder to the same dimension input modal fusion network, and the modal fusion network generates the opera text based on the content features obtained from the multimodal opera content carrier;
[0109] The obtained opera text is segmented according to semantics, and the segmented text content is encoded through the Embedding model to obtain the vector representation of the segmented text content, and the vector representation is used to form a content vector library of the opera text;
[0110] Obtain questions related to the plot summary, encode the question vectors related to the plot summary through the Embedding model, and obtain the opera text vectors that are highly correlated with the questions related to the summary from the vector knowledge base of the opera text through similarity retrieval matching;
[0111] The question vector related to the plot summary and the matched opera text vector are combined to form the LLM language model prompt words, and the LLM language model performs a plot summary based on the content represented by the LLM language model prompt words.
[0112] Of course, the computer program stored in the storage unit of the device for implementing the method for analyzing opera texts and extracting plot summaries provided in the embodiment of the present invention is not limited to the method operations described above, but can also execute related operations in the method for analyzing opera texts and extracting plot summaries provided in any embodiment of the present invention.
[0113] Example 3
[0114] The embodiment of the present invention provides a computer-readable storage medium, wherein the computer-readable storage medium stores a computer program. When the computer program is executed, the method for analyzing opera texts and extracting plot summaries is implemented, including:
[0115] The opera text is generated by integrating the time-aligned opera video, audio and script content through a preset opera text generation network, wherein the opera text includes multimodal opera scenes, character activities and plot content; the opera text generation network includes: an opera vocal single-mode encoder, an opera audio single-mode encoder, an opera video single-mode encoder, an opera script single-mode encoder, a feedforward network and a modal fusion network, wherein the feedforward network maps the features generated by each single-mode encoder to the same dimension input modal fusion network, and the modal fusion network generates the opera text based on the content features obtained from the multimodal opera content carrier;
[0116] The obtained opera text is segmented according to semantics, and the segmented text content is encoded through the Embedding model to obtain the vector representation of the segmented text content, and the vector representation is used to form a content vector library of the opera text;
[0117] Obtain questions related to the plot summary, encode the question vectors related to the plot summary through the Embedding model, and obtain the opera text vectors that are highly correlated with the questions related to the summary from the vector knowledge base of the opera text through similarity retrieval matching;
[0118] The question vector related to the plot summary and the matched opera text vector are combined to form the LLM language model prompt words, and the LLM language model performs a plot summary based on the content represented by the LLM language model prompt words.
[0119] A computer-readable storage medium provided in an embodiment of the present invention stores a computer program which is not limited to the method operations described above, but can also execute related operations in a method for analyzing opera texts and extracting plot summaries provided in any embodiment of the present invention.
[0120] In the embodiments provided by the present invention, it should be understood that the disclosed structures and methods can be implemented in other ways. For example, the structural embodiments described above are only schematic. For example, the division of the units is only a logical function division. There may be other division methods in actual implementation, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be an indirect coupling or communication connection through some interfaces, structures or units, which can be electrical, mechanical or other forms.
[0121] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0122] In addition, each functional unit in each embodiment of the present invention may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of software functional units.
[0123] The foregoing is merely a specific embodiment of the present invention, which enables those skilled in the art to understand or implement the present invention. Various modifications to these embodiments will be apparent to those skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of the present invention. Therefore, the present invention will not be limited to the embodiments shown herein, but rather to the widest scope consistent with the principles and novel features claimed herein.
Claims
1. A method for analyzing opera text and extracting plot summaries, characterized in that: include: The opera text is generated by integrating the multimodal contents of the opera video, audio and script that are time-aligned through a preset opera text generation network, wherein the opera text includes multimodal opera scenes, character activities and plot contents; the opera text generation network includes: an opera vocal single-mode encoder, an opera audio single-mode encoder, an opera video single-mode encoder, an opera script single-mode encoder, a feedforward network and a modal fusion network, wherein the feedforward network maps the features generated by each single-mode encoder to the same dimension input modal fusion network, and the modal fusion network generates the opera text based on the content features obtained from the multimodal opera content carrier; The obtained opera text is segmented according to semantics, and the segmented text content is encoded through the Embedding model to obtain the vector representation of the segmented text content, and the vector representation is used to form a content vector library of the opera text; Obtain questions related to the plot summary, encode the question vectors related to the plot summary through the Embedding model, and obtain the opera text vectors that are highly correlated with the questions related to the summary from the vector knowledge base of the opera text through similarity retrieval matching; The question vector related to the plot summary and the matched opera text vector are combined to form the LLM language model prompt words, and the LLM language model performs a plot summary based on the content represented by the LLM language model prompt words.
2. The method for opera text analysis and plot summary extraction according to claim 1, characterized in that: The opera vocal single-mode encoder comprises: a vocal audio feature encoder based on a convolutional neural network, a first context network based on a Transformer module, a first quantization module, a semantic temporal classification module based on a linear layer and a softmax layer, and a semantic sequence to sequence classification module based on a GRU, an attention mechanism and a semantic sequence to sequence linear layer; The human voice audio feature encoder comprises: a stacked multi-channel spatiotemporal one-dimensional convolution, a normalization layer and a GELU activation function layer, and the human voice audio feature encoder extracts a human voice feature vector from a time-aligned opera audio human voice segment; The first quantization module compares the human voice feature vector with a codebook vector in a preset codebook, and outputs an index of the codebook vector closest to the human voice feature vector; The semantic sequence to sequence classification module includes: GRU, attention weight calculation module and semantic sequence to sequence linear layer.
3. The method for opera text analysis and plot summary extraction according to claim 2, characterized in that: The training process of the opera vocal single-mode encoder includes: The human voice audio feature encoder and the first context network are trained using unlabeled speech data and the first quantization module; during training, the speech data is input into the human voice audio feature encoder to obtain a human voice feature vector, and before the human voice feature vector is input into the first context network, part of the human voice feature vector is shielded by a random mask, and the first context network obtains a predicted context representation of the shielded human voice feature vector based on the preceding features of the shielded human voice feature vector; the loss function used for training the human voice audio feature encoder and the first context network using the unlabeled speech data and the first quantization module is as follows: , , ; in, Characterize the human voice feature vector, Represents the corresponding vocal feature vector The first codebook vector of is the total number of codebook vectors in the first codebook, For the codebook vector, is the first heat parameter, is the L2 norm, is the frame count of the vocal feature vector sequence, For the Frame voice feature vector corresponding to codebook vector The probability of To indicate the parameters, The actual codebook vector of the frame voice feature vector is hour, ,otherwise, , is the first loss weight.
4. The method for opera text analysis and plot summary extraction according to claim 3 is characterized in that: The training process of the opera vocal unimodal encoder includes: training the opera vocal unimodal encoder through the speech data annotated with semantic characters. During the training process, a semantic temporal classification module based on a linear layer and a Softmax activation function is introduced after the first context network. The semantic temporal classification module classifies the context representation provided by the first context network to obtain the specific semantics represented by the context representation. The quantization module needs to be removed during the training. The loss function for training the semantic temporal classification module is: ; in, represents the context representation of the vocal feature vector of the tth frame, Represents the semantic character corresponding to the vocal feature vector of the tth frame, The output of the semantic temporal classification module is based on Predicted The probability of is used to set the initial parameters for the semantic temporal classification module through this training process.
5. The method for opera text analysis and plot summary extraction according to claim 4 is characterized in that: The training process of the opera human voice single-mode encoder includes: after determining the initial parameters of the semantic temporal classification module, the opera human voice single-mode encoder is trained through the pure human voice opera audio data annotated with semantic characters; During the training process, a linear layer and a LeakyReLU activation function are added after the first context network, and the context representation is processed by the linear layer and the LeakyReLU activation function and sent to the semantic temporal classification module and the semantic sequence to sequence classification module respectively, and the classification results of the semantic temporal classification module and the semantic sequence to sequence classification module are weighted to obtain the final opera vocal coding features; The loss function for training is: ; in, , , is the linear layer function, It represents the sequence result after the context representation is processed by the linear layer and the LeakyReLU activation function. The context representation of the vocal feature vector of frames 1 to t; Based on the output of the time series classification module Predicted The probability of The semantic sequence-to-sequence classification module is based on and The previous prediction results of Predicted The probability of is the weight of the classification result.
6. The method for analyzing opera text and extracting plot summaries according to claim 1, characterized in that: The opera audio single-mode encoder includes: an opera audio feature encoder based on a convolutional neural network, a second context network based on a Transformer module, a second quantization module, a score sequence to sequence classification module, and a multi-layer perceptron; The opera audio feature encoder comprises: a stacked multi-channel spatiotemporal one-dimensional convolution, a normalization layer and a GELU activation function layer, and the opera audio feature encoder extracts an opera audio feature vector; The second quantization module compares the opera audio feature vector extracted by the opera audio feature encoder with the codebook vector in the preset second codebook, and outputs the index of the codebook vector closest to the opera audio feature vector; The music score sequence to sequence classification module includes a GRU, an attention weight calculation module and a music score sequence to sequence linear layer.
7. The method for opera text analysis and plot summary extraction according to claim 6, characterized in that: The training process of the opera audio single-mode encoder includes: The unlabeled opera audio data and the second quantization module are used to train the opera audio feature encoder and the second context network; during training, the opera audio data is input into the opera audio feature encoder to obtain the opera audio feature vector, and before the opera audio feature vector is input into the second context network, part of the opera audio feature vector is shielded by a random mask, and the second context network obtains the predicted context representation of the shielded opera audio feature vector based on the preceding features of the shielded opera audio feature vector. The loss function used for training the opera audio feature encoder and the second context network using the unlabeled opera audio data and the second quantization module is as follows: , , ; in, Characterize the feature vector of opera audio, Represents the corresponding opera audio feature vector The second codebook vector of is the total number of codebook vectors in the second codebook, For the codebook vector, is the second heat parameter, is the L2 norm, is the frame count of the opera audio feature vector sequence, For the Frame opera audio feature vector corresponding to codebook vector The probability of To indicate the parameters, The actual codebook vector of the frame opera audio feature vector is hour, ,otherwise, , is the second loss weight.
8. The method for opera text analysis and plot summary extraction according to claim 7, characterized in that: The training process of the opera audio single-mode encoder includes: The single-mode encoder for opera audio is trained by using the opera audio data with music notation and sentiment semantics annotation. During the training process, the music score sequence is introduced into the sequence classification module and the multi-layer perceptron after the second context network. The loss function of training the opera audio single-mode encoder through the opera audio data with music score annotations and emotional semantic annotations is: ; in, represents a context representation sequence extracted by a second context network; The score sequence to sequence classification module is based on and Prediction results of musical notation annotations of prelude music score Predict the music score notation The probability of It is a multi-layer perceptron based on the concatenation feature of the music sequence to the linear layer output of the sequence Predict emotional semantic labels The probability of; In the music sequence to sequence classification module, GRU is based on Get the hidden state sequence , for the hidden state sequence After extracting the attention weight from each hidden state, it is weighted with itself, and the weighted features are input into the music score sequence to the sequence linear layer to obtain the musical note features in the music score; the emotional semantic label is predicted based on the fused musical note features through a multi-layer perceptron.
9. The method for opera text analysis and plot summary extraction according to claim 1, characterized in that: The opera script single-mode encoder adopts the DeBERTa model to extract the opera script encoding features through the DeBERTa model; the opera video single-mode encoder adopts the Swin Transformer model trained for opera videos to extract scene information and character action information in opera videos, and extracts the opera video encoding features through the Swin Transformer model.
10. The method for analyzing opera text and extracting plot summaries according to claim 1, characterized in that: The modality fusion network includes: a self-attention Transformer encoder with residual connection corresponding to each modality, a cross-attention Transformer encoder and a feedforward network, the outputs of the cross-attention Transformer encoders of each modality are spliced and input into the feedforward network, and a fusion normalization layer is set after the self-attention Transformer encoder, the cross-attention Transformer encoder and the feedforward network respectively; wherein, the Q value corresponding to any modality in the cross-attention Transformer encoder is obtained by splicing the features of other modalities and multiplying them with the weight matrix.
Citation Information
Patent Citations
A multivariate semantic fused text abstract automatic generation method and device
CN113609284A
Abstract generation method based on knowledge and semantic information enhancement
CN116595953A
Training method and application of video abstract extraction model fusing multiple modes
CN116778392A
Multi-modal abstract generation method and system based on video and text joint coding
CN117435723A
Training method of abstract generation model and related device
CN117473359A
