A news event context relationship detection method and device

By splicing news events together and using a contextual relationship detection model, the problem of not considering semantic relationships in existing technologies is solved, thus improving the accuracy of news event contextual relationship detection.

CN115510192BActive Publication Date: 2025-11-04太保科技有限公司
View PDF 4 Cites 0 Cited by

Patent Information

Application Number
CN202211228149.6
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-10-09
Publication Date
2025-11-04
Estimated Expiration
2042-10-09

AI Technical Summary

Technical Problem

In existing technologies, news event context detection methods do not consider the semantic meaning of characters and words, as well as the semantic relationships between sentences, resulting in low accuracy of detection results.

Method used

By splicing the first news event and the second news event together, the concatenation detection model is used to detect the spliced ​​news events. The model processes the concatenation through an embedding layer, an encoding layer, a decoding layer and an output layer, and combines an identifier embedding layer, a partitioning layer and an attention masking layer to generate an embedding sequence and perform concatenation detection.

Benefits of technology

It improves the accuracy of news event context detection by utilizing the semantic information of the news events themselves and the interaction information between events to achieve more accurate context detection.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115510192B_ABST
    Figure CN115510192B_ABST
Patent Text Reader

Abstract

The application discloses a news event context relationship detection method and device. In the method, a first news event and a second news event are spliced to obtain a spliced news event; the spliced news event is detected by a context relationship detection model to obtain a first context relationship detection result between the first news event and the second news event; and the context relationship detection model is obtained by training a preset detection network according to each labeled two news event samples and a context relationship label between the two news event samples in a plurality of news event samples. It can be seen that the method utilizes semantic information of the news event itself and interaction information between the news events, can more accurately detect the context relationship between the news events, and thus improves the accuracy of the context relationship detection result of the news event.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the technical field of natural language processing, and particularly relates to a news event context relationship detection method and device. BACKGROUND

[0002] With the rapid development of information technology, various news events emerge in an endless stream, and there is a context relationship between multiple news events, such as a correlation relationship, a cause-effect relationship, a time sequence relationship and a correlative relationship between news events, and detecting whether the news events have a context relationship is conducive to analyzing and judging the news events.

[0003] In the prior art, a news event context relationship detection method is as follows: first, performing news event segmentation based on character and word levels; then, performing frequency statistics on characters and words, taking the frequency and repetition degree of simultaneous appearance of characters and words as a matching standard for context relationship detection; and finally, calculating the text similarity of news events, so as to determine whether the news events have a context relationship according to the similarity of the news events.

[0004] However, in the above news event context relationship detection method, characters and words are independent of each other, and in the process of detecting the context relationship of news events, the semantic meanings of characters and words are not considered, nor are the semantic relationships between sentences and words, and the representation of information interaction between news events is also lacking, which is prone to detection errors, resulting in low accuracy of the news event context relationship detection result. SUMMARY

[0005] Therefore, the embodiments of the present application provide a news event context relationship detection method and device, aiming to improve the accuracy of the news event context relationship detection result.

[0006] In a first aspect, the embodiments of the present application provide a news event context relationship detection method, which comprises:

[0007] splicing the first news event and the second news event to obtain a spliced news event;

[0008] detecting the spliced news event by a context relationship detection model to obtain a first context relationship detection result between the first news event and the second news event; the context relationship detection model is obtained by training a preset detection network according to each labeled two news event samples and a context relationship label between the two news event samples in multiple news event samples.

[0009] Optionally, the context relationship detection model comprises an embedding layer, an encoding layer, a decoding layer and an output layer.

[0010] The first context relationship detection result between the first news event and the second news event is obtained by detecting the spliced news event through the context relationship detection model, and the first context relationship detection result comprises:

[0011] The embedding sequence is obtained by converting the spliced news event through the embedding layer.

[0012] The context relationship representation sequence is obtained by encoding the embedding sequence through the encoding layer.

[0013] The context relationship detection sequence is obtained by decoding the context relationship representation sequence through the decoding layer.

[0014] The first context relationship detection result is obtained by normalizing the context relationship detection sequence through the output layer.

[0015] Optionally, the embedding layer comprises an identity embedding layer, a partition layer and an attention masking layer.

[0016] The embedding sequence is obtained by converting the spliced news event through the embedding layer, and the embedding sequence comprises:

[0017] The identity information is obtained by converting the characters in the spliced news event through the identity embedding layer.

[0018] The partition position information is obtained by marking the first news event and the second news event in the spliced news event through the partition layer.

[0019] The attention position information is obtained by marking the spliced news event through the attention masking layer.

[0020] The embedding sequence is obtained by superimposing the identity information, the partition position information and the attention position information.

[0021] Optionally, the training step of the context relationship detection model comprises:

[0022] The plurality of news event samples and the context relationship labels between each of the plurality of news event samples are obtained.

[0023] The two news event samples are spliced to obtain a spliced news event sample.

[0024] The second context relationship detection result between the two news event samples is obtained by detecting the spliced news event sample through the preset detection network.

[0025] According to the second context relationship detection result, the context relationship label, and a loss function of the preset detection network, parameters of the preset detection network are trained.

[0026] The trained preset detection network is determined as the context relationship detection model.

[0027] Optionally, the context relationship detection model is specifically N context relationship detection models, and a training step of the N context relationship detection models comprises:

[0028] The plurality of news event samples are evenly divided into M news event samples, M≥2;

[0029] Each of the M news event samples is taken as a verification set, and the remaining M-1 news event samples except the verification set are taken as a training set corresponding to the verification set, so as to determine M training sets and M verification sets corresponding to the M training sets;

[0030] According to each of the two labeled news event samples in the M training sets and the context relationship label between the two news event samples, N preset detection networks are trained respectively, so as to obtain N trained preset detection networks, N>2, and N is an odd number;

[0031] The N trained preset detection networks are verified according to the M verification sets, so as to obtain N context relationship detection models.

[0032] Optionally, the detecting the spliced news event by the context relationship detection model to obtain the first context relationship detection result between the first news event and the second news event comprises:

[0033] The N context relationship detection models are used to detect the spliced news event respectively, so as to obtain N third context relationship detection results between the first news event and the second news event;

[0034] The N third context relationship detection results are voted, so as to obtain the first context relationship detection result.

[0035] Optionally, before the first news event and the second news event are spliced to obtain the spliced news event, the method further comprises:

[0036] The first news event and the second news event are preprocessed respectively, so as to obtain a preprocessed first news event and a preprocessed second news event;

[0037] The first news event and the second news event are spliced to obtain the spliced news event.

[0038] splicing the preprocessed first news event and the preprocessed second news event to obtain the spliced news event.

[0039] Optionally, the preprocessing the first news event and the second news event respectively to obtain the preprocessed first news event and the preprocessed second news event comprises:

[0040] performing word segmentation processing on the first news event and the second news event respectively to obtain a plurality of first news word segments and a plurality of second news word segments;

[0041] performing stop word removal processing on the plurality of first news word segments and the plurality of second news word segments respectively to obtain the preprocessed first news event and the preprocessed second news event.

[0042] In a second aspect, an embodiment of the present application provides a news event context relationship detection device, the device comprising:

[0043] a splicing module configured to splice a first news event and a second news event to obtain a spliced news event;

[0044] a detection module configured to detect the spliced news event by using a context relationship detection model to obtain a first context relationship detection result between the first news event and the second news event; the context relationship detection model is obtained by training a preset detection network according to each labeled two news event samples and a context relationship label between the two news event samples in a plurality of news event samples.

[0045] In a third aspect, an embodiment of the present application provides a news event context relationship detection device, the device comprising:

[0046] a memory configured to store a computer program;

[0047] a processor configured to execute the computer program to enable the device to perform the news event context relationship detection method of the first aspect.

[0048] In a fourth aspect, an embodiment of the present application provides a computer storage medium, and the computer readable storage medium stores a computer program, when the computer program is executed, the device running the computer program implements the news event context relationship detection method of the first aspect.

[0049] Compared with the prior art, the embodiments of the present application have the following beneficial effects:

[0050] The embodiment of the application provides a news event context relationship detection method, splices a first news event and a second news event to obtain a spliced news event; the spliced news event is detected through a context relationship detection model to obtain a first context relationship detection result between the first news event and the second news event; the context relationship detection model is obtained according to a plurality of news event samples, each labeled two news event samples and a context relationship label between the two news event samples, and a preset detection network. It can be seen that the method splices the first news event and the second news event to obtain the spliced news event, and then detects the context relationship of the spliced news event, utilizes semantic information of the news event itself and interaction information between the news events, can more accurately detect the context relationship between the news events, and thus improves the accuracy of the news event context relationship detection result. BRIEF DESCRIPTION OF DRAWINGS

[0051] To make the technical solution in the present embodiment or prior art clearer, the drawings needed to be used in the embodiment or prior art description will be briefly introduced as follows. Obviously, the drawings in the following description are only some embodiments of the present application, and other drawings can be obtained by those skilled in the art without any creative effort on the basis of these drawings.

[0052] Figure 1 An application scenario of the news event context relationship detection method provided by the embodiment of the present application;

[0053] Figure 2 A flowchart of the news event context relationship detection method provided by the embodiment of the present application;

[0054] Figure 3 A flowchart of the training method of the N context relationship detection model provided by the embodiment of the present application;

[0055] Figure 4 A structural schematic diagram of the news event context relationship detection device provided by the embodiment of the present application. DETAILED DESCRIPTION

[0056] In order to make the technical personnel in the technical field better understand the present application, the technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the drawings in the embodiments of the present application. Obviously, the described embodiments are only some of the embodiments of the present application, but not all the embodiments. Based on the embodiments in the present application, all other embodiments obtained by those skilled in the art without any creative effort fall within the scope of the present application.

[0057] Currently, the news event context relationship detection method in the prior art is as follows: first, news events are segmented based on character and word levels; then, frequency statistics of characters and words are performed, and the frequency and repetition degree of simultaneous appearance of characters and words are taken as the matching standard for context relationship detection; finally, the text similarity of news events is calculated, so as to determine whether the news events have a context relationship according to the similarity of the news events. However, in the above-mentioned news event context relationship detection method, since characters and words are independent of each other, the semantic meanings of the characters and words themselves are not considered, and the semantic relationship between sentences and words is not considered, and the representation of information interaction between news events is also lacking, which is prone to detection errors, resulting in low accuracy of the news event context relationship detection result.

[0058] Based on this, in order to solve the above problems and improve the accuracy of the news event context relationship detection result, the embodiments of the present application provide a news event context relationship detection method and device, in which the first news event and the second news event are spliced to obtain a spliced news event; the spliced news event is detected by a context relationship detection model to obtain a first context relationship detection result between the first news event and the second news event; and the context relationship detection model is obtained by training a preset detection network according to each labeled two news event samples and the context relationship label between the two news event samples in a plurality of news event samples. It can be seen that the method splices the first news event and the second news event to obtain a spliced news event, and then detects the context relationship of the spliced news event, which not only utilizes the semantic information of the news event itself, but also utilizes the interaction information between the news events, and can more accurately detect the context relationship between the news events, thereby improving the accuracy of the news event context relationship detection result.

[0059] For example, one of the scenarios of the embodiments of the present application can be applied to the scenario as shown in FIG. 1. Figure 1 The scenario includes a database 101 and a server 102, wherein the database 101 includes a first news event and a second news event, and the server 102 adopts the embodiments provided by the embodiments of the present application to obtain the first news event and the second news event from the database 101.

[0060] First, in the above-mentioned application scenario, although the actions of the embodiments provided by the embodiments of the present application are executed by the server 102; however, the embodiments of the present application are not limited in terms of execution subject, as long as the actions disclosed by the embodiments provided by the embodiments of the present application are executed.

[0061] Secondly, the above-mentioned scenario is only one scenario example provided by the embodiments of the present application, and the embodiments of the present application are not limited to this scenario.

[0062] With reference to the accompanying drawings, the specific implementation manners of the news event context relationship detection method and device in the embodiments of the present application will be described in detail through embodiments.

[0063] Referring to Figure 2 , the figure is a flowchart of a news event context relationship detection method provided by the embodiments of the present application, and as shown in Figure 2 , the specific implementation can include:

[0064] S201: splice the first news event and the second news event to obtain a spliced news event.

[0065] The first news event and the second news event that need to be detected for the context relationship are spliced to obtain a spliced news event, so as to detect the context relationship between the first news event and the second news event subsequently.

[0066] For example, the spliced news event obtained by splicing the first news event and the second news event can be represented as “[CLS][first news event][SEP][second news event][SEP]”, wherein “CLS” represents the first position of the text of the spliced news event, and “SEP” represents a mark used to separate the first news event and the second news event. Of course, other manners can also be adopted, which does not affect the implementation of the embodiments of the present application.

[0067] In addition, the text of the news event can have the problem of too long text, or there are some meaningless words in the text, so before splicing the first news event and the second news event, the first news event and the second news event can be preprocessed respectively. Therefore, in the optional embodiments of the present application, the method can further include S1: preprocessing the first news event and the second news event respectively to obtain the preprocessed first news event and the preprocessed second news event. Correspondingly, S201 can specifically include: splicing the preprocessed first news event and the preprocessed second news event to obtain a spliced news event. Wherein, after preprocessing the first news event and the second news event respectively and then splicing, the semantic features of the first news event and the second news event can be amplified to some extent, and some non-key texts can be removed, so as to detect the context relationship between the first news event and the second news event in the subsequent steps, and further improve the accuracy of the news event context relationship detection result.

[0068] Wherein, the preprocessing process of the first news event and the second news event in the embodiments of the present application can not be specifically limited, and for the convenience of understanding, a possible implementation manner will be described below.

[0069] In a possible implementation, the first news event and the second news event can be subjected to word segmentation processing to obtain first news word segmentation corresponding to the first news event and second news word segmentation corresponding to the second news event. On the basis of the word segmentation processing of the first news event and the second news event, the first news word segmentation and the second news word segmentation are subjected to stop word removal processing respectively to obtain the first news event and the second news event after the meaningless information is removed, and on this basis, the preprocessed first news event and the preprocessed second news event are obtained. Therefore, S1 can specifically include: subjecting the first news event and the second news event to word segmentation processing respectively to obtain a plurality of first news word segmentations and a plurality of second news word segmentations; and subjecting the plurality of first news word segmentations and the plurality of second news word segmentations to stop word removal processing respectively to obtain the preprocessed first news event and the preprocessed second news event.

[0070] For example, when the first news event and the second news event are subjected to word segmentation processing, the jieba word segmentation tool, the HanLP word segmentation tool, or the FoolNLTK word segmentation tool can be used. Of course, other Chinese word segmentation tools can also be used, and this does not affect the implementation of the embodiments of the present application. When the first news word segmentation and the second news word segmentation are subjected to stop word removal processing, the Harbin Institute of Technology stop word table, the Baidu stop word table, or the Chinese stop word table can be used to traverse and remove the stop words in the first news word segmentation and the second news word segmentation corresponding to the stop word table used, so as to obtain the preprocessed first news event and the preprocessed second news event. Of course, other stop word tables can also be used, and this does not affect the implementation of the embodiments of the present application.

[0071] S202: detecting the splicing news event by using the context relationship detection model to obtain a first context relationship detection result between the first news event and the second news event; the context relationship detection model is obtained by training a preset detection network according to each labeled two news event samples and the context relationship label between the two news event samples in the plurality of news event samples.

[0072] The splicing news event obtained by splicing the first news event and the second news event is input into the context relationship detection model to detect the context relationship between the first news event and the second news event, and obtain a first context relationship detection result between the first news event and the second news event. The context relationship detection model is obtained by training a preset detection network according to each labeled context relationship label of two news event samples and the context relationship label between the two news event samples in the plurality of news event samples.

[0073] In the embodiments of the present application, the structure of the context relationship detection model can not be specifically limited. In order to facilitate understanding, a possible implementation is described below.

[0074] In a possible implementation, the structure of the context relationship detection model can specifically include an embedding layer, an encoding layer, a decoding layer, and an output layer. The spliced news event obtained by splicing the first news event and the second news event can be converted by the embedding layer first to obtain an embedding sequence corresponding to the spliced news event, so as to detect the embedding sequence by the context relationship detection model; then the embedding sequence is encoded by the encoding layer to obtain a context relationship representation sequence with semantic and context relationship representation between news events; then the context relationship representation sequence is decoded by the decoding layer to obtain a context relationship detection sequence containing context relationship detection result information; finally, the context relationship detection sequence is further normalized by the output layer to obtain the first context relationship detection result, so as to output the context relationship detection result between the first news event and the second news event.

[0075] Therefore, step S202 can specifically include: converting the spliced news event by the embedding layer to obtain an embedding sequence; encoding the embedding sequence by the encoding layer to obtain a context relationship representation sequence; decoding the context relationship representation sequence by the decoding layer to obtain a context relationship detection sequence; and normalizing the context relationship detection sequence by the output layer to obtain the first context relationship detection result.

[0076] For example, the encoding layer can encode based on a bidirectional encoder of the Transformer to obtain the context relationship representation sequence with the semantic of the first news event, the semantic of the second news event, and the context relationship representation between the first news event and the second news event; and the decoding layer can decode based on a fully connected neural network to compress the context relationship representation sequence to the context relationship detection sequence containing the context relationship detection result information. Of course, the above can also be implemented in other ways, which do not affect the implementation of the embodiments of the present application.

[0077] In the above, the structure of the embedding layer is not limited in the embodiments of the present application, and for the convenience of understanding, a possible implementation is described as follows.

[0078] In a possible implementation, the structure of the embedding layer can specifically include an identification embedding layer, a partition layer, and an attention masking layer. The characters in the spliced news event can be first converted by the identification embedding layer to obtain identification information corresponding to each character in the spliced news event; then the first news event and the second news event in the spliced news event can be marked by the partition layer to obtain different partition position information corresponding to the first news event and the second news event respectively; then the spliced news event can be marked by the attention masking layer to obtain attention position information corresponding to the spliced news event; finally, the identification information, the partition position information, and the attention position information corresponding to the spliced news event can be superimposed at the same position to obtain an embedding sequence, so as to detect the embedding sequence by using the context relationship detection model.

[0079] Therefore, the spliced news event is converted by the embedding layer to obtain the embedding sequence, which can specifically include: converting the characters in the spliced news event by the identification embedding layer to obtain identification information; marking the first news event and the second news event in the spliced news event by the partition layer to obtain partition position information; marking the spliced news event by the attention masking layer to obtain attention position information; and superimposing the identification information, the partition position information, and the attention position information to obtain the embedding sequence.

[0080] For example, the identification embedding layer can convert each character in the spliced news event into corresponding identification information based on the character table of the BERT model; the partition layer can mark each character in the first news event in the spliced news event as 0 and each character in the second news event in the spliced news event as 1 to realize the hierarchical division of the first news event and the second news event and obtain the partition position information; and the attention masking layer can mark only the position corresponding to the spliced news event as 1 and mark the other positions as 0 to obtain the attention position information. Of course, the above-mentioned methods can also be used in other ways, which do not affect the implementation of the embodiments of the present application.

[0081] In the embodiments of the present application, the training process of the context relationship detection model can not be specifically limited, and the following will be described in combination with a possible implementation.

[0082] In a possible implementation, a plurality of news event samples and a plurality of context relationship labels between each of the labeled two news event samples in the plurality of news event samples can be obtained; then, the two news events of each labeled context relationship label are spliced to obtain spliced news events; then, the spliced news events are detected by using a preset detection network to obtain a second context relationship detection result between the two news events of each labeled context relationship label; then, parameters of the preset detection network are trained according to the second context relationship detection result between the two news events of each labeled context relationship label, the context relationship label between each of the labeled two news events, and a loss function of the preset detection network, and the trained parameters of the preset detection network are saved; finally, the trained preset detection network is determined as the context relationship detection model.

[0083] Therefore, the context relationship detection model can be trained by the following steps: obtaining a plurality of news event samples and a plurality of context relationship labels between each of the labeled two news event samples in the plurality of news event samples; splicing the two news event samples to obtain spliced news event samples; detecting the spliced news event samples by using a preset detection network to obtain a second context relationship detection result between the two news event samples; training parameters of the preset detection network according to the second context relationship detection result, the context relationship label, and a loss function of the preset detection network; and determining the trained preset detection network as the context relationship detection model.

[0084] In the embodiments of the present application, the context relationship detection model can specifically be N context relationship detection models, and the training process of the N context relationship detection models can not be specifically limited. For ease of understanding, a possible implementation is described below. For technical details, please refer to the introduction made below.

[0085] Correspondingly, in a possible implementation, the N context relationship detection models obtained can be used to respectively detect the spliced news events to obtain N third context relationship detection results respectively corresponding to the N context relationship detection models, and then the N third context relationship detection results are voted to obtain the first context relationship detection result. Therefore, step S202 can specifically include: detecting the spliced news events by using the N context relationship detection models respectively to obtain N third context relationship detection results between the first news event and the second news event, and voting the N third context relationship detection results to obtain the first context relationship detection result.

[0086] Based on the related content of S201-S202, in the embodiment of the application, the first news event and the second news event are spliced to obtain a spliced news event; the spliced news event is detected by using a context relationship detection model to obtain a first context relationship detection result between the first news event and the second news event; and the context relationship detection model is obtained by training a preset detection network according to each labeled two news event samples and the context relationship label between the two news event samples in the plurality of news event samples. By splicing the first news event and the second news event to obtain the spliced news event, and then detecting the context relationship of the spliced news event, the semantic information of the news event itself and the interaction information between the news events are utilized, the context relationship between the news events can be more accurately detected, and the accuracy of the context relationship detection result of the news event is improved.

[0087] Referring to Figure 3 The figure is a flowchart of a training method of N context relationship detection models provided by an embodiment of the application, which is combined with Figure 3 As shown in the figure, the method can specifically include the following steps:

[0088] S301: The plurality of news event samples are evenly divided into M news event samples, M≥2.

[0089] For example, the plurality of obtained news event samples can be evenly divided into 6 news event samples. Of course, they can also be evenly divided into other parts, which does not affect the implementation of the embodiment of the application.

[0090] S302: Each of the M news event samples is taken as a verification set, and the remaining M-1 news event samples except the verification set are taken as a training set corresponding to the verification set, to determine M training sets and M verification sets corresponding to the M training sets.

[0091] For example, after the plurality of news event samples are evenly divided into 6 news event samples, each of the news event samples is taken as a verification set, and the remaining 5 news event samples except the verification set in the 6 news event samples are taken as a training set corresponding to the verification set. Based on this, 6 training sets and 6 verification sets corresponding to the 6 training sets can be determined. Of course, M can also be other values, which does not affect the implementation of the embodiment of the application.

[0092] S303: According to the context relationship label between each labeled two news event samples in the M training sets, N preset detection networks are trained respectively to obtain N trained preset detection networks, N>2, and N is an odd number.

[0093] For example, after determining 6 training sets and 6 validation sets corresponding to the 6 training sets, 5 preset detection networks can be trained respectively by using the two labeled news event samples in each of the 6 training sets and the context relationship label between the two news event samples. Each preset detection network is trained 6 times according to the 6 training sets, and 5 trained preset detection networks are obtained. Of course, N can also be other values, which does not affect the implementation of the embodiments of the present application.

[0094] wherein the number of preset detection networks is odd, so as to subsequently vote the N third context relationship detection results between the first news event and the second news event obtained by the N context relationship detection models to obtain the first context relationship detection result.

[0095] For example, the 5 preset detection networks can respectively adopt 5 different pre-training models, specifically including a BERT model, an ELECTRA model, an ERNIE model, an ALBERT model and a RoBERTa model. Of course, other preset detection networks can also be used, which does not affect the implementation of the embodiments of the present application.

[0096] S304: verifying the N trained preset detection networks according to the M validation sets to obtain N context relationship detection models.

[0097] For example, the 5 trained preset detection networks can be verified respectively according to the 6 validation sets corresponding to the 6 training sets obtained in the above steps. Each preset detection network is verified 6 times according to the 6 validation sets, and the preset detection network parameters of each verified preset detection network corresponding to the 6 validation sets are saved as fold1-fold6 to obtain 5 context relationship detection models. In order to subsequently detect the spliced news event by using the 5 context relationship detection models, each context relationship detection model detects the spliced news event by using the saved 6 model parameters fold1-fold6 to obtain 6 context relationship detection results. Then, the 6 context relationship detection results corresponding to each context relationship detection model can be averaged to obtain 5 third context relationship detection results of the 5 context relationship detection models. Of course, other methods can also be used, which does not affect the implementation of the embodiments of the present application.

[0098] Based on the related content of S301-S304, in the embodiment of the present application, the N context relationship detection models are trained in this way. The M different training corpora are generated according to the multiple news event samples in one corpus, so that the preset training network is free from the dependence on training with a large-scale corpus. The N preset detection networks with different initial parameters are trained to obtain the N context relationship detection models, so that the more accurate context relationship detection result between the first news event and the second news event is further obtained according to the N third context relationship detection results, and the accuracy of the news event context relationship detection result is further improved.

[0099] The above are some specific implementation manners of the news event context relationship detection method provided by the embodiment of the present application. Based on this, the present application further provides a corresponding device. The device provided by the embodiment of the present application will be introduced from the perspective of functional modularization.

[0100] Referring to Figure 4 The figure is a structural schematic diagram of a news event context relationship detection device 400 provided by the embodiment of the present application. The device 400 can include:

[0101] The splicing module 401 is configured to splice the first news event and the second news event to obtain a spliced news event.

[0102] The detection module 402 is configured to detect the spliced news event by a context relationship detection model to obtain a first context relationship detection result between the first news event and the second news event. The context relationship detection model is obtained by training a preset detection network according to each labeled two news event samples and the context relationship label between the two news event samples in the multiple news event samples.

[0103] In the embodiment of the present application, the first news event and the second news event are spliced by the splicing module 401 and the detection module 402 to obtain a spliced news event, and then the context relationship of the spliced news event is detected. The semantic information of the news event itself and the interaction information between the news events are utilized, the context relationship between the news events can be more accurately detected, and the accuracy of the news event context relationship detection result is improved.

[0104] As an implementation manner, the context relationship detection model in the detection module 402 can specifically include an embedding layer, an encoding layer, a decoding layer and an output layer.

[0105] Correspondingly, the detection module 402 can specifically include:

[0106] The conversion unit is configured to convert the spliced news event by the embedding layer to obtain an embedding sequence.

[0107] an encoding unit, configured to encode the embedding sequence by using an encoding layer to obtain a vein relationship representation sequence;

[0108] a decoding unit, configured to decode the vein relationship representation sequence by using a decoding layer to obtain a vein relationship detection sequence;

[0109] a normalization unit, configured to normalize the vein relationship detection sequence by using an output layer to obtain a first vein relationship detection result.

[0110] As an implementation form, the embedding layer of the vein relationship detection model in the detection module 402 can specifically include an identifier embedding layer, a partition layer and an attention masking layer.

[0111] Correspondingly, the conversion unit can be specifically configured to:

[0112] convert the characters in the spliced news event by using the identifier embedding layer to obtain identifier information;

[0113] mark the first news event and the second news event in the spliced news event by using the partition layer to obtain partition position information;

[0114] mark the spliced news event by using the attention masking layer to obtain attention position information;

[0115] superimpose the identifier information, the partition position information and the attention position information to obtain the embedding sequence.

[0116] As an implementation form, the vein relationship detection model in the detection module 402 can be specifically trained by using the following units.

[0117] an acquisition unit, configured to acquire a plurality of news event samples and vein relationship labels between each labeled two news event samples in the plurality of news event samples;

[0118] a splicing unit, configured to splice the two news event samples to obtain a spliced news event sample;

[0119] a first detection unit, configured to detect the spliced news event sample by using a preset detection network to obtain a second vein relationship detection result between the two news event samples.

[0120] a first training unit, configured to train parameters of the preset detection network according to the second vein relationship detection result, the vein relationship label and a loss function of the preset detection network;

[0121] a first determination unit, configured to determine the trained preset detection network as the vein relationship detection model.

[0122] As an implementation form, the context relationship detection model in the detection module 402 specifically refers to N context relationship detection models, and the N context relationship detection models can be specifically trained by the following units:

[0123] The equal division unit is configured to divide the plurality of news event samples into M news event samples, where M is greater than or equal to 2.

[0124] The second determination unit is configured to take each of the M news event samples as a verification set, take the remaining M-1 news event samples other than the verification set as a training set corresponding to the verification set, and determine M training sets and M verification sets corresponding to the M training sets.

[0125] The second training unit is configured to train the N preset detection networks respectively according to the two labeled news event samples in each of the M training sets and the context relationship label between the two news event samples, and obtain N preset detection networks after training, where N is greater than 2 and N is an odd number.

[0126] The obtaining unit is configured to verify the N preset detection networks after training respectively according to the M verification sets, and obtain N context relationship detection models.

[0127] As an implementation form, the detection module 402 specifically can include:

[0128] The second detection unit is configured to detect the spliced news event by the N context relationship detection models, and obtain N third context relationship detection results between the first news event and the second news event.

[0129] The voting unit is configured to vote on the N third context relationship detection results, and obtain a first context relationship detection result.

[0130] As an implementation form, the news event context relationship detection device can further include:

[0131] The preprocessing module is configured to preprocess the first news event and the second news event respectively, and obtain a preprocessed first news event and a preprocessed second news event.

[0132] Correspondingly, the splicing module 401 can be specifically configured to:

[0133] Splice the preprocessed first news event and the preprocessed second news event to obtain a spliced news event.

[0134] As an implementation form, the preprocessing module specifically can include:

[0135] The word segmentation unit is configured to perform word segmentation on the first news event and the second news event respectively to obtain a plurality of first news word segments and a plurality of second news word segments.

[0136] The stop word removing unit is configured to perform stop word removing on the plurality of first news word segments and the plurality of second news word segments respectively to obtain a preprocessed first news event and a preprocessed second news event.

[0137] The present application also provides a corresponding device and a computer storage medium for implementing the scheme provided by the present application.

[0138] The device includes a memory and a processor. The memory is configured to store instructions or codes. The processor is configured to execute the instructions or codes to enable the device to perform the news event context relationship detection method provided by any of the embodiments of the present application.

[0139] The computer storage medium stores codes. When the codes are executed, the device running the codes implements the news event context relationship detection method provided by any of the embodiments of the present application.

[0140] The "first" and "second" in the names mentioned in the embodiments of the present application are only used for name identification, and do not represent the first and second in order.

[0141] From the above description of the embodiments, those skilled in the art can clearly understand that all or part of the steps in the above-mentioned embodiment methods can be implemented by means of software plus a general hardware platform. Based on this understanding, the technical solutions of the present application can be embodied in the form of a software product. The computer software product can be stored in a storage medium, such as a read-only memory (English: read-only memory, ROM) / RAM, a magnetic disc, an optical disc, etc., and includes a plurality of instructions for enabling a computer device (which can be a personal computer, a server, or a network communication device such as a router) to execute the methods described in the various embodiments or some parts of the embodiments of the present application.

[0142] It should be noted that each of the embodiments of the present specification is described in a progressive manner, and the same or similar parts between each embodiment can be understood by referring to each other, and each embodiment focuses on the difference from other embodiments. In particular, for the device embodiments, since they are basically similar to the method embodiments, they are described more simply, and the relevant parts can be understood by referring to the part of the method embodiments. The device embodiments described above are only schematic, and the units described as separate components can or can not be physically separate, and the components indicated as units can or can not be physical units, that is, they can be located in one place, or distributed on multiple network units. Part or all of the modules can be selected to achieve the purpose of the embodiments according to the actual needs. Those skilled in the art can understand and implement it without creative labor.

[0143] The above is only a specific embodiment of the present application, but the protection scope of the present application is not limited to this. Any skilled person in the art can easily think of changes or replacements within the technical range disclosed in the present application, which should be covered within the protection scope of the present application. Therefore, the protection scope of the present application should be subject to the protection scope of the claims.

Claims

1. A method for detecting the context of news events, characterized in that, The method includes: By splicing the first news event and the second news event together, a spliced ​​news event is obtained. The spliced ​​news events are detected using a contextual relationship detection model to obtain a first contextual relationship detection result between the first news event and the second news event; the contextual relationship detection model is obtained by training a preset detection network based on each of the two labeled news event samples in multiple news event samples and the contextual relationship labels between the two news event samples; The context relationship detection model includes an embedding layer, an encoding layer, a decoding layer, and an output layer; The step of detecting the spliced ​​news events using a contextual relationship detection model to obtain a first contextual relationship detection result between the first news event and the second news event includes: The spliced ​​news events are transformed through the embedding layer to obtain an embedded sequence; The embedded sequence is encoded by the coding layer to obtain a contextual relationship representation sequence; The first context relationship detection sequence is obtained by decoding the context relationship representation sequence through the decoding layer. The first context relationship detection sequence is normalized through the output layer to obtain the first context relationship detection result; The embedding layer includes an identifier embedding layer, a partitioning layer, and an attention masking layer; The process of converting the spliced ​​news event through the embedding layer to obtain the embedded sequence includes: The characters in the spliced ​​news event are converted using the identifier embedding layer to obtain identifier information. The first news event and the second news event in the spliced ​​news event are partitioned and marked by the partitioning layer to obtain partition location information; Attention location information is obtained by marking the spliced ​​news events using the attention masking layer. The embedding sequence is obtained by superimposing the identification information, the partition location information, and the attention location information.

2. The method of claim 1, wherein, The training steps of the context relationship detection model include: Obtain the multiple news event samples and the relationship tags between each pair of labeled news event samples in the multiple news event samples; The two news event samples are spliced ​​together to obtain a spliced ​​news event sample; The spliced ​​news event samples are detected by the preset detection network to obtain the second contextual relationship detection result between the two news event samples; Based on the second context relationship detection result, the context relationship label, and the loss function of the preset detection network, the parameters of the preset detection network are trained. The trained preset detection network is determined as the context relationship detection model.

3. The method of claim 1, wherein, The network relationship detection model specifically comprises N network relationship detection models, and the training steps for the N network relationship detection models include: The multiple news event samples are divided into M news event samples of equal value, where M ≥ 2; respectively as a validation set, and the remaining M-1 news event samples except the validation set as a training set corresponding to the validation set, to determine M training sets and M validation sets corresponding to the M training sets; respectively according to each of the two labeled news event samples in the M training sets and the context relationship label between the two news event samples, to train N preset detection networks respectively, to obtain N trained preset detection networks, N>2, N is an odd number; respectively according to the M validation sets, to verify the N trained preset detection networks, to obtain N context relationship detection models.

4. The method of claim 3, wherein, The detection of the spliced news event by the context relationship detection model to obtain the first context relationship detection result between the first news event and the second news event includes: detecting the spliced news event by N context relationship detection models respectively to obtain N third context relationship detection results between the first news event and the second news event; voting on the N third context relationship detection results to obtain the first context relationship detection result.

5. The method of claim 1, wherein, Before the first news event and the second news event are spliced to obtain the spliced news event, the method further includes: respectively preprocessing the first news event and the second news event to obtain a preprocessed first news event and a preprocessed second news event; The splicing of the first news event and the second news event to obtain the spliced news event includes: splicing the preprocessed first news event and the preprocessed second news event to obtain the spliced news event.

6. The method of claim 5, wherein, The preprocessing of the first news event and the second news event respectively to obtain the preprocessed first news event and the preprocessed second news event includes: respectively performing word segmentation processing on the first news event and the second news event to obtain a plurality of first news segmentations and a plurality of second news segmentations; respectively performing stop word removal processing on the plurality of first news segmentations and the plurality of second news segmentations to obtain the preprocessed first news event and the preprocessed second news event.

7. A news event thread relationship detecting apparatus characterized by comprising: The device includes: a splicing module configured to splice a first news event and a second news event to obtain a spliced news event; a detection module configured to detect the spliced news event by a context relationship detection model to obtain a first context relationship detection result between the first news event and the second news event; the context relationship detection model is obtained by training a preset detection network according to each of two labeled news event samples in a plurality of news event samples and a context relationship label between the two news event samples; The context relationship detection model in the detection module can specifically include an embedding layer, an encoding layer, a decoding layer, and an output layer. Correspondingly, the detection module can specifically include: a conversion unit configured to convert the spliced news event by the embedding layer to obtain an embedding sequence; An encoding unit is configured to encode the embedding sequence by using an encoding layer to obtain a context relation representation sequence; A decoding unit is configured to decode the context relation representation sequence by using a decoding layer to obtain a context relation detection sequence; A normalization unit is configured to normalize the context relation detection sequence by using an output layer to obtain a first context relation detection result; The embedding layer of the context relation detection model in the detection module can specifically include an identifier embedding layer, a partition layer, and an attention masking layer. Correspondingly, the conversion unit can be specifically configured to: convert the characters in the spliced news event by using the identifier embedding layer to obtain identifier information; mark the first news event and the second news event in the spliced news event by using the partition layer to obtain partition position information; mark the spliced news event by using the attention masking layer to obtain attention position information; superimpose the identifier information, the partition position information, and the attention position information to obtain the embedding sequence.

8. A news event thread relationship detecting apparatus characterized by comprising: The device comprises: a memory configured to store a computer program; a processor configured to execute the computer program to enable the device to perform the steps of the news event context relation detection method according to any one of claims 1 to 6.

Citation Information

Patent Citations

  • Rumor detection method, system and storage medium based on learning model

    CN109471932A

  • Entity relationship extraction method based on attention neural network

    CN112818124A

  • Event relation determination method and device

    CN113254628A

  • Story venation construction method and device, electronic equipment and storage medium

    CN115033668A