Text detection method, electronic equipment, storage medium and program product

By obtaining relevant text from the fact library and knowledge library, text enhancement and fusion, and generating fusion detection text, the problem of low text detection accuracy in the prior art is solved, and higher detection accuracy and robustness are achieved.

CN119783031APending Publication Date: 2025-04-08INDUSTRIAL AND COMMERCIAL BANK OF CHINA
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411917767.0
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-12-24
Publication Date
2025-04-08

AI Technical Summary

Technical Problem

The accuracy of text detection in the prior art is low, mainly because the news timeliness and direct correlation between entity knowledge and news events are ignored.

Method used

By obtaining the text to be detected, and recalling the target publishing text in the same field as it is from the fact library, the target description text corresponding to the key entity is retrieved from the knowledge base, text enhancement of the text to be detected, the enhanced detection text is fused with the target publishing text, generating the fusion detection text, and finally testing is performed based on the fusion detection text.

Benefits of technology

Through the fusion of multi-dimensional information sources, the model's understanding of entity background knowledge is enhanced, the accuracy and robustness of detection are improved, and the problem of low accuracy of Chinese text detection is solved.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119783031A_ABST
    Figure CN119783031A_ABST
Patent Text Reader

Abstract

The invention discloses a text detection method, electronic equipment, a storage medium and a program product. The method comprises the steps that a to-be-detected text is acquired, and a target published text belonging to the same field as the to-be-detected text is called from a fact library; a target description text corresponding to the at least one key entity is called from a knowledge base, text enhancement is conducted on the to-be-detected text based on the target description text, an enhanced detection text is obtained, and description texts of different key entities are stored in the knowledge base; the enhanced detection text and the target release text are fused to obtain a fused detection text, and the fused detection text is used for describing the authenticity judgment basis of the at least one key entity; and detecting the to-be-detected text based on the fusion detection text to obtain a detection result. Through the method and the device, the problem of low text detection accuracy in related technologies is solved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of artificial intelligence, and specifically, to a text detection method, electronic device, storage medium and program product. Background Art

[0002] With the popularization of the Internet, social media has become an important platform for information dissemination, but it has also spawned a large amount of false news, posing a threat to economic stability and public judgment. Traditional detection methods rely on feature analysis of news texts and user behavior patterns, but lack the ability to deeply compare news content with financial common sense and authoritative information, and are not interpretable enough.

[0003] In recent years, researchers have used technologies such as knowledge graphs, graph convolutional neural networks, and attention mechanisms to achieve a deep understanding of news texts and accurate comparisons with external knowledge such as expert knowledge. However, most methods ignore the timeliness of news and the direct relationship between entity knowledge and news events when integrating knowledge, which limits the accuracy and robustness of the detection method, resulting in low accuracy of text detection in related technologies.

[0004] Currently, no effective solution has been proposed to address the problem of low text detection accuracy in related technologies. Summary of the invention

[0005] The main purpose of this application is to provide a text detection method, electronic device, storage medium and program product to solve the problem of low accuracy of text detection in related technologies.

[0006] In order to achieve the above-mentioned purpose, according to one aspect of the present application, a text detection method is provided. The method comprises: obtaining a text to be detected, and retrieving a target published text belonging to the same field as the text to be detected from a fact database, wherein the text to be detected includes at least one key entity, and the fact database stores published texts used to describe real events; retrieving a target description text corresponding to at least one key entity from a knowledge database, and performing text enhancement on the text to be detected based on the target description text to obtain an enhanced detection text, and the knowledge database stores description texts of different key entities; fusing the enhanced detection text and the target published text to obtain a fused detection text, wherein the fused detection text is used to describe the authenticity judgment basis of at least one key entity; and detecting the text to be detected based on the fused detection text to obtain a detection result, wherein the detection result is used to indicate whether the text to be detected is a text describing a real event.

[0007] Furthermore, text enhancement is performed on the text to be detected based on the target description text to obtain enhanced detection text, including: obtaining the text structure of the text to be detected and the entity position of at least one key entity in the text structure; constructing a mask matrix of at least one key entity based on the text structure and the entity position, wherein the mask matrix is ​​used to mark text information that affects the key entity in the text to be detected; and text enhancement is performed on the text to be detected based on the mask matrix and the target description text to obtain enhanced detection text.

[0008] Furthermore, text enhancement is performed on the text to be detected based on the mask matrix and the target description text to obtain enhanced detection text, including: determining associated text associated with at least one key entity in the target description text based on the mask matrix; and text enhancement is performed on the text to be detected based on the associated text to obtain enhanced detection text.

[0009] Furthermore, text enhancement is performed on the text to be detected based on the associated text to obtain enhanced detection text, including: creating an initial tree structure with at least one key entity in the text to be detected as the root node, and using the associated text as a child node; based on the association strength between at least one key entity and the associated text, embedding the child node into the branch corresponding to the root node in the initial tree structure to obtain a target tree structure; embedding the associated text into the text to be detected based on the traversal order of the target tree structure to obtain enhanced detection text.

[0010] Furthermore, the associated text is embedded into the text to be detected based on the traversal order of the target tree structure to obtain enhanced detection text, including: position encoding the text fields in the text to be detected to obtain position encoding information of the text to be detected; based on the position encoding information, the associated text is embedded into the text to be detected in the traversal order to obtain enhanced detection text.

[0011] Furthermore, the text to be detected is detected based on the fused detection text to obtain a detection result, including: inputting the fused detection text into a text detection model, using the text detection model to detect the text to be detected, and obtaining a detection result, wherein the text detection model is trained based on sample fused detection text and sample detection results.

[0012] Furthermore, a target published text belonging to the same field as the text to be detected is retrieved from the fact base, including: retrieving at least one preset published text belonging to the same field as the text to be detected from the fact base; and determining the target published text based on the similarity between the text to be detected and the at least one preset published text.

[0013] In order to achieve the above-mentioned purpose, according to another aspect of the present application, a text detection device is provided. The device comprises: an acquisition module, which is used to acquire the text to be detected, and retrieve the target published text belonging to the same field as the text to be detected from the fact base, wherein the text to be detected includes at least one key entity, and the fact base stores the published text used to describe real events; an enhancement module, which is used to retrieve the target description text corresponding to at least one key entity from the knowledge base, and perform text enhancement on the text to be detected based on the target description text to obtain the enhanced detection text, and the knowledge base stores the description texts of different key entities; a fusion module, which is used to fuse the enhanced detection text and the target published text to obtain the fused detection text, wherein the fused detection text is used to describe the authenticity judgment basis of at least one key entity; a detection module, which is used to detect the text to be detected based on the fused detection text to obtain the detection result, wherein the detection result is used to indicate whether the text to be detected is a text describing a real event.

[0014] In order to achieve the above-mentioned purpose, according to another aspect of the present application, an electronic device is provided, comprising: a memory storing an executable program; and a processor for running the program, wherein the above-mentioned text enhancement method is executed when the program is running.

[0015] In order to achieve the above-mentioned purpose, according to another aspect of the present application, a computer-readable storage medium is provided, wherein the computer-readable storage medium includes a stored executable program, wherein when the executable program is running, the device where the computer-readable storage medium is located is controlled to execute the above-mentioned text enhancement method.

[0016] In order to achieve the above-mentioned purpose, according to another aspect of the present application, a computer program product is provided, including a computer program, and the computer program implements the above-mentioned text enhancement method when executed by a processor.

[0017] In the embodiment of the present application, firstly, the target published text belonging to the same field as the text to be detected is retrieved from the fact base; then the target description text corresponding to at least one key entity is retrieved from the knowledge base, and the text to be detected is enhanced based on the target description text to obtain an enhanced detection text; then the enhanced detection text is fused with the target published text to obtain a fused detection text; finally, the text to be detected is detected based on the fused detection text to obtain a detection result. It is easy to notice that the present application contains information sources of two dimensions, the fact base and the knowledge base. On this basis, the text to be detected is first obtained, and the target published text is retrieved from the fact base and the target description text is retrieved from the knowledge base respectively; then the target description text is used to enhance the text to be detected to obtain an enhanced detection text; then the enhanced detection text is fused with the target published text to obtain a fused detection text; finally, the text to be detected is detected based on the fused detection text to obtain a detection result. In the above process, by obtaining multi-dimensional information sources, the entity description, domain knowledge and expert knowledge are fused, the judgment basis of the model is enhanced, and the model is ensured to understand the background knowledge of the entity, thereby achieving the technical purpose of improving the detection accuracy, and thus solving the technical problem of low accuracy of text detection in related technologies. BRIEF DESCRIPTION OF THE DRAWINGS

[0018] The drawings constituting a part of the present application are used to provide a further understanding of the present application. The illustrative embodiments and descriptions of the present application are used to explain the present application and do not constitute an improper limitation on the present application. In the drawings:

[0019] Figure 1 A hardware structure block diagram of a computer terminal for implementing a text detection method is shown;

[0020] Figure 2 is a flowchart of a text detection method according to an embodiment of the present application;

[0021] Figure 3 is an overall framework diagram of a text detection method according to an embodiment of the present application;

[0022] Figure 4 is a schematic diagram of a knowledge enhancement conversion module according to an embodiment of the present application;

[0023] Figure 5 is a schematic diagram of a tree structure according to an embodiment of the present application;

[0024] Figure 6 is a schematic diagram of a position encoding of a text to be detected according to an embodiment of the present application;

[0025] Figure 7 is a schematic diagram of hard position coding of a text to be detected according to an embodiment of the present application;

[0026] Figure 8 is a schematic diagram of soft position coding of a text to be detected according to an embodiment of the present application;

[0027] Fig. 9 is a schematic diagram of a text detection device according to an embodiment of the present application;

[0028] Fig.10 It is a structural block diagram of an electronic device according to an embodiment of the present application. DETAILED DESCRIPTION

[0029] In order to enable those skilled in the art to better understand the solution of the present application, the technical solution in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work should fall within the scope of protection of the present application.

[0030] It should be noted that the terms "first", "second", etc. in the specification and claims of the present application and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchangeable where appropriate, so that the embodiments of the present application described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "including" and "having" and any of their variations are intended to cover non-exclusive inclusions, for example, a process, method, system, product or device comprising a series of steps or units is not necessarily limited to those steps or units clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.

[0031] First, some nouns or terms that appear in the description of the embodiments of the present application are subject to the following explanations:

[0032] Multi-Head Attention Mechanism (MHA): The multi-head attention mechanism projects the input vector into multiple different subspaces, then calculates the attention weights independently in each subspace, and finally combines these attention-weighted information to form a richer and more comprehensive representation.

[0033] Masked Multi-Head Self-Attention (Masked MHA) function: The masked multi-head self-attention function is a variant of the multi-head attention mechanism. It introduces a mask matrix when calculating the attention weights to control which connections between words (or entities) should be ignored by the model.

[0034] Matrix singular value decomposition (SVD) is a matrix decomposition method widely used in numerical linear algebra.

[0035] It should be noted that the collected information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data for display, data for analysis, etc.) involved in this application are information and data authorized by the user or fully authorized by all parties, and the collection, storage, use, processing, transmission, provision, disclosure and application of relevant data are in compliance with relevant laws, regulations and standards, necessary confidentiality measures are taken, and public order and good customs are not violated, and corresponding operation entrances are provided for users to choose to authorize or refuse. For example, an interface is set up between this system and relevant users or institutions to provide users with corresponding operation entrances for users to choose to agree or refuse the results of automated decision-making; if the user chooses to refuse, the expert decision-making process will be entered.

[0036] Example 1

[0037] According to an embodiment of the present application, a method embodiment of text detection is also provided. It should be noted that the steps shown in the flowchart of the accompanying drawings can be executed in a computer system such as a set of computer executable instructions, and although the logical order is shown in the flowchart, in some cases, the steps shown or described can be executed in an order different from that shown here.

[0038] The text detection method embodiment provided in the first embodiment of the present application can be executed in a mobile terminal, a computer terminal or a similar computing device. Figure 1 FIG. 1 shows a hardware structure block diagram of a computer terminal for implementing a text detection method. Figure 1As shown, the computer terminal 10 (or mobile device) may include one or more (102a, 102b, ..., 102n are used to illustrate) processors 102 (the processor 102 may include but is not limited to a processing device such as a microprocessor MCU or a programmable logic device FPGA), a memory 104 for storing data, and a transmission device 106 for communication functions. In addition, it may also include: a display, an input / output interface (I / O interface), a universal serial bus (USB) port (which may be included as one of the ports of the BUS bus), a network interface, a power supply and / or a camera. It can be understood by those skilled in the art that Figure 1 The structure shown is only for illustration and does not limit the structure of the above electronic device. Figure 1 More or fewer components as shown, or with Figure 1 Different configurations are shown.

[0039] It should be noted that the one or more processors 102 and / or other data processing circuits described above may generally be referred to herein as "data processing circuits". The data processing circuits may be embodied in whole or in part as software, hardware, firmware, or any other combination thereof. In addition, the data processing circuit may be a single independent processing module, or may be incorporated in whole or in part into any of the other components in the computer terminal 10 (or mobile device). As described in the embodiments of the present application, the data processing circuit acts as a processor control (e.g., selection of a variable resistor terminal path connected to an interface).

[0040] The memory 104 can be used to store software programs and modules of application software, such as the program instructions / data storage device corresponding to the text detection method in the embodiment of the present application. The processor 102 executes various functional applications and data processing by running the software programs and modules stored in the memory 104, that is, the above-mentioned text detection method is realized. The memory 104 may include a high-speed random access memory, and may also include a non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid-state memory. In some examples, the memory 104 may further include a memory remotely arranged relative to the processor 102, and these remote memories may be connected to the computer terminal 10 via a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.

[0041] The transmission device 106 is used to receive or send data via a network. The specific example of the above network may include a wireless network provided by a communication provider of the computer terminal 10. In one example, the transmission device 106 includes a network adapter (Network Interface Controller, NIC), which can be connected to other network devices through a base station so as to communicate with the Internet. In one example, the transmission device 106 can be a radio frequency (RF) module, which is used to communicate with the Internet wirelessly.

[0042] The display may be, for example, a touch screen liquid crystal display (LCD) that enables a user to interact with a user interface of the computer terminal 10 (or mobile device).

[0043] Under the above operating environment, this application provides Figure 2 The text detection method shown. Figure 2 is a flowchart of a text detection method according to an embodiment of the present application. Figure 2 As shown, the method comprises the following steps:

[0044] Step S202, obtaining the text to be detected, and retrieving the target published text belonging to the same field as the text to be detected from the fact library, wherein the text to be detected includes at least one key entity, and the fact library stores published texts for describing real events.

[0045] The above-mentioned text to be detected may refer to any text content that needs to be analyzed to determine its authenticity or falsity. The types of text to be detected may include but are not limited to news articles, social media posts, forum discussions, blog articles, etc. The specific text to be detected needs to be determined according to the actual situation and is not limited here. The text to be detected can be used as the input of the entire fake news detection process, and its authenticity will directly affect the stability of the financial market and personal decision-making.

[0046] The above-mentioned fact base may refer to a database that stores a large number of verified descriptions of real events. The fact base may be used to provide reliable benchmark data for fake news detection, and to compare and verify the information in the text to be detected. The real events in the fact base are usually verified by authoritative financial institutions, official releases or professional news organizations. The types of real events may include but are not limited to historical events, policy changes, market reports, official statements, etc., and the real events in the fact base are classified and structured for quick retrieval and comparison.

[0047] The above-mentioned target published text may refer to a text retrieved from the fact base that belongs to the same field as the text to be detected. The target published text may be used to provide a reference point. By comparing the information consistency between the text to be detected and the target published text, the authenticity of the text to be detected may be determined.

[0048] The above-mentioned key entities may refer to entities or concepts that appear in the text to be detected and are crucial to describing events or situations. The types of key entities may include but are not limited to names of people, places, dates, event descriptions, etc. The specific key entities need to be determined based on the text to be detected and are not limited here. Key entities can be used to highlight key information in text analysis and help the algorithm focus on the parts that are most likely to reveal the authenticity of the news.

[0049] The above-mentioned published text may refer to official published texts such as news reports, official statements, and social media posts. The types of published texts may include but are not limited to official reports, verified news articles, historical data records, etc. The specific published texts need to be determined based on real events and are not limited here. The published texts can be used to provide a reliable comparison benchmark for the detection algorithm to help identify and verify key information in the text to be detected.

[0050] In an optional embodiment, a section of text to be detected is first obtained, and the text to be detected includes at least one key entity such as a company name, a stock code, and economic data. Then, a target published text matching the field of the text to be detected is retrieved from the fact database, so that the system can effectively verify the authenticity of the news by comparing the key entities of the text to be detected with the information in the target published text. The above process improves the accuracy of detection, and at the same time, because the detection basis is directly derived from authoritative knowledge in the financial field, the interpretability of the results is enhanced.

[0051] Step S204, retrieve the target description text corresponding to at least one key entity from the knowledge base, and perform text enhancement on the text to be detected based on the target description text to obtain enhanced detection text. The knowledge base stores description texts of different key entities.

[0052] The above-mentioned knowledge base may refer to a database that stores detailed descriptions and information about different key entities. The knowledge base may be summarized from the experiential knowledge and expertise of experts in this field. The knowledge base may be used to provide rich domain knowledge for the detection algorithm so as to have a deeper understanding of the key entities in the news text.

[0053] The above-mentioned target description text may refer to the description text in the knowledge base corresponding to at least one key entity in the text to be detected. The target description text may be used to provide context and background information for the key entity, helping the algorithm to better judge whether the use of the entity in the news is appropriate or misleading.

[0054] The above-mentioned text enhancement may refer to a technical means for enriching the content of the text to be detected by adding additional, relevant descriptive information. Text enhancement may be used to increase the amount of information in the text, reveal potential contradictions or anomalies in the text, and the like.

[0055] The enhanced detection text mentioned above may refer to the text to be detected after text enhancement processing. Compared with the original text to be detected, the enhanced detection text contains the target description text retrieved from the knowledge base, so it contains richer information and more complete semantics. The enhanced detection text can be used as a higher quality input for the fake news detection algorithm, so that the algorithm can make judgments based on more comprehensive information, thereby improving the accuracy and reliability of detection.

[0056] The above-mentioned description text may refer to the text in the knowledge base used to describe the key entities in detail. The types of description text may include but are not limited to the definition of the key entity, historical background, legal terms, industry standards, etc. The specific description text needs to be determined based on the actual situation of the key entity in the knowledge base, and is not limited here. The description text can be used to provide additional evidence and explanation for the key entities in the text to be detected, and help the algorithm determine whether the use of the entity is consistent with domain common sense and historical facts.

[0057] In an optional embodiment, the target description text corresponding to the key entities in the text to be detected is retrieved from the knowledge base, and the text to be detected is enhanced based on the target description text to obtain enhanced detection text. The above process significantly improves the accuracy and interpretability of fake news detection by increasing the description of key entities in the knowledge base, while also demonstrating the model's ability to process complex financial information and improving the robustness and practicality of the detection results.

[0058] Step S206, the enhanced detection text and the target published text are fused to obtain a fused detection text, wherein the fused detection text is used to describe a basis for authenticity judgment of at least one key entity.

[0059] The above-mentioned fused detection text may refer to the text representation obtained by fusing the enhanced detection text with the target published text through a deep learning model. The fused detection text integrates the original information of the text to be detected, the in-depth description of the relevant entities, and the factual information released by the authoritative organization, forming a text representation with more comprehensive information and richer semantics. The fused detection text can be used to provide a more detailed and multi-dimensional text feature for the fake news detection algorithm, so that the model can judge the authenticity of the news based on richer information and evidence, thereby improving the accuracy and reliability of detection.

[0060] The above-mentioned basis for authenticity judgment may refer to a series of bases for judging the authenticity of news generated by comparing and integrating entity descriptions, factual information and the content of the text to be detected in the fusion detection text. The types of authenticity judgment basis may include but are not limited to entity consistency basis, event consistency basis, semantic coherence basis, timeline basis, diversity basis, etc. The specific authenticity judgment basis needs to be determined according to the actual situation and is not limited here. The authenticity judgment basis can be used to provide explanations for the detection results.

[0061] In an optional embodiment, through a deep learning model, the enhanced detection text containing rich entity descriptions is combined with the authoritative factual text that is officially released and closely related to the news topic to generate a fused detection text. The fused detection text not only covers the entire content of the original news, but also incorporates additional information from the knowledge base and fact base. This information provides background, history and context for key entities, thereby enhancing the model's ability to judge the authenticity of the news. The above process, by generating fused detection text, can not only improve the accuracy and efficiency of false news detection, but also enhance the interpretability of detection results, provide more reliable and transparent information assurance for financial institutions and ordinary users, and help maintain the health and stability of the financial market.

[0062] Step S208, detecting the text to be detected based on the fused detection text to obtain a detection result, wherein the detection result is used to indicate whether the text to be detected is a text describing a real event.

[0063] The above-mentioned detection results may refer to the conclusions drawn based on the fusion detection text after processing through a deep learning model or a specific algorithm. The types of detection results may include but are not limited to real event confirmation, false event warning, suspicious event marking, and authenticity scoring. The specific detection results need to be determined according to actual needs and are not limited here. The detection results can be used to provide key information to information consumers and publishers to help them distinguish between real and false information on the Internet. For financial institutions, the detection results can assist in risk assessment, compliance checks, and information monitoring to ensure that decisions are made based on real information and avoid losses caused by false information.

[0064] In an optional embodiment, by using deep learning models such as multi-head self-attention mechanism and cross-attention mechanism, the system can extract key features from the fusion detection text, analyze and predict them, and then obtain the detection results. The above detection results based on the fusion detection text have achieved effective identification of fake news, which not only improves the accuracy of detection, but also enhances the interpretability of the model and the user's trust in the results, providing a solid technical guarantee for the health and security of the financial information environment.

[0065] In the embodiment of the present application, firstly, the target published text belonging to the same field as the text to be detected is retrieved from the fact base; then the target description text corresponding to at least one key entity is retrieved from the knowledge base, and the text to be detected is enhanced based on the target description text to obtain an enhanced detection text; then the enhanced detection text is fused with the target published text to obtain a fused detection text; finally, the text to be detected is detected based on the fused detection text to obtain a detection result. It is easy to notice that the present application contains information sources of two dimensions, the fact base and the knowledge base. On this basis, the text to be detected is first obtained, and the target published text is retrieved from the fact base and the target description text is retrieved from the knowledge base respectively; then the target description text is used to enhance the text to be detected to obtain an enhanced detection text; then the enhanced detection text is fused with the target published text to obtain a fused detection text; finally, the text to be detected is detected based on the fused detection text to obtain a detection result. In the above process, by obtaining multi-dimensional information sources, the entity description, domain knowledge and expert knowledge are fused, the judgment basis of the model is enhanced, and the model is ensured to understand the background knowledge of the entity, thereby achieving the technical purpose of improving the detection accuracy, and thus solving the technical problem of low accuracy of text detection in related technologies.

[0066] In an optional embodiment, Figure 3 is an overall framework diagram of a text detection method according to an embodiment of the present application, such as Figure 3 As shown, the method includes: first, inputting the information in the fact base into a fact information fusion module including a fact selection layer and a fact feature encoding layer, inputting the text to be detected into the knowledge embedding layer and the knowledge feature encoding layer in the knowledge enhancement conversion module in sequence, inputting the information in the knowledge base into the knowledge representation layer and the knowledge feature encoding layer in the knowledge enhancement conversion module in sequence, finally inputting the information encoded by the fact feature encoding layer and the knowledge feature encoding layer into the feature fusion layer for feature fusion, and finally classifying the fused features by the classification network.

[0067] The fake news classification task integrating expert knowledge can be defined as: given a news text S = {w 0 ,w 1 ,w 2 ,…,w n}, a financial knowledge base KB, and a true value label e, where w i ∈V represents the set of words that appear in all news, e=0 represents that the news is true news, and e=1 represents that the news is false news. The research content of this chapter is to find a mapping f(S,KB,θ)→(e′) to predict whether a given news is false or true (e′=0 or e′=1), where θ is a learnable model parameter.

[0068] based on Figure 3 The model framework diagram is shown in Figure 1. The text detection method is described in detail as follows. The input of the model is the text set to be detected π = {S 0 ,S 1 ,S 2 ,…,S n}, the true value label set E = {e 0 ,e 1 ,e 2 ,…,e n}, the output is a classification model. The model is divided into two parts. The first part is a knowledge enhancement conversion module based on expert knowledge, which is used to integrate the target description text in the knowledge base; the second part is a fact information fusion module based on authoritative knowledge, which is used to integrate the authoritative knowledge of the target release text in the fact base.

[0069] Optionally, in the text detection method provided in the embodiment of the present application, text enhancement is performed on the text to be detected based on the target description text to obtain enhanced detection text, including: obtaining the text structure of the text to be detected and the entity position of at least one key entity in the text structure; constructing a mask matrix of at least one key entity based on the text structure and the entity position, wherein the mask matrix is ​​used to mark text information that affects the key entity in the text to be detected; and text enhancement is performed on the text to be detected based on the mask matrix and the target description text to obtain enhanced detection text.

[0070] The above-mentioned text structure may refer to the organization method of the text to be detected and the logical relationship between its constituent elements. The types of text structures may include but are not limited to the tree structure of the text to be detected, the sequence structure of the text to be detected, etc. The specific text structure should be determined according to the actual situation of the text to be detected and is not limited here. The text structure can be used to clearly express the hierarchical relationship and semantic connection between each word and sentence in the news text, so that the model can more effectively understand and process the information in the text.

[0071] The above-mentioned entity position may refer to the specific position where the key entity appears in the text. The types of entity positions may include but are not limited to the node position of the tree structure and the index position of the sequence structure. The specific entity position needs to be determined based on the actual situation of the text structure and is not limited here. The entity position can be used to ensure that the model can accurately integrate the entity description information into the text information related to the entity during the enhancement process, thereby avoiding the erroneous integration and redundancy of information.

[0072] The above-mentioned mask matrix may refer to a tool for controlling the way a model processes text information. The role of the mask matrix may include but is not limited to guiding the model's attention distribution by marking which parts of the text information should affect the key entities, thereby avoiding the model from giving too much weight to irrelevant information when fusing text information, thereby improving the efficiency and effectiveness of text enhancement.

[0073] In an optional embodiment, the mask matrix marks the text information in the form of a binary matrix, and 1 in the mask matrix indicates that the text information at this position will be used by the model to enhance the description of the key entity, and 0 in the mask matrix indicates that the text information at this position will not be used for enhancement.

[0074] In an optional embodiment, first, the text structure of the text to be detected and the entity position of at least one key entity in the text structure are obtained; then, a mask matrix of at least one key entity is constructed based on the text structure and the entity position; finally, the text to be detected is enhanced based on the mask matrix and the target description text to obtain an enhanced detection text. In the above process, by constructing the text structure, determining the entity position and using the mask matrix, the system can accurately enhance the text to be detected, and seamlessly integrate the target description text into the context of the relevant entities in the original text. The generated enhanced detection text is not only richer in information and more complete in semantics, but also can avoid information redundancy and omission, providing a higher quality input for fake news detection, and improving the accuracy, efficiency and interpretability of the overall detection.

[0075] In an optional embodiment, Figure 4 is a schematic diagram of a knowledge enhancement conversion module according to an embodiment of the present application, such as Figure 4 As shown in the figure, the module includes a text encoding layer, a masked multi-head attention mechanism layer, a normalization layer, and a fully connected feedforward network layer. First, the text to be detected and the expert knowledge are input into the knowledge enhancement conversion module. The text to be detected and the expert knowledge are converted into Q vectors, K vectors, V vectors, and mask matrices through the text encoding layer, and then they are sequentially input into the masked multi-head attention mechanism layer, the normalization layer, and the fully connected feedforward network layer for training to obtain text features that integrate expert knowledge.

[0076] The network function of the knowledge enhancement conversion module can be defined as:

[0077]

[0078] In the formula, S bert ′ represents the news text feature vector after position encoding enhancement, S bertrepresents the original feature vector obtained after the text to be detected is encoded by the bidirectional encoding model (Bidirectional Encoder Representations from Transformers, referred to as BERT), PE represents the calculated position encoding vector, S MULT represents the feature vector of the text to be detected after being processed by the masked multi-head attention mechanism, represents a multi-head attention function including a mask mechanism, FFN represents a feed-forward neural network (FFN for short), It represents the feature vector finally used for classification, and LN represents layer normalization (LN for short).

[0079] Optionally, in the text detection method provided in the embodiment of the present application, text enhancement is performed on the text to be detected based on the mask matrix and the target description text to obtain enhanced detection text, including: determining associated text associated with at least one key entity in the target description text based on the mask matrix; and performing text enhancement on the text to be detected based on the associated text to obtain enhanced detection text.

[0080] The above-mentioned associated text may refer to a text fragment in the target description text that is directly related to at least one key entity and can provide a detailed description or background information of the key entity. The types of associated text may include but are not limited to entity attribute text, entity-related event text, entity-related entity text, etc. The specific associated text needs to be determined based on the target description text and is not limited here. The associated text can be used to enhance the representation ability of key entities, avoid misuse and redundancy of knowledge information, ensure the efficiency and accuracy of the enhancement process, and improve the performance of fake news detection.

[0081] In an optional embodiment, before text enhancement, it is necessary to determine the associated text associated with the key entity in the target description text based on the mask matrix, and use the associated text to perform text enhancement on the text to be detected to obtain enhanced detection text. Through the associated text, the model can specifically enhance the description of key entities, improve the representation quality of news text, and further improve the accuracy and reliability of fake news detection.

[0082] In an optional embodiment, for a given news text S={w 0 ,w 1 ,w 2 ,…,w n ,P}, according to the text vocabulary w i Retrieve relevant structured knowledge in the Chinese encyclopedia knowledge base CN-DBpedia. The entity knowledge in this knowledge base can be represented by the tuple ε=(ω,θ0 ,θ 1 ,…,θ i ), where ω represents the entity, θ i Represents the description information of entity ω. For example, the entity "Baiyin City" can be described as (a city under Gansu, a copper city, a temperate continental climate, a red tourism city, ...) in the knowledge base. The structured knowledge retrieved from the entity in the text to be detected S can be expressed as:

[0083]

[0084] In the formula, represents the structured knowledge of the text to be detected S, w 0 Represents the first entity, to represents the i-th attribute of the first entity, w 1 Represents the second entity, to represents the i attributes of the second entity, w n represents the nth entity, to Represents the i-th attribute of the n-th entity.

[0085] Inject structured knowledge into the text to be detected S and the corresponding entity ω n Establish a connection. Here, a tree structure is used to describe the text structure S′ after knowledge injection. Figure 5 is a schematic diagram of a tree structure according to an embodiment of the present application, such as Figure 5 As shown, Figure 5 Including w 0 tow n There are n entities in total, and each entity contains multiple attributes corresponding to the entity, among which w 0 Represents the first entity, to represents the i-th attribute of the first entity, w 1 Represents the second entity, to represents the i attributes of the second entity, w n represents the nth entity, to Represents the i-th attribute of the n-th entity.

[0086] The text structure after injection can be expressed as:

[0087]

[0088] Among them, S′ represents the text to be detected combined with structured knowledge, w 0 Represents the first entity, to represents the i-th attribute of the first entity, w 1 Represents the second entity, to represents the i attributes of the second entity, w n represents the nth entity, to Represents the i-th attribute of the n-th entity.

[0089] Optionally, in the text detection method provided in the embodiment of the present application, text enhancement is performed on the text to be detected based on the associated text to obtain enhanced detection text, including: creating an initial tree structure with at least one key entity in the text to be detected as the root node, and using the associated text as a child node; based on the association strength between at least one key entity and the associated text, embedding the child node into the branch of the corresponding root node in the initial tree structure to obtain a target tree structure; embedding the associated text into the text to be detected based on the traversal order of the target tree structure to obtain enhanced detection text.

[0090] The above-mentioned root node can refer to the initial node of the tree structure, representing at least one key entity in the text to be detected. The selection of the root node needs to be determined based on the key entity, which is not limited here. The root node can serve as the center of news text analysis to help the model focus on key entity information and ensure the accuracy of text enhancement and true judgment. The selection of the root node directly affects the construction of the tree structure and the model's understanding of the core content of the news.

[0091] The above-mentioned initial tree structure may refer to a tree structure constructed with the root node as the center. The initial tree structure is used to describe the preliminary hierarchical relationship between entities and entities and between entities and text descriptions in the news text, providing a basic framework for subsequent text enhancement and tree structure optimization.

[0092] The above-mentioned child nodes may refer to associated text nodes added in the initial tree structure. The types of child nodes may include but are not limited to detailed attributes of key entities, associated information with other entities, and historical event records. The specific child nodes may be determined based on the actual situation of the associated text and are not limited here. The child nodes may be used to enrich the description of key entities.

[0093] The above-mentioned association strength may refer to a parameter that measures the degree of association between a child node and a root node. The association strength is a key factor in determining the position of a child node in a tree structure. The association strength may be determined by calculating the similarity, correlation or weight between the child node information and the key entity description. The association strength may be used to ensure that the information hierarchy in the tree structure is reasonable and to avoid information redundancy or missing.

[0094] The above-mentioned target tree structure may refer to a tree structure obtained by adjusting the position of the child nodes in the tree structure and embedding the child nodes into the corresponding root node branches according to the association strength. The target tree structure may be used to more accurately reflect the relationship between each entity and the description information, as well as their contribution to the description of the key entity.

[0095] The above-mentioned traversal order may refer to the order in which the model visits nodes when processing a tree structure. The types of traversal orders may include but are not limited to breadth-first traversal order, depth-first traversal order, etc. The specific traversal order needs to be determined according to different priority principles and is not limited here. The traversal order can be used to determine how the associated text information is integrated into the text to be detected, as well as affect the extraction of text features and subsequent model predictions.

[0096] In an optional embodiment, an initial tree structure is created with at least one key entity in the text to be detected as the root node, and the associated text is used as a child node. Based on the strength of the association between the key entity and the associated text, the child node is embedded into the branch of the initial tree structure to obtain a target tree structure; finally, based on the traversal order of the target tree structure, the associated text is embedded into the text to be detected to obtain an enhanced detection text. By constructing and improving the tree structure, the associated text is accurately embedded into the text to be detected, which not only improves the semantic richness of the news text, but also ensures the relevance and validity of the knowledge information. The enhanced detection text finally obtained can more comprehensively and accurately reflect the authenticity of the news and the significance of the key entity.

[0097] In an optional embodiment, the tree structure of the text to be detected is serialized, and each branch node can be inserted in sequence in the tree structure of the text representation to obtain the news text in sentence form. Figure 6 is a schematic diagram of a position encoding of a text to be detected according to an embodiment of the present application, such as Figure 6 As shown in the figure, the text to be detected is "A 4.5-magnitude earthquake occurred in Yibin, Sichuan on May 3, causing the suspension of train services". According to the entity set {Sichuan, Yibin, 4.5-magnitude earthquake, train} contained in the news sentence, the key entity descriptions are retrieved from the knowledge base as {(Yibin, a subordinate city of Sichuan, located in the Huaying Mountain earthquake zone), (4.5-magnitude earthquake, obvious tremors, causing the suspension of train services, and house collapses)}, and the obtained entity knowledge is injected into the original news text to obtain a new news text representation S′.

[0098] In order to input it into the text detection model, it was modified to "On May 3, a 4.5-magnitude earthquake occurred in the Huayingshan earthquake zone in Yibin, Sichuan, a subordinate city of Sichuan. The earthquake was felt significantly, trains were suspended, houses collapsed, and trains were suspended."

[0099] Figure 7is a schematic diagram of a hard position coding of a text to be detected according to an embodiment of the present application, such as Figure 7 As shown in the figure, after the hard position encoding of the entities in the text to be detected, the corresponding position code of Sichuan is 0, the corresponding position code of Yibin is 1, the corresponding position code of the subordinate cities of Sichuan is 2, the corresponding position code of Huayingshan earthquake zone is 3, the corresponding position code of May 3 is 4, the corresponding position code of occurrence is 5, the corresponding position code of 4.5 magnitude earthquake is 5, the corresponding position code of obvious shaking is 7, the corresponding position code of train suspension is 8, the corresponding position code of house collapse is 9, the corresponding position code of causing is 10, the corresponding position code of train is 11, and the corresponding position code of suspension is 12.

[0100] In a certain branch, when a code is inserted into the corresponding position, the subsequent existing codes are moved backward in sequence, and the news text is sorted in the order of hard position codes, such as Figure 7 As shown, a text representation sequence with position information is obtained, and finally each encoding in the news text is converted into a word embedding vector:

[0101] S bert = BertEmbed(S′);

[0102] In the formula, S′ represents the text to be detected combined with structured knowledge, BertEmbed represents the position encoding calculation, and S bert Indicates the position encoding information of the text to be detected.

[0103] The above process can save the absolute position of the text field in the text to be detected through hard position coding, and can also save the relative position of the text field in the text to be detected through soft position coding. Figure 8 is a schematic diagram of a soft position coding of a text to be detected according to an embodiment of the present application, such as Figure 8 As shown, the corresponding position code of Sichuan is 0, the corresponding position code of Yibin is 1, the corresponding position code of Sichuan's subordinate cities is 2, the corresponding position code of Huayingshan earthquake zone is 3, the corresponding position code on May 3 is 2, the corresponding position code of occurrence is 3, the corresponding position code of 4.5 magnitude earthquake is 4, the corresponding position code of obvious shaking is 5, the corresponding position code of train suspension is 6, the corresponding position code of house collapse is 7, the corresponding position code of causing is 5, the corresponding position code of train is 6, and the corresponding position code of suspension is 7.

[0104] exist Figure 8In the text, [subordinate cities of Sichuan] and [Huaying Mountain earthquake zone] are inserted before [Yibin] and [on May 3]. In order to make the subject of [on May 3] [Yibin] instead of [Huaying Mountain earthquake zone], the position code of [on May 3] is set to 2 instead of 4, so that [on May 3] instead of [Huaying Mountain earthquake zone] can be obtained by analogy, and the soft position codes of all text words are obtained.

[0105] The soft position encoding representation vector (Position Embedding, PE) can be calculated by the following formula:

[0106]

[0107] Wherein, p represents the sequential position of the word in the sentence, d represents the maximum dimension of the soft position coding representation vector, 2i represents the dimension with an even sequential position, 2i+1 represents the dimension with an odd sequential position, PE represents the soft position coding representation vector, POS represents the position information in the position coding, sin represents the sine function, cos represents the cosine function, and 10000 represents a specific parameter, which can be adjusted according to the actual situation and is not limited here.

[0108] Considering that in the actual news detection task, there may be cases where the sentences are longer than all the sentences in the training set, using this method to calculate the soft position coding representation vector can improve the applicability of the model. For a fixed spacing k, PE(pos+k) can also be calculated based on PE(pos).

[0109] Then, the soft position encoding of the text sequence is combined with the text feature matrix S bert Sum and embed the position information of the news text sequence into the text features:

[0110] S bert ′=S bert +PE(S bert ):

[0111] In the formula, S bert represents the text feature matrix, PE(S bert ) represents the position encoding information, S bert ′ represents the text feature combined with the position information, that is, the enhanced detected text.

[0112] Optionally, in the text detection method provided in the embodiment of the present application, the associated text is embedded into the text to be detected based on the traversal order of the target tree structure to obtain enhanced detection text, including: position encoding the text fields in the text to be detected to obtain position coding information of the text to be detected; based on the position coding information, the associated text is embedded into the text to be detected in the traversal order to obtain enhanced detection text.

[0113] The above-mentioned position coding may refer to a coding method designed to help the model understand the order and position information of words or fragments in the text. The types of position coding may include but are not limited to hard position coding, soft position coding, deep position coding and adaptive position coding. The specific position coding needs to be determined according to the actual situation and is not limited here. Position coding can be used to enhance the model's understanding ability, better integrate information, and improve detection accuracy.

[0114] The above-mentioned position coding information may refer to the position coding information which is the specific implementation result of position coding. The position coding information contains the position information of each word or text fragment in the sequence. The position coding information can be calculated based on the traversal order of the target tree structure, and can be used to reflect the relative position of the associated text in the text to be detected after the tree structure is reorganized.

[0115] In an optional embodiment, position coding information is obtained by position coding the text fields of the text to be detected, so that the system can embed the associated text into the text to be detected in a traversal order based on the position coding information to obtain enhanced detection text, thereby enabling the system to accurately control the embedding position of the associated text in the text to be detected, thereby ensuring the accuracy and efficiency of text enhancement, which plays an important role in improving the accuracy of fake news detection.

[0116] In an optional embodiment, in order to solve the knowledge redundancy phenomenon caused by introducing too much common sense knowledge, a masking mechanism is introduced, and the definition of the masking matrix is ​​as follows:

[0117]

[0118] In the formula, w i and w j Both represent the hard position code of the news text, M ij Represents a mask matrix.

[0119] In order to construct a self-attention layer with a masking mechanism, the attention value function is defined as:

[0120]

[0121] In the formula, Q represents the query vector, K represents the key vector, V represents the value vector, and S bert ′ represents the enhanced detection text, W Q , W K With W V Respectively represent the bert ′ is converted into a weight matrix corresponding to the vector, and The attention function is defined as:

[0122]

[0123] Where SelfAttention represents the self-attention function, Q represents the query vector, K represents the key vector, V represents the value vector, softmax represents the normalization function, and K T represents the transpose of the key vector, d q Represents the query vector dimension.

[0124] In order to fully understand the semantic information of news text, this application uses a multi-head attention mechanism for feature fusion, uses H self-attention heads to learn the text information of news in parallel, and divides Q, K, and V into H different subspaces. The multi-head self-attention function is defined as:

[0125] MultiHead(Q,K,V)=Concat(head 1 ,head 2 ,…,head H )×W O ;

[0126] In the formula, MultiHead represents the multi-head attention mechanism, Q represents the query vector, K represents the key vector, V represents the value vector, Concat represents the concatenation operation, and W O represents the weight matrix, head i represents the output of the i-th attention head, where i ranges from 1 to H.

[0127] By introducing the mask mechanism into the self-attention function, the self-attention function is modified as follows:

[0128]

[0129] Where SelfAttention represents the self-attention function, Q i represents the i-th query vector, K i represents the i-th key vector, V i represents the i-th value vector, softmax represents the normalization function, K i T represents the transpose of the i-th key vector, M represents the mask matrix, head i M represents the output of the i-th attention head after the introduction of the mask mechanism, d q represents the query vector dimension, and

[0130] The masked multi-head self-attention function at this time is:

[0131] MultiHead MASK(Q,K,V,M)=Concat(head 1 M ,head 2 M ,…,head H M )×W O ;

[0132] In the formula, Q represents the query vector, K represents the key vector, V represents the value vector, Concat represents the concatenation operation, and W O represents the weight matrix, M represents the mask matrix, head 1 M It represents the output of the i-th attention head after the introduction of the mask mechanism, i ranges from 1 to H, MultiHead MASK Represents a multi-head attention mechanism combined with a mask mechanism.

[0133] Optionally, in the text detection method provided in the embodiment of the present application, the text to be detected is detected based on the fused detection text to obtain a detection result, including: inputting the fused detection text into a text detection model, using the text detection model to detect the text to be detected, and obtaining a detection result, wherein the text detection model is trained based on sample fused detection text and sample detection results.

[0134] The above-mentioned sample fusion detection text may refer to an enhanced text formed by fusing the sample text with corresponding external knowledge. The sample fusion detection text may be used to provide the model with richer and more comprehensive information so that the model can learn the key features and logical laws for identifying fake news based on this information.

[0135] The above-mentioned sample detection results may refer to the use of the true label of each sample fusion detection text as the target of model training when training the text detection model. The types of sample detection results may include but are not limited to real news and false news. The specific sample detection results need to be determined based on fact verification and expert judgment, which are not limited here. The sample detection results can be used as a supervision signal to adjust the model parameters so that the model can learn effective strategies to distinguish between real and false news from the fusion detection text.

[0136] In an optional embodiment, a text detection model is obtained by training the sample fusion detection text and the sample detection result, and then the text detection model is used to detect the fusion detection text to obtain the detection result. In the above process, the model is trained by the sample fusion detection text and the sample detection result, which ensures that the text detection model can accurately identify false news on the basis of fully absorbing entity description information and authoritative knowledge, and also provides a basis for decision-making for the model, thereby improving its accuracy and interpretability in the false news detection task in the financial field.

[0137] Optionally, in the text detection method provided in the embodiment of the present application, a target published text belonging to the same field as the text to be detected is retrieved from the fact library, including: retrieving at least one preset published text belonging to the same field as the text to be detected from the fact library; and determining the target published text based on the similarity between the text to be detected and the at least one preset published text.

[0138] The above-mentioned preset release text may refer to news related to the financial field or authoritatively released text information pre-selected in the fact base. The types of preset release texts may include but are not limited to official announcements, authoritative media news, expert comments, etc. The specific preset release text needs to be determined according to actual conditions and is not limited here. The preset release text can be used as a template for real events and is used to compare and analyze the characteristics of the text to be detected.

[0139] The above-mentioned similarity may refer to a quantitative indicator for measuring the degree of similarity between two texts. The types of similarity may include but are not limited to word frequency similarity, cosine similarity, etc. The specific similarity needs to be determined according to actual needs and is not limited here. The similarity can be used to evaluate the similarity between the text to be detected and the preset published text, thereby determining the target published text.

[0140] In an optional embodiment, multiple preset published texts belonging to the same field as the text to be detected are retrieved from the fact base, and then the target published text is determined based on the similarity between the text to be detected and the preset published text. The above process provides the system with an authoritative source of knowledge and a means of quantitative comparison based on the calculation of the similarity of the preset published texts, so that the model can accurately identify and filter fake news based on the unique knowledge and patterns in the financial field. At the same time, the calculation of similarity can also provide a basis for the decision-making of the model and improve its interpretability in the task of fake news detection.

[0141] In an optional embodiment, in order to determine the authoritative knowledge with the highest similarity to the text to be detected from the fact base, that is, to determine the target published text, the present application uses an unsupervised latent semantic analysis method to perform correlation analysis, and first constructs a real event library by screening news released by official media in a public data set.

[0142] For the text to be detected S = {w 0 ,w 1 ,w 2 ,…,w n ,P}, where w i Represents the words in the text to be detected, and V represents the vocabulary vector set. Each word w n Projection to the embedding matrix W E ∈R V×D In the vector, we get the word-text vector space matrix A:

[0143]

[0144] Where A represents the word-text vector matrix, each column vector corresponds to a text to be detected S, and each row corresponds to a word w i , element x mn Represents the word w n In the text S m The weights appearing in , the weights are expressed using word frequency-inverse document frequency (TF-IDF), and its standard definition is:

[0145]

[0146] In the formula, tf ij Represents a word w i In the text S i The frequency of occurrence in tf .j It is text S i The sum of the frequencies of all words that appear in , df is the total text set of the text set, df i Contains the word w i The number of texts, (TF-IDF)ij represents the word w i In the text S i Word frequency in - inverse text frequency.

[0147] According to the definition of TF-IDF, the higher the frequency of a word in a text, the more it can reflect the characteristics of the text and the higher its importance. However, word vectors are usually sparse and do not take into account the polysemy and monosemy of multiple words in news texts. The similarity analysis based on words is not accurate enough. Therefore, this application further considers topic factors based on word frequency to more accurately measure the similarity between texts.

[0148] Assuming that all news texts contain k topics in total, the word-topic vector matrix obtained based on word attributes is as follows U:

[0149]

[0150] In the formula, each column vector corresponds to a topic, and each row corresponds to a word w in the news text. i , element u ij Represents the word w i In the topic u i The weights that appear in .

[0151] In order to use topic factors to measure the similarity of texts, we hope to obtain the text-topic vector matrix V, which is specifically expressed as follows:

[0152]

[0153] In the formula, each column vector corresponds to a text S i , each row corresponds to topic u i , element v ij Represents text S i In the topic u i The weights appearing in , V represents the text-topic vector matrix, v mn Represents text S m In the topic u n The weights that appear in .

[0154] Since the correlation between text and topic needs to be measured by words, it cannot be obtained directly. This application uses the matrix singular value decomposition (SVD) method to calculate it. First, the word-text matrix A is approximately calculated by multiplying the word-topic matrix U and the text-topic matrix V:

[0155] A≈U×V;

[0156]

[0157] In the formula, V represents the text-topic matrix, U represents the word-topic matrix, A represents the word-text matrix, and U k represents a matrix of K left singular vectors, representing the first k largest singular values, represents the transpose of the matrix composed of K right singular vectors, ∑k represents the k-order diagonal matrix, which is used to represent the first k largest singular values, u k Denotes the matrix U k The kth mutually orthogonal left singular vectors in k represents the Kth singular value in the matrix ∑k, Representation Matrix The kth mutually orthogonal right singular vectors, k≤n≤m:

[0158] The topic-text matrix can be obtained by combining the matrix ∑k and the matrix V k The product of , so the j-th column vector x of matrix A is j satisfy:

[0159]

[0160] Among them, x j represents the j-th column vector of matrix A, Representation Matrix The j-th column vector of , ∑k is a k-order square matrix, representing the first k largest singular values; is an n×k matrix, representing the first k mutually orthogonal right singular vectors, uk Denotes the matrix U k The kth mutually orthogonal left singular vectors in k represents the Kth singular value in the matrix ∑k, v jk Representation Matrix The kth mutually orthogonal right singular vectors, ∑ is the summation operation.

[0161] Among them, each column vector is the representation of the text in the topic space:

[0162]

[0163] In the formula, o k v nk represents the representation of the k-th text in the n-th column in the k-th topic space, o k v 2k represents the representation of the k-th text in the second column in the k-th topic space, o k v 1k Represents the representation of the k-th text in the first column in the k-th topic space.

[0164] Therefore, latent semantic analysis is performed through SVD decomposition of the matrix. The specific decomposition formula is as follows:

[0165]

[0166] Where A represents the word-text matrix, U k represents a matrix of K left singular vectors, representing the first k largest singular values, represents the transpose of the matrix consisting of K right singular vectors, ∑k represents a k-order diagonal matrix, which is used to represent the first k largest singular values.

[0167] Thus we get the topic space O and the representation of the text in the topic space Each text vector can be approximately represented by a linear combination of k topic vectors. Then the topic similarity ω between each event information and the text to be detected is calculated by cosine similarity. The calculation formula is as follows:

[0168]

[0169] In the formula, ω represents the degree of familiarity, cos(θ) represents the cosine function, ∑ is the summation operation, and A i represents the i-th word-text matrix, B i Represents the i-th event information.

[0170] Through the above calculation, we can get the similarity between each event information in the event knowledge base and the news text to be detected, and take the event information whose similarity ω exceeds the threshold as the authoritative knowledge C = {C 1 ,C2 ,…,C i}Perform event feature fusion.

[0171] The text detection method provided in the embodiment of the present application obtains multi-dimensional information sources, integrates entity descriptions, domain knowledge and expert knowledge, enhances the judgment basis of the model, ensures that the model can understand the background knowledge of the entity, thereby achieving the technical goal of improving detection accuracy, and further solving the technical problem of low text detection accuracy in related technologies.

[0172] It should be noted that the steps shown in the flowcharts of the accompanying drawings can be executed in a computer system such as a set of computer executable instructions, and that, although a logical order is shown in the flowcharts, in some cases, the steps shown or described can be executed in an order different from that shown here.

[0173] Example 2

[0174] The embodiment of the present application also provides a text detection device. It should be noted that the text detection device of the embodiment of the present application can be used to execute the text detection method provided in the embodiment of the present application. The text detection device provided in the embodiment of the present application is introduced below.

[0175] According to an embodiment of the present application, a device for implementing the above-mentioned text detection method is also provided. Fig. 9 is a schematic diagram of a text detection device according to an embodiment of the present application, such as Fig. 9 As shown, the device includes: an acquisition module 902, which is used to acquire the text to be detected, and retrieve a target published text belonging to the same field as the text to be detected from a fact base, wherein the text to be detected includes at least one key entity, and the fact base stores published texts for describing real events; an enhancement module 904, which is used to retrieve a target description text corresponding to at least one key entity from a knowledge base, and perform text enhancement on the text to be detected based on the target description text to obtain an enhanced detection text, and the knowledge base stores description texts of different key entities; a fusion module 906, which is used to fuse the enhanced detection text and the target published text to obtain a fused detection text, wherein the fused detection text is used to describe a basis for judging the authenticity of at least one key entity; a detection module 908, which is used to detect the text to be detected based on the fused detection text to obtain a detection result, wherein the detection result is used to indicate whether the text to be detected is a text describing a real event.

[0176] The text detection device provided in the embodiment of the present application obtains multi-dimensional information sources, integrates entity descriptions, domain knowledge and expert knowledge, enhances the judgment basis of the model, ensures that the model can understand the background knowledge of the entity, thereby achieving the technical purpose of improving detection accuracy, and further solving the technical problem of low accuracy of text detection in related technologies.

[0177] Optionally, in the text detection device provided in the embodiment of the present application, the enhancement module includes: an acquisition unit, used to acquire the text structure of the text to be detected and the entity position of at least one key entity in the text structure; a construction unit, used to construct a mask matrix of at least one key entity based on the text structure and the entity position, wherein the mask matrix is ​​used to mark the text information that affects the key entity in the text to be detected; an enhancement unit, used to perform text enhancement on the text to be detected based on the mask matrix and the target description text to obtain an enhanced detected text.

[0178] Optionally, in the text detection device provided in the embodiment of the present application, the enhancement unit includes: a determination subunit, used to determine the associated text associated with at least one key entity in the target description text based on the mask matrix; an enhancement subunit, used to perform text enhancement on the text to be detected based on the associated text to obtain enhanced detection text.

[0179] Optionally, in the text detection device provided in the embodiment of the present application, the enhancement subunit includes: creating an initial tree structure with at least one key entity in the text to be detected as the root node, and using the associated text as a child node; based on the association strength between at least one key entity and the associated text, embedding the child node into the branch of the corresponding root node in the initial tree structure to obtain a target tree structure; embedding the associated text into the text to be detected based on the traversal order of the target tree structure to obtain an enhanced detection text.

[0180] Optionally, in the text detection device provided in the embodiment of the present application, the associated text is embedded into the text to be detected based on the traversal order of the target tree structure to obtain enhanced detection text, including: position encoding the text fields in the text to be detected to obtain position encoding information of the text to be detected; based on the position encoding information, the associated text is embedded into the text to be detected in the traversal order to obtain enhanced detection text.

[0181] Optionally, in the text detection device provided in the embodiment of the present application, the detection module includes: a detection unit, used to input the fused detection text into a text detection model, and use the text detection model to detect the text to be detected to obtain a detection result, wherein the text detection model is trained based on the sample fused detection text and the sample detection result.

[0182] Optionally, in the text detection device provided in the embodiment of the present application, the acquisition module includes: a retrieval unit, used to retrieve at least one preset published text belonging to the same field as the text to be detected from the fact library; and a determination unit, used to determine the target published text based on the similarity between the text to be detected and at least one preset published text.

[0183] It should be noted that the above-mentioned modules or units can be hardware components or software components stored in a memory (e.g., memory 104) and processed by one or more processors (e.g., processors 102a, 102b, ..., 102n), and the above-mentioned modules can also be run as part of the device in the computer terminal 10 provided in Example 1.

[0184] Example 3

[0185] An embodiment of the present application may provide an electronic device, Fig.10 is a structural block diagram of an electronic device according to an embodiment of the present application. Fig.10 As shown, the electronic device may include: one or more ( Fig.10 (only one is shown) processor 1002, memory 1004, storage controller, and peripheral interface, wherein the peripheral interface is connected to the radio frequency module, audio module and display.

[0186] Among them, the memory can be used to store software programs and modules, such as program instructions / modules corresponding to the methods and devices in the embodiments of the present application, and the processor executes various functional applications and data processing by running the software programs and modules stored in the memory, that is, realizing the above-mentioned method. The memory may include a high-speed random access memory, and may also include a non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid-state memory. In some instances, the memory may further include a memory remotely arranged relative to the processor, and these remote memories may be connected to the terminal via a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.

[0187] It can be understood by those skilled in the art that Fig.10 The structure shown is for illustration only, and the electronic device may also be a smart phone (such as an Android phone, an iOS phone, etc.), a tablet computer, a PDA, a mobile Internet device (Mobile Internet Devices, MID), a PAD, or other terminal devices. Fig.10 The structure of the electronic device is not limited. Fig.10 More or fewer components (such as network interfaces, display devices, etc.) shown in, or having Fig.10 Different configurations are shown.

[0188] A person of ordinary skill in the art can understand that all or part of the steps in the various methods of the above embodiments can be completed by instructing the hardware related to the terminal device through a program, and the program can be stored in a computer-readable storage medium, and the storage medium may include: a flash drive, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk, etc.

[0189] Example 4

[0190] The embodiment of the present application further provides a storage medium. Optionally, in this embodiment, the storage medium can be used to store the program code executed by the text detection method provided in the first embodiment.

[0191] Optionally, in this embodiment, the above storage medium may be located in any computer terminal in a computer terminal group in a computer network, or in any mobile terminal in a mobile terminal group.

[0192] The present application also provides a computer program product, which, when executed on a data processing device, is suitable for executing the steps of the text detection method.

[0193] The serial numbers of the above-mentioned embodiments of the present application are for description only and do not represent the advantages or disadvantages of the embodiments.

[0194] In the above embodiments of the present application, the description of each embodiment has its own emphasis. For parts that are not described in detail in a certain embodiment, please refer to the relevant description of other embodiments.

[0195] In the several embodiments provided in this application, it should be understood that the disclosed technical content can be implemented in other ways. Among them, the device embodiments described above are only schematic. For example, the division of the units is only a logical function division. There may be other division methods in actual implementation. For example, multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of units or modules, which can be electrical or other forms.

[0196] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.

[0197] In addition, each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of software functional units.

[0198] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present application, in essence, or the part that contributes to the prior art or all or part of the technical solution can be embodied in the form of a software product, and the computer software product is stored in a storage medium, including a number of instructions to enable a computer device (which can be a personal computer, a server or a network device, etc.) to perform all or part of the steps of the method described in each embodiment of the present application. The aforementioned storage medium includes: U disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), mobile hard disk, disk or optical disk and other media that can store program codes.

[0199] The above is only a preferred implementation of the present application. It should be pointed out that for ordinary technicians in this technical field, several improvements and modifications can be made without departing from the principles of the present application. These improvements and modifications should also be regarded as the scope of protection of the present application.

Claims

1. A text detection method, characterized in that: include: Acquire a text to be detected, and retrieve a target published text belonging to the same field as the text to be detected from a fact database, wherein the text to be detected includes at least one key entity, and the fact database stores published texts for describing real events; Retrieving a target description text corresponding to the at least one key entity from a knowledge base, and performing text enhancement on the text to be detected based on the target description text to obtain an enhanced detection text, wherein the knowledge base stores description texts of different key entities; The enhanced detection text and the target published text are fused to obtain a fused detection text, wherein the fused detection text is used to describe a basis for determining authenticity of the at least one key entity; The text to be detected is detected based on the fused detection text to obtain a detection result, wherein the detection result is used to indicate whether the text to be detected is a text describing the real event.

2. The text detection method according to claim 1, characterized in that: Performing text enhancement on the to-be-detected text based on the target description text to obtain enhanced detection text includes: Acquire the text structure of the text to be detected and the entity position of the at least one key entity in the text structure; Constructing a mask matrix of the at least one key entity based on the text structure and the entity position, wherein the mask matrix is ​​used to mark text information affecting the key entity in the text to be detected; The text to be detected is enhanced based on the mask matrix and the target description text to obtain the enhanced detection text.

3. The text detection method according to claim 2, characterized in that: Performing text enhancement on the to-be-detected text based on the mask matrix and the target description text to obtain the enhanced detection text includes: Determining, based on the mask matrix, associated text associated with the at least one key entity in the target description text; The text to be detected is enhanced based on the associated text to obtain the enhanced detected text.

4. The text detection method according to claim 3, characterized in that: Performing text enhancement on the text to be detected based on the associated text to obtain the enhanced detected text includes: Creating an initial tree structure with at least one key entity in the text to be detected as a root node, and using the associated text as a child node; Based on the association strength between the at least one key entity and the associated text, embedding the child node into a branch corresponding to a root node in the initial tree structure to obtain a target tree structure; The associated text is embedded into the text to be detected based on the traversal order of the target tree structure to obtain the enhanced detection text.

5. The text detection method according to claim 4, characterized in that: The associated text is embedded into the to-be-detected text based on the traversal order of the target tree structure to obtain the enhanced detection text, including: Performing position coding on the text fields in the text to be detected to obtain position coding information of the text to be detected; The associated text is embedded into the text to be detected in the traversal order based on the position coding information to obtain the enhanced detection text.

6. The text detection method according to claim 1, characterized in that: The text to be detected is detected based on the fused detection text to obtain a detection result, including: The fused detection text is input into a text detection model, and the text to be detected is detected using the text detection model to obtain the detection result, wherein the text detection model is trained based on sample fused detection text and sample detection results.

7. The text detection method according to claim 1, characterized in that: Retrieve target published texts belonging to the same field as the text to be detected from the fact database, including: Retrieving from the fact database at least one preset published text belonging to the same field as the text to be detected; The target published text is determined based on the similarity between the text to be detected and the at least one preset published text.

8. An electronic device, characterized in that: include: A memory storing an executable program; A processor, configured to run the program, wherein the program executes the method according to any one of claims 1 to 7 when running.

9. A computer-readable storage medium, characterized in that: The computer-readable storage medium includes a stored executable program, wherein when the executable program is run, the device where the storage medium is located is controlled to execute the method according to any one of claims 1 to 7.

10. A computer program product, characterized in that The invention comprises a computer program which, when executed by a processor, implements the method according to any one of claims 1 to 7.