Methods, devices, electronic devices and storage media for determining topic tags
By generating high-quality topic labels using a dual-attention neural network model, the problem of insufficient interpretation of topic labels in existing technologies is solved, thereby improving scoring accuracy and reducing cognitive overhead.
Patent Information
- Application Number
- CN202110676141.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-06-18
- Publication Date
- 2026-11-17
- Estimated Expiration
- 2041-06-18
AI Technical Summary
In existing technologies, topic tags are too short to fully explain the topic, resulting in high cognitive overhead in interpreting topic discovery terms.
A dual-attention neural network model is adopted to determine the selection probability of each sentence through positive attention scoring and negative attention scoring. High-quality topic tags are generated by using multi-head self-attention mechanism and long short-term memory network (LSTM) mechanism.
It significantly improved the quality and scoring accuracy of topic tags, and reduced the cognitive overhead of topic discovery.
Smart Images

Figure CN115496060B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of natural language processing technology, and in particular to a method, apparatus, electronic device, and storage medium for determining topic tags. Background Technology
[0002] Topic modeling is a crucial technique in natural language processing (such as information retrieval and text mining). In existing techniques, discovered topics are typically represented by a series of topic words with marginal probabilities. However, these topic word-based labels are often too short to adequately explain the topics, and even if the word distribution is intuitive, it's difficult to grasp the true meaning of a topic and the distinctions between them. Therefore, interpreting the terminology used in topic discovery incurs high cognitive overhead. Summary of the Invention
[0003] This invention provides a method, apparatus, electronic device, and storage medium for determining topic tags, in order to reduce the cognitive overhead of topic discovery terms.
[0004] This invention provides a method for determining topic tags, comprising: obtaining a set of target candidate sentences for a target topic; inputting the set of target candidate sentences into a dual-attention neural network model to obtain topic tags for the target topic, wherein the sentences in the topic tags are a subset of sentences in the set of target candidate sentences; wherein the dual-attention neural network model is trained based on candidate sentence sets for different topics, and the dual-attention neural network model is used to determine the selection probability of each sentence based on the positive attention score and negative attention score of the target candidate sentence set.
[0005] According to the present invention, a method for determining topic tags is provided, wherein the dual-attention neural network model is specifically used for: generating tensor sets by performing context embedding encoding on sentences in the target candidate sentence set; extracting topic features from each sentence tensor in the tensor set; determining a positive attention score and a negative attention score for each sentence tensor based on the topic features, wherein the positive attention score is used to evaluate the inclusiveness of the sentence and the negative attention score is used to evaluate the mutual exclusivity of the sentence; determining the selection probability of each sentence based on the positive attention score and the negative attention score; and determining the topic tag of the target topic based on the topic tag length of the target topic and the selection probability.
[0006] According to the topic tag determination method provided by the present invention, the step of determining the positive attention score and negative attention score of each sentence tensor based on the topic features includes: inputting the topic features into a positive attention scoring model to obtain a positive score vector of the sentence tensor, and inputting the topic features into a negative attention scoring model to obtain a negative score vector of the sentence tensor; determining the positive attention score of the tensor set based on the relevance vector value between the target candidate sentence set and the target topic, and determining the negative attention score of the tensor set based on the positive score vector.
[0007] According to the topic tag determination method provided by the present invention, the positive attention scoring model and the negative attention scoring model adopt a multi-head self-attention mechanism.
[0008] According to the topic label determination method provided by the present invention, the positive attention scoring model and the negative attention scoring model adopt the Long Short-Term Memory (LSTM) network mechanism.
[0009] The present invention also provides a topic tag determination device, comprising: an acquisition module and a processing module; the acquisition module is used to acquire a set of target candidate sentences for a target topic; the processing module is used to input the set of target candidate sentences into a dual-attention neural network model to obtain topic tags for the target topic, wherein the sentences in the topic tags are some sentences in the set of target candidate sentences; wherein the dual-attention neural network model is trained based on candidate sentence sets for different topics, and the dual-attention neural network model is used to determine the selection probability of each sentence based on the positive attention score and negative attention score of the target candidate sentence set.
[0010] According to the present invention, a topic tag determination device is provided, wherein the dual-attention neural network model is specifically used for: generating tensor sets by performing context embedding encoding on sentences in the target candidate sentence set; extracting topic features from each sentence tensor in the tensor set; determining a positive attention score and a negative attention score for each sentence tensor based on the topic features, wherein the positive attention score is used to evaluate the inclusiveness of the sentence and the negative attention score is used to evaluate the mutual exclusivity of the sentence; determining the selection probability of each sentence based on the positive attention score and the negative attention score; and determining the topic tag of the target topic based on the topic tag length of the target topic and the selection probability.
[0011] According to the present invention, a topic label determination device is provided, wherein the dual attention neural network model is specifically used for: inputting the topic features into a positive attention scoring model to obtain a positive score vector of the sentence tensor, inputting the topic features into a negative attention scoring model to obtain a negative score vector of the sentence tensor; determining a positive attention score of the tensor set based on the relevance vector value between the target candidate sentence set and the target topic, and determining a negative attention score of the tensor set based on the positive score vector.
[0012] According to the present invention, a topic tag determination device is provided in which the positive attention scoring model and the negative attention scoring model employ a multi-head self-attention mechanism.
[0013] According to the present invention, a topic label determination device is provided in which the positive attention scoring model and the negative attention scoring model employ a long short-term memory network (LSTM) mechanism.
[0014] The present invention also provides an electronic device, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the program to implement the steps of the topic tag determination method described above.
[0015] The present invention also provides a non-transitory computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the steps of the topic tag determination method as described above.
[0016] This invention provides a method, apparatus, electronic device, and storage medium for determining topic tags. The dual-attention neural network model can determine the selection probability of each sentence based on the positive attention score and negative attention score of the target candidate sentence set. Since sentences can be scored simultaneously from two opposite directions of attention, the most representative and inclusive sentences win more reward scores, while irrelevant or unimportant sentences suffer the highest penalty scores. Therefore, the scoring accuracy of the model can be significantly improved, thereby improving the quality of topic tags. Attached Figure Description
[0017] To more clearly illustrate the technical solutions in this invention or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are some embodiments of this invention. For those skilled in the art, other drawings can be obtained from these drawings without creative effort.
[0018] Figure 1 This is one of the flowcharts illustrating the topic tag determination method provided by the present invention;
[0019] Figure 2This is a schematic diagram of the structure of the dual attention neural network model provided by the present invention;
[0020] Figure 3 This is a schematic diagram of the multi-head self-attention structure provided by the present invention;
[0021] Figure 4 This is a schematic diagram of the Long Short-Term Memory (LSTM) network structure provided by the present invention;
[0022] Figure 5 This is a schematic diagram illustrating the determination of sentence selection probability and topic tag determination provided by the present invention;
[0023] Figure 6 This is a schematic diagram of the structure of the topic tag determining device provided by the present invention;
[0024] Figure 7 This is a schematic diagram of the structure of the electronic device provided by the present invention. Detailed Implementation
[0025] To make the objectives, technical solutions, and advantages of this invention clearer, the technical solutions of this invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some, not all, of the embodiments of this invention. All other embodiments obtained by those skilled in the art based on the embodiments of this invention without creative effort are within the scope of protection of this invention.
[0026] It should be noted that in the embodiments of the present invention, the terms "exemplary" or "for example" are used to indicate that they are examples, illustrations, or descriptions. Any embodiment or design that is described as "exemplary" or "for example" in the embodiments of the present invention should not be construed as being more preferred or advantageous than other embodiments or design options. Specifically, the use of terms such as "exemplary" or "for example" is intended to present the relevant concepts in a specific manner.
[0027] It should be noted that, in this document, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Without further limitations, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes that element. Furthermore, it should be noted that the scope of the methods and apparatuses in the embodiments of the present invention is not limited to performing functions in the order shown or discussed, but may also include performing functions substantially simultaneously or in the reverse order, depending on the functions involved. For example, the described methods may be performed in a different order than described, and various steps may be added, omitted, or combined. Additionally, features described with reference to certain examples may be combined in other examples.
[0028] To facilitate a clear description of the technical solutions of the embodiments of the present invention, the terms "first" and "second" are used in the embodiments of the present invention to distinguish the same or similar items with essentially the same function and effect. Those skilled in the art can understand that the terms "first" and "second" are not intended to limit the quantity or execution order.
[0029] The embodiments of the present invention have been described for illustrative purposes. It should be understood that the present invention may be implemented in other ways not specifically shown in the accompanying drawings.
[0030] The above implementation method will be described in detail below with reference to specific embodiments and accompanying drawings.
[0031] like Figure 1 As shown, this embodiment of the invention provides a topic tag determination method, which can be applied to a topic tag determination device. The topic tag determination method may include steps S101 and S102:
[0032] S101, The topic label determination device obtains a set of target candidate sentences for the target topic.
[0033] The aforementioned target candidate sentence set can be a set of candidate sentences corresponding to the target topic input by the user. This target candidate sentence set can include multiple candidate sentences.
[0034] S102. The topic tag determination device inputs the target candidate sentence set into a dual attention neural network model to obtain the topic tags of the target topic.
[0035] The sentences in the aforementioned topic tags are a subset of the target candidate sentence set; the aforementioned dual-attention neural network model is trained based on candidate sentence sets of different topics, and this dual-attention neural network model is used to determine the selection probability of each sentence based on the positive attention score and negative attention score of the target candidate sentence set.
[0036] like Figure 2 As shown, the aforementioned dual-attention neural network model can be divided into an encoding layer, an extraction layer, and a summarizing layer from bottom to top. The encoding layer encodes the input set of target candidate sentences, specifically by performing context embedding encoding on each sentence in the target candidate sentence set to generate a tensor set. For example, it encodes N candidate sentences [S1, S2, ..., S...] from the target candidate sentence set. N After context embedding encoding, the tensor set X = [X1, X2, ..., X...] is obtained. N [N is a positive integer]. Next, the topic features of each sentence tensor in the tensor set can be extracted through the extraction layer. That is, features related to the target topic are extracted from the tensor set output by the encoding layer, and noise is filtered out, thus obtaining a high-quality sentence feature tensor. Then, the output of the extraction layer (topic features) is submitted to the summarization layer. The top-level summarization layer is a dual-attention recurrent neural network that operates at the document level. Positive attention and negative attention can score candidate sentences from two opposing directions. The summarization layer can determine the positive attention score and negative attention score for each sentence tensor. The positive attention score is used to evaluate the inclusiveness of the sentence, and the negative attention score is used to evaluate the mutual exclusivity of the sentence.
[0037] Optionally, the process by which the topic labeling device determines the positive and negative attention scores for each sentence tensor may include: inputting the topic features obtained through the extraction layer into the Positive Attention model to obtain a positive score vector for the sentence tensor, and inputting the topic features into the Negative Attention model to obtain a negative score vector for the sentence tensor; then, based on the relevance vector values between the target candidate sentence set and the target topic, determining the positive attention score for the tensor set according to the positive score vector, and determining the negative attention score for the tensor set according to the negative score vector. The positive attention score can be represented as PosAttention = [Att(X...] i ) 正 ,(1 / KLD)*X i The negative attention score can be represented as NegAttention = [Att(X)]. i ) 负 ,KLD*X i ]; where Att(X i ) 正 Let Att(X) be a positive score vector.i ) 负 is the negative score vector, i is any one of (1, N), and KLD is the relevance vector value between the target candidate sentence set and the target topic.
[0038] Optional, such as Figure 3 As shown, the above positive attention scoring model and negative attention scoring model can employ a multi-head self-attention mechanism. This multi-head self-attention mechanism consists of two layers, both of which are transformer encoders. When the input X... i After identifying the topic features, the positive score vector MultiHead(X) can be obtained. i ) 正 Or negative score vector MultiHead(X) i ) 负 Therefore, the positive attention score can be expressed as PosAttention = [MultiHead(X... i ) 正 ,(1 / KLD)*X i The negative attention score can be represented as NegAttention = [MultiHead(X)] i ) 负 ,KLD*X i ].
[0039] Optional, such as Figure 4 As shown, the above positive attention scoring model and negative attention scoring model can employ the Long Short-Term Memory (LSTM) network mechanism. This LSTM mechanism includes an LSTM neural network, with input... Xi After identifying the subject characteristics, we can obtain the forward and backward hidden states [h]. f ,h b ] and output, then according to the algorithm Feature(X i )=matmul(DropOut(softmax(matmul(X i ,[h f ,h b ]))),output)for hidden state[h f ,h b The feature(X) is obtained by processing the output and the output. i Therefore, the positive attention score can be expressed as PosAttention = [Feature(X)]. i ) 正 ,(1 / KLD)*X i Negative attention score can be represented as NegAttention = [Feature(X)] i )负 ,KLD*X i ].
[0040] like Figure 5 As shown, after determining the positive attention score and the negative attention score, the topic label determination device can determine the selection probability of each sentence based on the positive attention score and the negative attention score. Specifically, to reduce the fitting difficulty and the risk of overfitting, and to accelerate the convergence speed of the model, linear transformation, Dorpout, and Layer Normalization operations can be performed on sentence Xi to obtain the weights of positive attention and negative attention, respectively. i ))=W o (LN(DropOut(W f Att(X i )+b f )))+b o Then, the topic tagging device can determine the topic tags of the target topic based on the topic tag length and sentence selection probability. Specifically, after passing through the sigmoid activation function, the probability of selecting the i-th sentence can be obtained. Then, based on the length of the topic tags for the target topic, select the first k sentences as the topic tags for the target topic.
[0041] It should be noted that during the training of the dual-attention neural network model, in order to optimize the summarization layer, the loss function that can be used is specific to the golden tag Y. i The Binary Classification Entropy is described by the equation as follows: Among them, Y i ∈{0,1} is the sentence S in this set. i The ground-true tag, Y i =1 indicates that the sentence S is selected. i As the sentence in the final hashtag, Y i =0 indicates that sentence S was not selected. i The sentence will be used as the final hashtag.
[0042] In this embodiment of the invention, the dual-attention neural network model can determine the selection probability of each sentence based on the positive attention score and negative attention score of the target candidate sentence set. Since sentences can be scored simultaneously from two opposite directions of attention, the most representative and inclusive sentences win more reward scores, while irrelevant or unimportant sentences suffer the highest penalty scores. Therefore, the scoring accuracy of the model can be significantly improved, thereby improving the quality of topic tags.
[0043] The foregoing mainly describes the solutions provided by the embodiments of the present invention from a methodological perspective. To achieve the above functions, it includes corresponding hardware structures and / or software modules for executing each function. Those skilled in the art should readily recognize that, in conjunction with the units and algorithm steps of the various examples described in the embodiments disclosed herein, the embodiments of the present invention can be implemented in hardware or a combination of hardware and computer software. Whether a function is executed in hardware or by computer software driving hardware depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of the present invention.
[0044] The topic tag determination method provided in this embodiment of the invention can be executed by a topic tag determination device or a control module for topic tag determination within that device. This embodiment of the invention uses a topic tag determination device executing the topic tag determination method as an example to illustrate the topic tag determination device provided in this embodiment of the invention.
[0045] It should be noted that, according to the above method examples, the topic tag determining device can be divided into functional modules in the embodiments of the present invention. For example, each function can be divided into its own functional modules, or two or more functions can be integrated into one processing module. The integrated modules can be implemented in hardware or as software functional modules. Optionally, the module division in the embodiments of the present invention is illustrative and only represents one logical functional division; in actual implementation, there may be other division methods.
[0046] like Figure 6 As shown, this embodiment of the invention provides a topic tag determination device 600. The topic tag determination device 600 includes an acquisition module 601 and a processing module 602. The acquisition module 601 is used to acquire a set of target candidate sentences for a target topic; the processing module 602 is used to input the set of target candidate sentences into a dual-attention neural network model to obtain topic tags for the target topic, wherein the sentences in the topic tags are a subset of sentences in the set of target candidate sentences; wherein the dual-attention neural network model is trained based on candidate sentence sets for different topics, and the dual-attention neural network model is used to determine the selection probability of each sentence based on the positive attention score and negative attention score of the target candidate sentence set.
[0047] Optionally, the aforementioned dual-attention neural network model is specifically used for: generating tensor sets by performing context embedding encoding on the sentences in the target candidate sentence set; extracting topic features from each sentence tensor in the tensor set; determining a positive attention score and a negative attention score for each sentence tensor based on the topic features, wherein the positive attention score is used to evaluate the inclusiveness of the sentence and the negative attention score is used to evaluate the mutual exclusivity of the sentence; determining the selection probability of each sentence based on the positive attention score and the negative attention score; and determining the topic label of the target topic based on the topic label length of the target topic and the selection probability.
[0048] Optionally, the above dual-attention neural network model is specifically used for: inputting the topic features into a positive attention scoring model to obtain a positive score vector of the sentence tensor, inputting the topic features into a negative attention scoring model to obtain a negative score vector of the sentence tensor; determining the positive attention score of the tensor set based on the relevance vector value between the target candidate sentence set and the target topic, and determining the negative attention score of the tensor set based on the positive score vector.
[0049] Optionally, the above positive attention scoring model and the negative attention scoring model employ a multi-head self-attention mechanism.
[0050] Optionally, the above positive attention scoring model and the negative attention scoring model employ the Long Short-Term Memory (LSTM) network mechanism.
[0051] In this embodiment of the invention, the dual-attention neural network model can determine the selection probability of each sentence based on the positive attention score and negative attention score of the target candidate sentence set. Since sentences can be scored simultaneously from two opposite directions of attention, the most representative and inclusive sentences win more reward scores, while irrelevant or unimportant sentences suffer the highest penalty scores. Therefore, the scoring accuracy of the model can be significantly improved, thereby improving the quality of topic tags.
[0052] Figure 7 An example is a schematic diagram of the physical structure of an electronic device, such as... Figure 7As shown, the electronic device may include a processor 1010, a communications interface 1020, a memory 1030, and a communication bus 1040, wherein the processor 1010, the communications interface 1020, and the memory 1030 communicate with each other via the communication bus 1040. The processor 1010 can call logical instructions in the memory 1030 to execute a topic tag determination method, which includes: obtaining a set of target candidate sentences for a target topic; inputting the set of target candidate sentences into a dual-attention neural network model to obtain topic tags for the target topic, wherein the sentences in the topic tags are a subset of sentences in the set of target candidate sentences; wherein the dual-attention neural network model is trained based on candidate sentence sets for different topics, and the dual-attention neural network model is used to determine the selection probability of each sentence based on the positive attention score and negative attention score of the target candidate sentence set.
[0053] Furthermore, the logical instructions in the aforementioned memory 1030 can be implemented as software functional units and, when sold or used as independent products, can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention, or the part that contributes to the prior art, or a part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of the present invention. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.
[0054] On the other hand, the present invention also provides a computer program product, the computer program product comprising a computer program stored on a non-transitory computer-readable storage medium, the computer program comprising program instructions, wherein when the program instructions are executed by a computer, the computer is able to execute the topic tag determination method provided by the above methods, the method comprising: obtaining a set of target candidate sentences for a target topic; inputting the set of target candidate sentences into a dual-attention neural network model to obtain topic tags for the target topic, wherein the sentences in the topic tags are a subset of sentences in the set of target candidate sentences; wherein the dual-attention neural network model is trained based on candidate sentence sets for different topics, and the dual-attention neural network model is used to determine the selection probability of each sentence based on the positive attention score and negative attention score of the target candidate sentence set.
[0055] In another aspect, the present invention also provides a non-transitory computer-readable storage medium storing a computer program thereon, which, when executed by a processor, implements the aforementioned topic tag determination methods. The method includes: acquiring a set of target candidate sentences for a target topic; inputting the set of target candidate sentences into a dual-attention neural network model to obtain topic tags for the target topic, wherein sentences in the topic tags are a subset of sentences in the set of target candidate sentences; wherein the dual-attention neural network model is trained based on candidate sentence sets for different topics, and the dual-attention neural network model is used to determine the selection probability of each sentence based on the positive attention score and negative attention score of the target candidate sentence set.
[0056] The device embodiments described above are merely illustrative. The units described as separate components may or may not be physically separate, and the components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the modules can be selected to achieve the purpose of this embodiment according to actual needs. Those skilled in the art can understand and implement this without any creative effort.
[0057] Through the above description of the embodiments, those skilled in the art can clearly understand that each embodiment can be implemented by means of software plus necessary general-purpose hardware platforms, and of course, it can also be implemented by hardware. Based on this understanding, the above technical solutions, in essence or the part that contributes to the prior art, can be embodied in the form of a software product. This computer software product can be stored in a computer-readable storage medium, such as ROM / RAM, magnetic disk, optical disk, etc., and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute the methods described in the various embodiments or some parts of the embodiments.
[0058] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, and not to limit them; although the present invention has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some of the technical features; and these modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of the present invention.
Claims
1. A method for determining topic tags, characterized in that, include: Obtain the set of target candidate sentences for the target topic; The target candidate sentence set is input into a dual attention neural network model to obtain topic labels for the target topic, and the sentences in the topic labels are a subset of the sentences in the target candidate sentence set. The dual attention neural network model is trained based on a set of candidate sentences on different topics. The dual attention neural network model is used to determine the selection probability of each sentence based on the positive attention score and negative attention score of the target candidate sentence set. Specifically, the dual attention neural network model is used for: Each sentence in the target candidate sentence set is generated into a tensor set by performing context embedding encoding on the sentences; Extract the topic features of each sentence tensor in the tensor set; Based on the aforementioned topic features, a positive attention score and a negative attention score are determined for each sentence tensor. The positive attention score is used to evaluate the inclusiveness of the sentence, and the negative attention score is used to evaluate the mutual exclusivity of the sentence. The selection probability of each sentence is determined based on the positive attention score and the negative attention score; The topic tags of the target topic are determined based on the topic tag length of the target topic and the selection probability; The step of determining the selection probability of each sentence based on the positive attention score and the negative attention score includes: Based on the positive attention score and the negative attention score, the weights of positive attention and negative attention are calculated through linear transformation, Dropout, and layer normalization operations, respectively, and the selection probability of each sentence is calculated through the sigmoid activation function.
2. The topic tag determination method according to claim 1, characterized in that, The step of determining the positive attention score and negative attention score for each sentence tensor based on the topic features includes: The topic features are input into the positive attention scoring model to obtain the positive score vector of the sentence tensor, and the topic features are input into the negative attention scoring model to obtain the negative score vector of the sentence tensor. Based on the relevance vector values between the target candidate sentence set and the target topic, the positive attention score of the tensor set is determined according to the positive score vector, and the negative attention score of the tensor set is determined according to the negative score vector.
3. The method for determining topic tags according to claim 2, characterized in that, The positive attention scoring model and the negative attention scoring model employ a multi-head self-attention mechanism.
4. The topic tag determination method according to claim 2, characterized in that, The positive attention scoring model and the negative attention scoring model employ the Long Short-Term Memory (LSTM) network mechanism.
5. A topic tag determining device, characterized in that, include: Acquisition module and processing module; The acquisition module is used to acquire a set of target candidate sentences for the target topic; The processing module is used to input the target candidate sentence set into a dual attention neural network model to obtain the topic tags of the target topic, wherein the sentences in the topic tags are a portion of the sentences in the target candidate sentence set; The dual attention neural network model is trained based on a set of candidate sentences on different topics. The dual attention neural network model is used to determine the selection probability of each sentence based on the positive attention score and negative attention score of the target candidate sentence set. Specifically, the dual-attention neural network model is used to: generate tensor sets by performing context embedding encoding on each sentence in the target candidate sentence set; extract topic features from each sentence tensor in the tensor set; determine a positive attention score and a negative attention score for each sentence tensor based on the topic features, wherein the positive attention score is used to evaluate the inclusiveness of the sentence and the negative attention score is used to evaluate the mutual exclusivity of the sentences; determine the selection probability of each sentence based on the positive attention score and the negative attention score; and determine the topic label of the target topic based on the topic label length of the target topic and the selection probability. The step of determining the selection probability of each sentence based on the positive attention score and the negative attention score includes: Based on the positive attention score and the negative attention score, the weights of positive attention and negative attention are calculated through linear transformation, Dropout, and layer normalization operations, respectively, and the selection probability of each sentence is calculated through the sigmoid activation function.
6. The topic tag determining device according to claim 5, characterized in that, The dual-attention neural network model is specifically used for: inputting the topic features into a positive attention scoring model to obtain a positive score vector of the sentence tensor, inputting the topic features into a negative attention scoring model to obtain a negative score vector of the sentence tensor; determining the positive attention score of the tensor set based on the relevance vector value between the target candidate sentence set and the target topic, and determining the negative attention score of the tensor set based on the positive score vector.
7. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that, When the processor executes the program, it implements the steps in the topic tag determination method as described in any one of claims 1 to 4.
8. A non-transitory computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by a processor, it implements the steps in the topic tag determination method as described in any one of claims 1 to 4.
Citation Information
Patent Citations
Method for classifying text
CN104285224A
Text abstract automatic generation method and system based on global feature extraction
CN112559730A
