Text fact verification method and device
By automatically identifying entity names and searching knowledge, combined with large language model verification, the problems of low efficiency and insufficient accuracy of AIGC text verification are solved, and efficient and accurate text fact verification is achieved.
Patent Information
- Application Number
- CN202411347019.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-25
- Publication Date
- 2025-01-14
AI Technical Summary
In the prior art, fact verification of AIGC texts relies on manual labor, which is inefficient and insufficiently accurate, and cannot effectively solve the problem of limiting artificial knowledge reserves.
By identifying the entity name in the text to be verified, matching it with the target knowledge base to obtain entity knowledge, and using the text title to search for knowledge, combining entity knowledge and search knowledge as fact basis, using pre-trained fact verification large language model to verify text and facts The consistency of the technology includes block processing, abbreviation processing and deduplication processing.
An automated text fact verification process is realized, which improves efficiency and accuracy, reduces the need for manual participation, expands the scope of application, and enhances the scalability and trust of verification.
Smart Images

Figure CN119312797A_ABST
Abstract
Description
Technical Field
[0001] The present disclosure relates to the field of data processing technology, in particular to the field of text processing technology, and more particularly to a method and device for text fact verification. Background Art
[0002] AIGC (Artificial Intelligence Generated Content) texts may not be consistent with the facts. Therefore, it is necessary to verify the facts of such texts, that is, to verify whether the texts are consistent with the established facts.
[0003] Existing fact verification schemes use manual verification of such texts. Summary of the invention
[0004] The present invention provides a text fact verification method and device.
[0005] In a first aspect, an embodiment of the present disclosure provides a text fact verification method, including:
[0006] Identify entity names mentioned in the text to be verified;
[0007] Matching the identified entity name with the entity name recorded in the target knowledge base, and obtaining entity knowledge corresponding to the successfully matched entity name from the knowledge recorded in the target knowledge base;
[0008] Obtaining search results obtained by performing a knowledge search using the text title of the text to be verified as a search term as the search knowledge of the text to be verified;
[0009] Taking the entity knowledge and the search knowledge as factual basis, verify whether the text to be verified is consistent with the facts.
[0010] In one embodiment of the present disclosure, the verifying whether the text to be verified is consistent with the facts by using the entity knowledge and the search knowledge as factual basis includes:
[0011] The text to be verified is processed into blocks to obtain multiple block texts;
[0012] Taking the entity knowledge and the search knowledge as factual basis, verifying in turn whether each block of text is consistent with the facts;
[0013] If it is verified that there are block texts that are inconsistent with the facts, it is determined that the text to be verified is inconsistent with the facts.
[0014] In one embodiment of the present disclosure, the verifying whether the text to be verified is consistent with the facts by using the entity knowledge and the search knowledge as factual basis includes:
[0015] Generate a model prompt instruction including the text to be verified, the entity knowledge and the search knowledge;
[0016] The model prompt instruction is input into a pre-trained fact verification large language model to obtain a verification result output by the fact verification large language model, wherein the verification result is: the fact verification large language model verifies whether the text to be verified is consistent with the fact based on the entity knowledge and search knowledge.
[0017] In one embodiment of the present disclosure, the generating of a model prompt instruction including the text to be verified, the entity knowledge, and the search knowledge includes:
[0018] Performing abbreviation processing on the text to be verified;
[0019] Generate a model prompt instruction including the text to be verified after abbreviation processing, the entity knowledge and the search knowledge.
[0020] In one embodiment of the present disclosure, the model prompt instruction also includes at least one of the following information:
[0021] first indication information, wherein the first indication information instructs the fact verification large language model to output an erroneous statement that is inconsistent with the fact when verifying that the text to be verified is inconsistent with the fact;
[0022] Second indication information, wherein the second indication information indicates the error reason why the error statement output by the fact verification large language model does not conform to the facts.
[0023] In one embodiment of the present disclosure, when the model prompt instruction includes the second indication information, the model prompt instruction also includes: a maximum limit on the number of words of the error cause.
[0024] In one embodiment of the present disclosure, the identifying the entity name mentioned in the text to be verified includes:
[0025] Sentence processing is performed on the text to be verified to obtain each text sentence;
[0026] Identify the core clauses in each text clause;
[0027] The entity names mentioned in the core clause are identified.
[0028] In one embodiment of the present disclosure, the method further includes:
[0029] Obtaining target parameters of the entity knowledge and search knowledge, wherein the target parameters represent the authority of the knowledge;
[0030] According to the obtained target parameters, authoritative knowledge is selected from the entity knowledge and the search knowledge;
[0031] The verifying whether the text to be verified is consistent with the facts by using the entity knowledge and the search knowledge as factual basis includes:
[0032] The screened knowledge is used as factual basis to verify whether the text to be verified is consistent with the facts.
[0033] In one embodiment of the present disclosure, the target parameter of knowledge includes at least one of the following parameters:
[0034] Source of knowledge, quality parameters characterizing text quality, and number of times the knowledge has been viewed.
[0035] In one embodiment of the present disclosure, the method further includes:
[0036] Deduplication processing is performed on the entity knowledge and the search knowledge;
[0037] The verifying whether the text to be verified is consistent with the facts by using the entity knowledge and the search knowledge as factual basis includes:
[0038] The entity knowledge and search knowledge after deduplication processing are used as factual basis to verify whether the text to be verified is consistent with the facts.
[0039] In one embodiment of the present disclosure, the identifying the entity name mentioned in the text to be verified includes:
[0040] The text to be verified is input into a pre-trained entity recognition model to obtain the entity name mentioned in the text to be verified which is output by the entity recognition model.
[0041] In one embodiment of the present disclosure, the target knowledge base includes an encyclopedia knowledge base and / or a search knowledge base that is updated in real time.
[0042] In a second aspect, the present disclosure also provides a text fact verification device, including:
[0043] An entity name recognition module, used to identify entity names mentioned in the text to be verified;
[0044] An entity knowledge acquisition module is used to match the identified entity name with the entity name recorded in the target knowledge base, and to acquire the entity knowledge corresponding to the successfully matched entity name from the knowledge recorded in the target knowledge base;
[0045] A search knowledge acquisition module, used to obtain search results obtained by performing knowledge search using the text title of the text to be verified as a search term, as the search knowledge of the text to be verified;
[0046] The fact verification module is used to verify whether the text to be verified is consistent with the facts based on the entity knowledge and the search knowledge.
[0047] In one embodiment of the present disclosure, the fact verification module is specifically used to:
[0048] The text to be verified is processed into blocks to obtain multiple block texts;
[0049] Taking the entity knowledge and the search knowledge as factual basis, verifying in turn whether each block of text is consistent with the facts;
[0050] If it is verified that there are block texts that are inconsistent with the facts, it is determined that the text to be verified is inconsistent with the facts.
[0051] In one embodiment of the present disclosure, the fact verification module includes:
[0052] An instruction generation submodule, used for generating a model prompt instruction including the text to be verified, the entity knowledge and the search knowledge;
[0053] The model reasoning submodule is used to input the model prompt instruction into a pre-trained fact verification large language model to obtain a verification result output by the fact verification large language model, wherein the verification result is: the fact verification large language model verifies whether the text to be verified is consistent with the facts based on the entity knowledge and search knowledge.
[0054] In one embodiment of the present disclosure, the instruction generation submodule is specifically used to:
[0055] Performing abbreviation processing on the text to be verified;
[0056] Generate a model prompt instruction including the text to be verified after abbreviation processing, the entity knowledge and the search knowledge.
[0057] In one embodiment of the present disclosure, the model prompt instruction also includes at least one of the following information:
[0058] first indication information, wherein the first indication information instructs the fact verification large language model to output an erroneous statement that is inconsistent with the fact when verifying that the text to be verified is inconsistent with the fact;
[0059] Second indication information, wherein the second indication information indicates the error reason why the error statement output by the fact verification large language model does not conform to the facts.
[0060] In one embodiment of the present disclosure, when the model prompt instruction includes the second indication information, the model prompt instruction also includes: a maximum limit on the number of words of the error cause.
[0061] In one embodiment of the present disclosure, the entity name recognition module is specifically used to:
[0062] Sentence processing is performed on the text to be verified to obtain each text sentence;
[0063] Identify the core clauses in each text clause;
[0064] The entity names mentioned in the core clause are identified.
[0065] In one embodiment of the present disclosure, the device further includes:
[0066] A parameter acquisition module, used to obtain target parameters of the entity knowledge and search knowledge, wherein the target parameters represent the authority of the knowledge;
[0067] A knowledge screening module, used for screening authoritative knowledge from the entity knowledge and search knowledge according to the obtained target parameters;
[0068] The fact verification module is specifically used for:
[0069] The screened knowledge is used as factual basis to verify whether the text to be verified is consistent with the facts.
[0070] In one embodiment of the present disclosure, the target parameter of knowledge includes at least one of the following parameters:
[0071] Source of knowledge, quality parameters characterizing text quality, and number of times the knowledge has been viewed.
[0072] In one embodiment of the present disclosure, the device further includes:
[0073] A knowledge deduplication module, used for deduplicating the entity knowledge and search knowledge;
[0074] The fact verification module is specifically used for:
[0075] The entity knowledge and search knowledge after deduplication processing are used as factual basis to verify whether the text to be verified is consistent with the facts.
[0076] In one embodiment of the present disclosure, the entity name recognition module is specifically used to:
[0077] The text to be verified is input into a pre-trained entity recognition model to obtain the entity name mentioned in the text to be verified which is output by the entity recognition model.
[0078] In one embodiment of the present disclosure, the target knowledge base includes an encyclopedia knowledge base and / or a search knowledge base that is updated in real time.
[0079] In a third aspect, an embodiment of the present disclosure further provides an electronic device, including:
[0080] at least one processor; and
[0081] a memory communicatively connected to the at least one processor; wherein,
[0082] The memory stores instructions that can be executed by the at least one processor, and the instructions are executed by the at least one processor so that the at least one processor can execute any method described in the first aspect.
[0083] In a fourth aspect, an embodiment of the present disclosure further provides a non-transitory computer-readable storage medium storing computer instructions, wherein the computer instructions are used to enable the computer to execute any of the methods described in the first aspect.
[0084] In a fifth aspect, an embodiment of the present disclosure further provides a computer program product, including a computer program, which implements any method described in the first aspect when executed by a processor.
[0085] From the above, it can be seen that when the scheme provided by the embodiment of the present disclosure is applied to factually verify the text, on the one hand, the entity names mentioned in the text to be verified are identified and matched with the entity names recorded in the target knowledge base, thereby obtaining the entity knowledge corresponding to the matched entity names; on the other hand, the search knowledge corresponding to the text title is obtained. Using the two kinds of knowledge, entity knowledge and search knowledge, as factual basis, it is verified whether the text to be verified is consistent with the facts. The whole process does not require human participation, which can improve the verification efficiency, and solve the limitation problem of human knowledge reserves. Using the two kinds of knowledge as factual basis for verification can improve the verification accuracy.
[0086] It should be understood that the content described in this section is not intended to identify the key or important features of the embodiments of the present disclosure, nor is it intended to limit the scope of the present disclosure. Other features of the present disclosure will become easily understood through the following description. BRIEF DESCRIPTION OF THE DRAWINGS
[0087] The accompanying drawings are used to better understand the present solution and do not constitute a limitation of the present disclosure.
[0088] Figure 1 A flowchart of a first text fact verification method provided by an embodiment of the present disclosure;
[0089] Figure 2A flowchart of a second text fact verification method provided by an embodiment of the present disclosure;
[0090] Figure 3 A structural diagram of a text fact verification device provided by an embodiment of the present disclosure;
[0091] Figure 4 It is a block diagram of an electronic device used to implement the text fact verification method of the embodiment of the present disclosure. DETAILED DESCRIPTION
[0092] The following is a description of exemplary embodiments of the present disclosure in conjunction with the accompanying drawings, including various details of the embodiments of the present disclosure to facilitate understanding, which should be considered as merely exemplary. Therefore, it should be recognized by those of ordinary skill in the art that various changes and modifications may be made to the embodiments described herein without departing from the scope and spirit of the present disclosure. Similarly, for the sake of clarity and conciseness, descriptions of well-known functions and structures are omitted in the following description.
[0093] The existing fact verification scheme uses manual verification of AIGC texts. Due to the limited speed of manual text reading and the limited knowledge reserves of humans, the manual verification method is inefficient and has low accuracy.
[0094] In order to solve the above technical problems, the present disclosure provides a text fact verification method and device, which are described in detail through specific embodiments below.
[0095] See also Figure 1 , Figure 1 The flowchart of the first text fact verification method provided in the embodiment of the present disclosure is as follows. In the embodiment, the method includes the following steps S101-S104.
[0096] Step S101: Identify the entity name mentioned in the text to be verified.
[0097] The text to be verified can be an AIGC text, a human-described text, or other text that needs to be verified to be consistent with the facts. Moreover, the text to be verified can be text in a variety of different fields, such as the medical field, the news field, the education field, etc.
[0098] The above entity name refers to the name of the entity. The entity represents an actual object, and the entity can be a person, a place, an object, etc.
[0099] Specifically, any one of the following two implementations may be used to identify the entity name mentioned in the text to be verified.
[0100] In the first implementation, a pre-trained large model may be used to identify entity names mentioned in the text to be verified. For details, please refer to the subsequent embodiments, which will not be described in detail here.
[0101] In the second implementation, a set containing multiple entity names can be obtained, so that when identifying the entity name mentioned in the text to be verified, for each entity name in the obtained set, it is detected whether the entity name exists in the text to be verified. If so, it is determined that the entity name belongs to the entity name mentioned in the text to be verified. When all entity names in the obtained set are traversed, the entity names mentioned in the text to be verified can be obtained.
[0102] In addition, the text to be verified consists of a text title and a text body. When identifying the entity names mentioned in the text to be verified, the text title and the text body of the text to be verified can be used as the text to be identified respectively, and any of the two implementation methods mentioned above can be used to perform entity name recognition on the text to be identified to obtain the entity name mentioned in the text title and the entity name mentioned in the text body. The two entity names obtained are the entity names mentioned in the text to be verified.
[0103] Step S102: Match the identified entity name with the entity name recorded in the target knowledge base, and obtain entity knowledge corresponding to the successfully matched entity name from the knowledge recorded in the target knowledge base.
[0104] The target knowledge base may record entity names and knowledge of entities corresponding to the entity names.
[0105] The target knowledge base may be an online knowledge base that is updated in real time.
[0106] Furthermore, there may be one or more target knowledge bases.
[0107] For example, the target knowledge base may be an encyclopedia knowledge base that is updated in real time, or a search knowledge base that is updated in real time, or the target knowledge base may include both the encyclopedia knowledge base and the search knowledge base that are updated in real time.
[0108] A knowledge base that is updated in real time can provide the latest and most reliable knowledge. Therefore, performing operations such as entity name matching and knowledge acquisition based on the knowledge base that is updated in real time can improve the timeliness and accuracy of the acquired knowledge.
[0109] Specifically, for each entity name mentioned in the text to be verified, it can be detected whether the entity name exists in the entity name of the path in the target knowledge base. If so, the entity name is the matched entity name.
[0110] After performing the above detection on all entity names mentioned in the text to be verified, the matching entity names can be determined, so that the knowledge corresponding to the matching entity names can be obtained from the knowledge recorded in the target knowledge base as entity knowledge.
[0111] In one embodiment of the present disclosure, when there are multiple target knowledge bases, when obtaining entity knowledge from the knowledge recorded in the target knowledge bases, the entity knowledge can be obtained from each target knowledge base in parallel, which can improve the efficiency of knowledge acquisition and further improve the efficiency of text fact verification.
[0112] Step S103: obtaining search results obtained by performing knowledge search using the text title of the text to be verified as the search term, as the search knowledge of the text to be verified.
[0113] The text title of the text to be verified is an important part of the entire text to be verified. The main text of the text to be verified can be understood as a description centered around the text title. Therefore, in addition to identifying entity names and obtaining entity knowledge corresponding to the entity names, the text title of the text to be verified can also be used as a search term to perform knowledge search and obtain search results as the search knowledge of the text to be verified.
[0114] For example, the text title is sent to a search engine so that the search engine performs an online search based on the text title, thereby obtaining the search results of the search engine as the search knowledge of the text to be verified.
[0115] For another example, the text title may be used as a search term to directly search in the knowledge base and obtain search results as search knowledge for the text to be verified.
[0116] Step S104: Using entity knowledge and search knowledge as factual basis, verify whether the text to be verified is consistent with the facts.
[0117] Specifically, any one of the following two implementation methods may be used to verify whether the text to be verified is consistent with the facts.
[0118] In the first implementation, a pre-trained large language model may be used to perform fact verification on the text to be verified. The specific verification method may be found in the subsequent embodiments and will not be described in detail here.
[0119] In the second implementation method, after obtaining entity knowledge and search knowledge, a knowledge graph is constructed based on these two kinds of knowledge, and the entities and entity relationships in the constructed knowledge graph are used to detect whether the entity relationships between the same entities described in the text to be verified are correct.
[0120] From the above, it can be seen that when applying the solution provided by the embodiment of the present disclosure to verify the facts of the text, on the one hand, the entity names mentioned in the text to be verified are identified and matched with the entity names recorded in the target knowledge base, thereby obtaining the entity knowledge corresponding to the matched entity names; on the other hand, the search knowledge corresponding to the text title is obtained. Using the two kinds of knowledge, entity knowledge and search knowledge, as factual basis, it is verified whether the text to be verified is consistent with the facts. The whole process does not require human participation, which can improve the verification efficiency and the response speed of fact verification, and solve the limitation problem of manual knowledge reserves. Using the two kinds of knowledge as factual basis for verification can improve the accuracy and reliability of verification, thereby improving the user's trust in using this solution.
[0121] In addition, the above-mentioned text to be verified can be text in a variety of scenarios. Therefore, the solution provided by the embodiment of the present disclosure can perform fact verification on texts in a variety of scenarios, enhance the scalability of fact verification, expand the scope of application of fact verification, and provide strong support for the promotion and application of AIGC texts in different fields.
[0122] The first implementation method of identifying the entity name mentioned in the text to be verified in the above step S101 is described in detail below.
[0123] In one embodiment of the present disclosure, the text to be verified may be input into a pre-trained entity recognition model to obtain the entity name mentioned in the text to be verified output by the entity recognition model.
[0124] The above-mentioned entity recognition model can be an SFT (Supervised Finetuning) model, such as a self-supervised fine-tuning model, a semi-supervised fine-tuning model, and the like.
[0125] In the training process of the above entity recognition model, the initial recognition model for entity recognition can be trained by taking sample text as model input and taking the entity name mentioned in the sample text as the true value of the model output.
[0126] The trained entity recognition model has learned the features of entity recognition. In this way, after the text to be verified is input into the entity recognition model, the entity recognition model can determine the entity name mentioned in the text to be verified based on the learned entity recognition features, and then output the determined entity name.
[0127] It can be seen that by using the pre-trained entity recognition model, the entity names mentioned in the text to be verified can be accurately obtained, so that the text to be verified can be fact-verified based on the obtained entity names, which can improve the verification accuracy.
[0128] For a relatively long text to be verified, when identifying the entity names mentioned in the text, the method mentioned in the following embodiment may be used for identification.
[0129] In one embodiment of the present disclosure, when identifying entity names mentioned in a text to be verified, the text to be verified can be segmented to obtain text sentences; core sentences in each text sentence are determined; and entity names mentioned in the core sentences are identified.
[0130] First, three implementation methods of sentence processing are introduced.
[0131] In a first implementation, the periods in the text to be verified may be identified, and then division may be performed at the position of each period, thereby dividing the text to be verified into a plurality of text sentences.
[0132] In the second implementation, a word count range of a sentence may be preset, and then the text to be verified may be divided into a plurality of text sentences whose word counts fall within the word count range according to the word count range.
[0133] In the third implementation, the text to be verified may be segmented based on other sentence segmentation algorithms, models, etc. to obtain each text sentence.
[0134] The following is an introduction to the method of determining the core clauses in each text clause.
[0135] After obtaining each text sentence, a model, algorithm, etc. for extracting important sentences may be used to extract core sentences from each text sentence. For example, a TextRank algorithm may be used to extract core sentences from each text sentence.
[0136] After determining the core sentence, the core sentence can be used as the text to be recognized, and any of the two implementation methods mentioned in the above step S101 can be used to recognize the entity name mentioned in the core sentence. The specific recognition process can be found in the above embodiment and will not be repeated here.
[0137] In addition, the text title can also be used as a core sentence to extract the entity names mentioned in the text title.
[0138] From the above, it can be seen that when the scheme provided by the embodiment of the present disclosure is applied to perform fact verification on the text to be verified, the text to be verified is segmented into sentences, and the core sentences are determined in the obtained text sentences, so that only the entity names mentioned in the core sentences are identified. Compared with identifying the entity names mentioned in the entire text to be verified, this can improve the recognition efficiency of the entity names, and thus improve the efficiency of fact verification.
[0139] The first implementation method of verifying whether the text to be verified is consistent with the facts mentioned in the above step S104 is described in detail below.
[0140] In one embodiment of the present disclosure, when verifying whether the text to be verified is consistent with the facts, a model prompt instruction containing the text to be verified, entity knowledge and search knowledge can be generated; the model prompt instruction is input into a pre-trained fact verification large language model to obtain a verification result output by the fact verification large language model.
[0141] The verification result is: the fact verification large language model verifies whether the text to be verified is consistent with the facts based on entity knowledge and search knowledge.
[0142] The above-mentioned model prompt instruction may include a variety of information, such as text information representing the text expected to be verified by the model, and knowledge information representing the knowledge based on which the fact verification is based. The model prompt instruction is used to instruct the fact verification large language model to verify whether the information value of the text information is consistent with the fact based on the information value of the knowledge information.
[0143] In the training process of the fact verification large language model, a sample prompt instruction containing sample text and sample knowledge related to the sample text can be generated, wherein the information value of the text information in the sample prompt instruction is the sample text, and the information value of the knowledge information is the sample knowledge. Thus, the generated sample prompt instruction is used as the model input, and the conclusion of whether the sample text is consistent with the fact is used as the true value of the model output, and the initial verification model for fact verification is trained.
[0144] Specifically, when generating a model prompt instruction, the text to be verified can be added to the preset template instruction as the information value of the text information in the structured template instruction, and the entity knowledge and search knowledge can be added as the information value of the knowledge information in the structured template instruction, so as to obtain the instruction after adding information as the model prompt instruction to be input. Among them, the above template instruction can be a structured template instruction, and the use of a structured template instruction can improve the reasoning performance of the fact verification large language model and improve the quality of the output results of the model.
[0145] The generated model prompt instruction is input into the fact verification large language model. The fact verification large language model can verify whether the text to be verified is consistent with the facts based on entity knowledge and search knowledge, and output the verification result.
[0146] From the above, it can be seen that when the solution provided by the embodiment of the present disclosure is applied to perform fact verification on the text to be verified, the pre-trained fact verification large language model can be used to accurately verify whether the text to be verified is consistent with the facts. Therefore, the text fact verification solution provided by the embodiment of the present disclosure can improve the accuracy of text fact verification.
[0147] In addition to the above-mentioned text information and knowledge information, the above-mentioned model prompt instruction may also include other information to instruct the fact verification large language model to perform model reasoning according to the other information.
[0148] In one embodiment of the present disclosure, the model prompt instruction also includes at least one of the first indication information and the second indication information.
[0149] 1. First instruction information
[0150] The first instruction information is used to instruct the fact verification large language model to output an erroneous sentence that does not match the fact when it verifies that the text to be verified does not match the fact.
[0151] Specifically, when the fact verification large language model performs fact verification on the text to be verified, it can perform fact verification on the text to be verified sentence by sentence based on entity knowledge and search knowledge. Therefore, for each sentence in the text to be verified, the fact verification large language model can verify whether it is consistent with the facts. When the fact verification large language model verifies that there are sentences in the text to be verified that are inconsistent with the facts, it can be determined that the text to be verified is inconsistent with the facts, and the verified sentences that are inconsistent with the facts are erroneous sentences.
[0152] When the model prompt instruction does not include the above-mentioned first indication information, the fact verification large language model can output a conclusion on whether the text to be verified is consistent with the facts during the fact verification process of the text to be verified, including two types: the text to be verified is consistent with the facts and the text to be verified is inconsistent with the facts; when the model prompt instruction includes the above-mentioned first indication information, after obtaining the model prompt instruction, the fact verification large language model can be regarded as receiving an instruction to output an erroneous statement that is inconsistent with the facts when the text to be verified is verified to be inconsistent with the facts. In this way, the fact verification large language model can not only output a conclusion on whether the text to be verified is consistent with the facts during the fact verification process of the text to be verified, but also output the erroneous statements in the text to be verified verified by the model when the conclusion is that the text to be verified is inconsistent with the facts. This makes it easy to modify the erroneous statements in the text to be verified later, thereby improving the verification performance of text fact verification.
[0153] 2. Second instruction information
[0154] The second indication information is used to indicate the error reason why the fact verification large language model outputs an error statement that does not conform to the fact.
[0155] When the fact verification large language model verifies an erroneous statement that is inconsistent with the facts, the fact verification large language model can generate the error reason why the erroneous statement is inconsistent with the facts based on the entity knowledge and related knowledge in the search knowledge and the erroneous statement, so that when outputting the conclusion that the text to be verified is inconsistent with the facts, the generated error reason is also output. This makes it easier to modify the text to be verified based on the error reason in the future, thereby improving the verification performance of text fact verification.
[0156] In one embodiment of the present disclosure, if the model prompt instruction includes two kinds of information, namely, the first indication information and the second indication information, then during the fact verification process of the text to be verified, if the fact verification large language model verifies that the text to be verified is inconsistent with the facts, it can output the conclusion that the text to be verified is inconsistent with the facts, the erroneous sentence in the text to be verified, and the cause of the error of the erroneous sentence. This can facilitate the subsequent targeted modification of the erroneous sentence in the text to be verified, thereby improving the verification performance of the text fact verification.
[0157] In one embodiment of the present disclosure, when the model prompt instruction includes the second indication information, the model prompt instruction also includes: a maximum limit on the number of words of the error cause.
[0158] The above maximum word limit is a preset arbitrary word number, such as 100 words, 1000 words, etc.
[0159] For example, the above maximum word limit is 100 words, then the fact verification large language model can generate an error reason of no more than 100 words when generating an error reason.
[0160] In this scheme, when the model prompt instruction includes the second indication information, the model prompt instruction also includes the maximum limit on the number of words of the error cause, which can be regarded as controlling the number of words of the error cause output by the fact verification large language model. This can improve the fact verification efficiency compared to the error cause of the long text generated by the fact verification large language model.
[0161] For a relatively long text to be verified, when verifying whether it is consistent with the facts, one of the following two implementation methods can be used for processing.
[0162] In the first implementation, when using the fact verification large language model to perform fact verification, the text to be verified can be abbreviated to generate a model prompt instruction including the abbreviated text to be verified, entity knowledge, and search knowledge.
[0163] Specifically, the following method 1 or method 2 may be used to abbreviate the text to be verified.
[0164] Method 1: For each paragraph in the text to be verified, extract the topic semantics of the paragraph, and then for each sentence in the paragraph, check whether the semantics of the sentence is related to the topic semantics of the paragraph. If not, remove the sentence.
[0165] In this way, irrelevant sentences in each paragraph of the text to be verified can be eliminated, thereby achieving the purpose of abbreviating the text to be verified.
[0166] Method 2: For each sentence in the text to be verified, the sentence structure of the sentence can be analyzed, and the modifying words in the sentence can be removed, leaving only the main part of the sentence.
[0167] After abbreviating the text to be verified by adopting the above-mentioned method 1 or method 2 to obtain the abbreviated text to be verified, the abbreviated text to be verified can be used as the information value of the text information in the instruction, and the entity knowledge and search knowledge can be used as the information value of the indication information in the instruction to generate a model prompt instruction. The specific generation process can be found in the above-mentioned embodiment, which will not be repeated here.
[0168] In this implementation, the text to be verified is abbreviated, which can shorten the length of the text to be verified. Therefore, when the fact verification is performed on the text using a fact verification large language model, the verification time of the fact verification large language model can be shortened, thereby improving the fact verification efficiency.
[0169] In the second implementation method, during the fact verification process, the text to be verified can be divided into blocks to obtain multiple block texts; using entity knowledge and search knowledge as factual basis, each block text is verified in turn to see whether it is consistent with the facts; if it is verified that there is a block text that does not match the facts, it is determined that the text to be verified does not match the facts.
[0170] Specifically, any one of the following methods 3 to 5 may be used to process the text to be verified in blocks.
[0171] Method 3: Every preset number of consecutive paragraphs in the text to be verified can be regarded as a block text. For example, every two or three consecutive paragraphs can be regarded as a block text.
[0172] Method 4: You can set the maximum number of words in a block text, and treat multiple consecutive paragraphs that do not exceed the maximum number of words as a block text.
[0173] When the fact verification is performed using a fact verification large language model, the maximum number of words can be determined based on the maximum number of input words of the fact verification large language model. For example, the maximum number of words can be half of the maximum number of input words of the model.
[0174] Method 5: The number of block texts can be preset, so that when the text to be verified is processed in blocks, it can be divided into the preset number of block texts. For example, if the above number is 3, the text to be verified can be evenly divided into 3 block texts.
[0175] After the text to be verified is divided into blocks using any of the methods from method 3 to method 5, each block of text can be verified in turn. When one of the block texts is verified to be inconsistent with the facts, it can be directly determined that the text to be verified is inconsistent with the facts, and there is no need to perform fact verification on other unverified block texts. This fact verification method is called early stopping verification method. The use of early stopping verification method can improve the efficiency of fact verification and save computing resources.
[0176] The above-mentioned fact verification of each block text in turn can be carried out in turn according to the order of each block text in the text to be verified, or a block text can be randomly selected from the unverified block texts for fact verification each time.
[0177] For example, if the text to be verified is divided into three blocks, namely text 1, text 2 and text 3, then during the verification process, the text 1, text 2 and text 3 can be verified in turn according to the order of the three texts in the text to be verified. If it is verified that text 1 is inconsistent with the facts, it is determined that the text to be verified is inconsistent with the facts, and there is no need to verify the facts of text 2 and text 3.
[0178] For another example, after the text to be verified is divided into blocks to obtain text 1, text 2 and text 3, any one of text 1, text 2 and text 3 is selected for fact verification. For example, if text 2 is selected for fact verification, if text 2 is inconsistent with the facts, then the text to be verified is determined to be inconsistent with the facts, and there is no need to perform fact verification on text 1 and text 3 again; if text 2 is consistent with the facts, then any one of text 1 and text 3 is selected for fact verification. For example, if text 3 is selected for fact verification, the verification process is the same as that of text 2. If text 3 is inconsistent with the facts, then the text to be verified is determined to be inconsistent with the facts, and there is no need to perform fact verification on text 1 again. If text 3 is consistent with the facts, then text 1 is finally verified.
[0179] After obtaining the above entity knowledge and search knowledge, at least one of the following two methods may be used to process the entity knowledge and search knowledge, and then fact verification is performed on the text to be verified based on the processed entity knowledge and search knowledge.
[0180] In the first implementation method, target parameters of entity knowledge and search knowledge can be obtained, and authoritative knowledge can be screened from the entity knowledge and search knowledge based on the obtained target parameters. When verifying whether the text to be verified is consistent with the facts, the screened knowledge is used as the factual basis to verify whether the text to be verified is consistent with the facts.
[0181] Among them, the above target parameters represent the authority of knowledge.
[0182] The target parameters of the above knowledge include at least one of the following parameters:
[0183] Source of knowledge, quality parameters characterizing text quality, and number of times the knowledge has been viewed.
[0184] The following describes the three parameters of knowledge source, quality parameter and knowledge browsing times, and the method of using these three parameters as target parameters for knowledge screening.
[0185] 1. Source of knowledge
[0186] Entity knowledge is obtained from the knowledge base, so the knowledge source of entity knowledge is the knowledge base containing this knowledge. Search knowledge is the search result obtained by searching the text title of the text to be verified as the search term, and the search result comes from various knowledge providers, so the knowledge source of search knowledge is the knowledge provider that provides the search knowledge.
[0187] The higher the credibility and popularity of a knowledge source, the more authoritative the knowledge it provides. Therefore, the source of knowledge can accurately reflect the authority of the knowledge. Using the source of knowledge as the target parameter of knowledge can improve the accuracy of the target parameter.
[0188] When screening knowledge, you can filter out knowledge provided by knowledge sources with high credibility and high popularity based on the credibility and popularity of the knowledge sources of the entity knowledge and the search knowledge.
[0189] 2. Quality parameters
[0190] After collecting knowledge, the knowledge platform that maintains the knowledge base can perform text quality detection on the knowledge to obtain parameter values of the quality parameters of the knowledge. In this way, when obtaining the entity knowledge corresponding to the entity name in the aforementioned step S102, the parameter values of the quality parameters of the entity knowledge can be obtained in the knowledge base at the same time.
[0191] Similarly, the above-mentioned knowledge provider can also perform text quality detection on the search knowledge to obtain parameter values of the quality parameters of the search knowledge, so that when the search knowledge (ie, search results) is obtained in the aforementioned step S103, the parameter values of the quality parameters of the search knowledge are also obtained.
[0192] The higher the value of the knowledge quality parameter, the more authoritative the knowledge is. Therefore, the knowledge quality parameter can accurately reflect the authority of the knowledge, and using the quality parameter as the target parameter of the knowledge can improve the accuracy of the target parameter.
[0193] When screening knowledge, multiple pieces of knowledge with higher parameter values of quality parameters can be screened out from entity knowledge and search knowledge.
[0194] For example, a preset number of pieces of knowledge are selected before screening according to the order of parameter values of the quality parameters of the knowledge from high to low.
[0195] For another example, among entity knowledge and search knowledge, the qualities of target parameters having parameter values greater than a preset threshold are screened out.
[0196] 3. Number of times the knowledge has been viewed
[0197] The knowledge platform that maintains the knowledge base can count the number of times each piece of knowledge in the knowledge base has been viewed, and the search engine can also count the number of times the knowledge provided by the knowledge provider has been viewed. In this way, when obtaining the entity knowledge and search knowledge as mentioned above, the number of times the entity knowledge has been viewed and the number of times the search knowledge has been viewed can be obtained together.
[0198] The greater the number of times a piece of knowledge is viewed, the more accurate and authoritative the knowledge is. Therefore, the number of times a piece of knowledge is viewed can accurately reflect the authority of the knowledge. Using the number of times a piece of knowledge is viewed as the target parameter of the knowledge can improve the accuracy of the target parameter.
[0199] When filtering knowledge, multiple pieces of knowledge with a large number of views may be filtered out.
[0200] In addition, the target parameter may include one or more of the above three parameters, so that when the knowledge is screened according to the target parameter, the knowledge may be screened comprehensively according to the one or more parameters included in the target parameter.
[0201] For example, if the target parameters include quality parameters and the number of times knowledge has been viewed, then when filtering knowledge, the knowledge whose quality parameter value is greater than a preset threshold and whose number of times knowledge has been viewed is greater than a preset number can be filtered out from the entity knowledge and search knowledge.
[0202] After the authoritative knowledge is screened out, the screened knowledge is used as the factual basis to verify whether the text to be verified is consistent with the facts. The method of using the entity knowledge and search knowledge as the factual basis to verify whether the text to be verified is consistent with the facts in the aforementioned step S104 can be referred to, and will not be repeated here.
[0203] In this scheme, the target parameters of knowledge are used to screen authoritative knowledge from entity knowledge and search knowledge. This can, on the one hand, reduce the amount of calculation for subsequent fact verification, improve the efficiency of fact verification, and reduce the cost of fact verification. If a large language model for fact verification is used for fact verification, the cost of model reasoning can be reduced. On the other hand, it can avoid the interference of weakly authoritative knowledge on fact verification and improve the accuracy of fact verification.
[0204] In the second implementation, entity knowledge and search knowledge may be deduplicated, and when verifying whether the text to be verified is consistent with the facts, the deduplicated entity knowledge and search knowledge are used as factual basis to verify whether the text to be verified is consistent with the facts.
[0205] Specifically, the semantics of each piece of knowledge can be identified, and the semantic similarity of each pair of knowledge can be calculated. If the semantic similarity is high, one of the pieces of knowledge is deleted, thereby achieving the purpose of deduplication. After deduplication of the entity knowledge and search knowledge, the entity knowledge and search knowledge after deduplication are used as the factual basis to verify whether the text to be verified is consistent with the facts. For example, the method of using the entity knowledge and search knowledge as the factual basis to verify whether the text to be verified is consistent with the facts in the aforementioned step S104, which will not be repeated here.
[0206] In this solution, deduplication of entity knowledge and search knowledge can eliminate redundant knowledge, ensure the authority and accuracy of knowledge, reduce the amount of calculation for subsequent fact verification, reduce the cost of fact verification, and improve the efficiency and accuracy of fact verification.
[0207] In one embodiment of the present disclosure, see Figure 2 , a flow chart of a second text fact verification method is provided. In this embodiment, the above method includes the following steps S201-S207.
[0208] Step S201: Segment the main body of the text to be verified, and extract core sentences from the obtained sentences.
[0209] Step S202: Identify the entity names mentioned in the core sentences and the text title of the text to be verified.
[0210] Step S203: Match the identified entity name with the entity name recorded in the star map relationship library, and obtain the star map relationship knowledge corresponding to the successfully matched entity name from the star map relationship library, wherein the star map relationship knowledge includes not only the knowledge but also the star map set name and the associated encyclopedia entry name.
[0211] Step S204: Match the identified entity name with the entity name recorded in the encyclopedia knowledge base, and obtain the encyclopedia entry knowledge corresponding to the successfully matched entity name from the encyclopedia knowledge base, wherein the encyclopedia entry knowledge includes not only the knowledge but also the entry name and the entry summary.
[0212] Step S205: Obtain search results obtained by performing a knowledge search using the text title of the text to be verified as a search term.
[0213] Step S206: Integrate the above star map relationship knowledge, encyclopedia entry knowledge and search results, and perform deduplication and screening on the star map relationship knowledge, encyclopedia entry knowledge and search results.
[0214] Step S207: Divide the text to be verified into blocks, and generate a model prompt instruction prompt according to the order of each block text in the text to be verified, based on the block text and the obtained knowledge, and input the prompt into the fact verification large language model to obtain the verification result output by the model. The verification result is the result of the fact verification large language model verifying whether the block text in the prompt is consistent with the facts based on the obtained knowledge.
[0215] Corresponding to the text fact verification method, the embodiment of the present disclosure also provides a text fact verification device.
[0216] In one embodiment of the present disclosure, see Figure 3 , a structural diagram of a text fact verification device is provided. In this embodiment, the device includes:
[0217] An entity name recognition module 301 is used to recognize entity names mentioned in the text to be verified;
[0218] The entity knowledge acquisition module 302 is used to match the recognized entity name with the entity name recorded in the target knowledge base, and obtain the entity knowledge corresponding to the successfully matched entity name from the knowledge recorded in the target knowledge base;
[0219] A search knowledge acquisition module 303 is used to obtain search results obtained by performing knowledge search using the text title of the text to be verified as a search term, as the search knowledge of the text to be verified;
[0220] The fact verification module 304 is used to verify whether the text to be verified is consistent with the facts by taking the entity knowledge and the search knowledge as factual basis.
[0221] From the above, it can be seen that when applying the solution provided by the embodiment of the present disclosure to verify the facts of the text, on the one hand, the entity names mentioned in the text to be verified are identified and matched with the entity names recorded in the target knowledge base, thereby obtaining the entity knowledge corresponding to the matched entity names; on the other hand, the search knowledge corresponding to the text title is obtained. Using the two kinds of knowledge, entity knowledge and search knowledge, as factual basis, it is verified whether the text to be verified is consistent with the facts. The whole process does not require human participation, which can improve the verification efficiency and the response speed of fact verification, and solve the limitation problem of manual knowledge reserves. Using the two kinds of knowledge as factual basis for verification can improve the accuracy and reliability of verification, thereby improving the user's trust in using this solution.
[0222] In addition, the above-mentioned text to be verified can be text in a variety of scenarios. Therefore, the solution provided by the embodiment of the present disclosure can perform fact verification on texts in a variety of scenarios, enhance the scalability of fact verification, expand the scope of application of fact verification, and provide strong support for the promotion and application of AIGC texts in different fields.
[0223] In one embodiment of the present disclosure, the fact verification module 304 is specifically used to:
[0224] The text to be verified is processed into blocks to obtain multiple block texts;
[0225] Taking the entity knowledge and the search knowledge as factual basis, verifying in turn whether each block of text is consistent with the facts;
[0226] If it is verified that there are block texts that are inconsistent with the facts, it is determined that the text to be verified is inconsistent with the facts.
[0227] In this scheme, when fact verification is performed on one of the block texts, if it is verified that the block text is inconsistent with the facts, it can be directly determined that the text to be verified is inconsistent with the facts, and there is no need to perform fact verification on other unverified block texts. This fact verification method is called early stopping verification method. The use of early stopping verification method can improve the efficiency of fact verification and save computing resources.
[0228] In one embodiment of the present disclosure, the fact verification module 304 includes:
[0229] An instruction generation submodule, used for generating a model prompt instruction including the text to be verified, the entity knowledge and the search knowledge;
[0230] The model reasoning submodule is used to input the model prompt instruction into a pre-trained fact verification large language model to obtain a verification result output by the fact verification large language model, wherein the verification result is: the fact verification large language model verifies whether the text to be verified is consistent with the facts based on the entity knowledge and search knowledge.
[0231] From the above, it can be seen that when the solution provided by the embodiment of the present disclosure is applied to perform fact verification on the text to be verified, the pre-trained fact verification large language model can be used to accurately verify whether the text to be verified is consistent with the facts. Therefore, the text fact verification solution provided by the embodiment of the present disclosure can improve the accuracy of text fact verification.
[0232] In one embodiment of the present disclosure, the instruction generation submodule is specifically used to:
[0233] Performing abbreviation processing on the text to be verified;
[0234] Generate a model prompt instruction including the text to be verified after abbreviation processing, the entity knowledge and the search knowledge.
[0235] In this solution, the text to be verified is abbreviated, which can shorten the length of the text to be verified. Therefore, when the fact verification is performed on the text using the fact verification large language model, the verification time of the fact verification large language model can be shortened, thereby improving the fact verification efficiency.
[0236] In one embodiment of the present disclosure, the model prompt instruction also includes at least one of the following information:
[0237] first indication information, wherein the first indication information instructs the fact verification large language model to output an erroneous statement that is inconsistent with the fact when verifying that the text to be verified is inconsistent with the fact;
[0238] Second indication information, wherein the second indication information indicates the error reason why the error statement output by the fact verification large language model does not conform to the facts.
[0239] When the model prompt instruction includes the first indication information, the fact verification large language model can not only output the conclusion of whether the text to be verified is consistent with the facts during the fact verification process of the text to be verified, but also output the erroneous sentences in the text to be verified verified by the model when the conclusion is that the text to be verified is inconsistent with the facts. This makes it easier to modify the erroneous sentences in the text to be verified later, thereby improving the verification performance of the text fact verification.
[0240] When the model prompt instruction includes the second indication information, the fact verification large language model outputs the generated error reason when outputting the conclusion that the text to be verified is inconsistent with the facts. This makes it easier to modify the text to be verified according to the error reason, thereby improving the verification performance of text fact verification.
[0241] In the case where the model prompt instruction includes the first indication information and the second indication information, during the fact verification process of the text to be verified, if the fact verification large language model finds that the text to be verified is inconsistent with the facts, it can output the conclusion that the text to be verified is inconsistent with the facts, the erroneous sentence in the text to be verified, and the cause of the error of the erroneous sentence. This will make it easier to make targeted modifications to the erroneous sentences in the text to be verified later, thereby improving the verification performance of text fact verification.
[0242] In one embodiment of the present disclosure, when the model prompt instruction includes the second indication information, the model prompt instruction also includes: a maximum limit on the number of words of the error cause.
[0243] In this scheme, when the model prompt instruction includes the second indication information, the model prompt instruction also includes the maximum limit on the number of words of the error cause, which can be regarded as controlling the number of words of the error cause output by the fact verification large language model. This can improve the fact verification efficiency compared to the error cause of the long text generated by the fact verification large language model.
[0244] In one embodiment of the present disclosure, the entity name recognition module 301 is specifically used to:
[0245] Sentence processing is performed on the text to be verified to obtain each text sentence;
[0246] Identify the core clauses in each text clause;
[0247] The entity names mentioned in the core clause are identified.
[0248] From the above, it can be seen that when the scheme provided by the embodiment of the present disclosure is applied to perform fact verification on the text to be verified, the text to be verified is segmented into sentences, and the core sentences are determined in the obtained text sentences, so that only the entity names mentioned in the core sentences are identified. Compared with identifying the entity names mentioned in the entire text to be verified, this can improve the recognition efficiency of the entity names, and thus improve the efficiency of fact verification.
[0249] In one embodiment of the present disclosure, the device further includes:
[0250] A parameter acquisition module, used to obtain target parameters of the entity knowledge and search knowledge, wherein the target parameters represent the authority of the knowledge;
[0251] A knowledge screening module, used for screening authoritative knowledge from the entity knowledge and search knowledge according to the obtained target parameters;
[0252] The fact verification module 304 is specifically used for:
[0253] The screened knowledge is used as factual basis to verify whether the text to be verified is consistent with the facts.
[0254] In this scheme, the target parameters of knowledge are used to screen authoritative knowledge from entity knowledge and search knowledge. This can, on the one hand, reduce the amount of calculation for subsequent fact verification, improve the efficiency of fact verification, and reduce the cost of fact verification. If a large language model for fact verification is used for fact verification, the cost of model reasoning can be reduced. On the other hand, it can avoid the interference of weakly authoritative knowledge on fact verification and improve the accuracy of fact verification.
[0255] In one embodiment of the present disclosure, the target parameter of knowledge includes at least one of the following parameters:
[0256] Source of knowledge, quality parameters characterizing text quality, and number of times the knowledge has been viewed.
[0257] The higher the credibility and popularity of a knowledge source, the more authoritative the knowledge it provides. Therefore, the source of knowledge can accurately reflect the authority of the knowledge. Using the source of knowledge as the target parameter of knowledge can improve the accuracy of the target parameter.
[0258] The higher the value of the knowledge quality parameter, the more authoritative the knowledge is. Therefore, the knowledge quality parameter can accurately reflect the authority of the knowledge, and using the quality parameter as the target parameter of the knowledge can improve the accuracy of the target parameter.
[0259] The greater the number of times a piece of knowledge is viewed, the more accurate and authoritative the knowledge is. Therefore, the number of times a piece of knowledge is viewed can accurately reflect the authority of the knowledge. Using the number of times a piece of knowledge is viewed as the target parameter of the knowledge can improve the accuracy of the target parameter.
[0260] In one embodiment of the present disclosure, the device further includes:
[0261] A knowledge deduplication module, used for deduplicating the entity knowledge and search knowledge;
[0262] The fact verification module 304 is specifically used for:
[0263] The entity knowledge and search knowledge after deduplication processing are used as factual basis to verify whether the text to be verified is consistent with the facts.
[0264] In this solution, deduplication of entity knowledge and search knowledge can eliminate redundant knowledge, ensure the authority and accuracy of knowledge, reduce the amount of calculation for subsequent fact verification, reduce the cost of fact verification, and improve the efficiency and accuracy of fact verification.
[0265] In one embodiment of the present disclosure, the entity name recognition module 301 is specifically used to:
[0266] The text to be verified is input into a pre-trained entity recognition model to obtain the entity name mentioned in the text to be verified which is output by the entity recognition model.
[0267] It can be seen that by using the pre-trained entity recognition model, the entity names mentioned in the text to be verified can be accurately obtained, so that the text to be verified can be fact-verified based on the obtained entity names, which can improve the verification accuracy.
[0268] In one embodiment of the present disclosure, the target knowledge base includes an encyclopedia knowledge base and / or a search knowledge base that is updated in real time.
[0269] A knowledge base that is updated in real time can provide the latest and most reliable knowledge. Therefore, performing operations such as entity name matching and knowledge acquisition based on the knowledge base that is updated in real time can improve the timeliness and accuracy of the acquired knowledge.
[0270] According to an embodiment of the present disclosure, the present disclosure also provides an electronic device, a readable storage medium and a computer program product.
[0271] In one embodiment of the present disclosure, an electronic device includes:
[0272] at least one processor; and
[0273] a memory communicatively connected to the at least one processor; wherein,
[0274] The memory stores instructions that can be executed by the at least one processor, and the instructions are executed by the at least one processor to enable the at least one processor to perform any of the aforementioned text fact verification methods.
[0275] Figure 4A schematic block diagram of an example electronic device 400 that can be used to implement an embodiment of the present disclosure is shown. The electronic device is intended to represent various forms of digital computers, such as laptop computers, desktop computers, workstations, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers. The electronic device can also represent various forms of mobile devices, such as personal digital processing, cellular phones, smart phones, wearable devices, and other similar computing devices. The components shown herein, their connections and relationships, and their functions are merely examples and are not intended to limit the implementation of the present disclosure described and / or required herein.
[0276] like Figure 4 As shown, the device 400 includes a computing unit 401, which can perform various appropriate actions and processes according to a computer program stored in a read-only memory (ROM) 402 or a computer program loaded from a storage unit 408 into a random access memory (RAM) 403. In the RAM 403, various programs and data required for the operation of the device 400 can also be stored. The computing unit 401, the ROM 402, and the RAM 403 are connected to each other via a bus 404. An input / output (I / O) interface 405 is also connected to the bus 404.
[0277] A number of components in the device 400 are connected to the I / O interface 405, including: an input unit 406, such as a keyboard, a mouse, etc.; an output unit 407, such as various types of displays, speakers, etc.; a storage unit 408, such as a disk, an optical disk, etc.; and a communication unit 409, such as a network card, a modem, a wireless communication transceiver, etc. The communication unit 409 allows the device 400 to exchange information / data with other devices through a computer network such as the Internet and / or various telecommunication networks.
[0278] The computing unit 401 may be a variety of general and / or special processing components with processing and computing capabilities. Some examples of the computing unit 401 include, but are not limited to, a central processing unit (CPU), a graphics processing unit (GPU), various dedicated artificial intelligence (AI) computing chips, various computing units running machine learning model algorithms, digital signal processors (DSPs), and any appropriate processors, controllers, microcontrollers, etc. The computing unit 401 performs the various methods and processes described above, such as the text fact verification method. For example, in some embodiments, the text fact verification method may be implemented as a computer software program, which is tangibly contained in a machine-readable medium, such as a storage unit 408. In some embodiments, part or all of the computer program may be loaded and / or installed on the device 400 via ROM 402 and / or communication unit 409. When the computer program is loaded into RAM 403 and executed by the computing unit 401, one or more steps of the text fact verification method described above may be performed. Alternatively, in other embodiments, the computing unit 401 may be configured to perform the text fact verification method in any other appropriate manner (e.g., by means of firmware).
[0279] Various implementations of the systems and techniques described above herein can be implemented in digital electronic circuit systems, integrated circuit systems, field programmable gate arrays (FPGAs), application specific integrated circuits (ASICs), application specific standard products (ASSPs), systems on chips (SOCs), complex programmable logic devices (CPLDs), computer hardware, firmware, software, and / or combinations thereof. These various implementations can include: being implemented in one or more computer programs that can be executed and / or interpreted on a programmable system including at least one programmable processor, which can be a special purpose or general purpose programmable processor that can receive data and instructions from a storage system, at least one input device, and at least one output device, and transmit data and instructions to the storage system, the at least one input device, and the at least one output device.
[0280] The program code for implementing the method of the present disclosure may be written in any combination of one or more programming languages. These program codes may be provided to a processor or controller of a general-purpose computer, a special-purpose computer, or other programmable data processing device, so that the program code, when executed by the processor or controller, enables the functions / operations specified in the flow chart and / or block diagram to be implemented. The program code may be executed entirely on the machine, partially on the machine, partially on the machine and partially on a remote machine as a stand-alone software package, or entirely on a remote machine or server.
[0281] In the context of the present disclosure, a machine-readable medium may be a tangible medium that may contain or store a program for use by or in conjunction with an instruction execution system, device, or equipment. A machine-readable medium may be a machine-readable signal medium or a machine-readable storage medium. A machine-readable medium may include, but is not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, device, or equipment, or any suitable combination of the foregoing. A more specific example of a machine-readable storage medium may include an electrical connection based on one or more lines, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.
[0282] To provide interaction with a user, the systems and techniques described herein can be implemented on a computer having: a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to the user; and a keyboard and pointing device (e.g., a mouse or trackball) through which the user can provide input to the computer. Other types of devices can also be used to provide interaction with the user; for example, the feedback provided to the user can be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user can be received in any form (including acoustic input, voice input, or tactile input).
[0283] The systems and techniques described herein may be implemented in a computing system that includes back-end components (e.g., as a data server), or a computing system that includes middleware components (e.g., an application server), or a computing system that includes front-end components (e.g., a user computer with a graphical user interface or a web browser through which a user can interact with implementations of the systems and techniques described herein), or a computing system that includes any combination of such back-end components, middleware components, or front-end components. The components of the system may be interconnected by any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include: a local area network (LAN), a wide area network (WAN), and the Internet.
[0284] A computer system may include a client and a server. The client and the server are generally remote from each other and usually interact through a communication network. The relationship of client and server is generated by computer programs running on respective computers and having a client-server relationship with each other. The server may be a cloud server, a server of a distributed system, or a server combined with a blockchain.
[0285] It should be understood that the various forms of processes shown above can be used to reorder, add or delete steps. For example, the steps recorded in this disclosure can be executed in parallel, sequentially or in different orders, as long as the desired results of the technical solutions disclosed in this disclosure can be achieved, and this document does not limit this.
[0286] The above specific implementations do not constitute a limitation on the protection scope of the present disclosure. It should be understood by those skilled in the art that various modifications, combinations, sub-combinations and substitutions can be made according to design requirements and other factors. Any modification, equivalent substitution and improvement made within the spirit and principle of the present disclosure shall be included in the protection scope of the present disclosure.
Claims
1. A text fact verification method, comprising: Identify entity names mentioned in the text to be verified; Matching the identified entity name with the entity name recorded in the target knowledge base, and obtaining entity knowledge corresponding to the successfully matched entity name from the knowledge recorded in the target knowledge base; Obtaining search results obtained by performing a knowledge search using the text title of the text to be verified as a search term as the search knowledge of the text to be verified; Taking the entity knowledge and the search knowledge as factual basis, verify whether the text to be verified is consistent with the facts.
2. The method according to claim 1, wherein: The verifying whether the text to be verified is consistent with the facts by using the entity knowledge and the search knowledge as factual basis includes: The text to be verified is processed into blocks to obtain multiple block texts; Taking the entity knowledge and the search knowledge as factual basis, verifying in turn whether each block of text is consistent with the facts; If it is verified that there are block texts that are inconsistent with the facts, it is determined that the text to be verified is inconsistent with the facts.
3. The method according to claim 1, wherein: The verifying whether the text to be verified is consistent with the facts by using the entity knowledge and the search knowledge as factual basis includes: Generate a model prompt instruction including the text to be verified, the entity knowledge and the search knowledge; The model prompt instruction is input into a pre-trained fact verification large language model to obtain a verification result output by the fact verification large language model, wherein the verification result is: the fact verification large language model verifies whether the text to be verified is consistent with the fact based on the entity knowledge and search knowledge.
4. The method according to claim 3, wherein: The generating of a model prompt instruction including the text to be verified, the entity knowledge and the search knowledge comprises: Performing abbreviation processing on the text to be verified; Generate a model prompt instruction including the text to be verified after abbreviation processing, the entity knowledge and the search knowledge.
5. The method according to claim 3, wherein: The model prompt instruction also includes at least one of the following information: first indication information, wherein the first indication information instructs the fact verification large language model to output an erroneous statement that is inconsistent with the fact when verifying that the text to be verified is inconsistent with the fact; Second indication information, wherein the second indication information indicates the error reason why the error statement output by the fact verification large language model does not conform to the facts.
6. The method according to claim 5, wherein: In the case where the model prompt instruction includes the second indication information, the model prompt instruction further includes: a maximum limit on the number of words of the error cause.
7. The method according to any one of claims 1 to 6, wherein: The identifying the entity name mentioned in the text to be verified includes: Sentence processing is performed on the text to be verified to obtain each text sentence; Identify the core clauses in each text clause; The entity names mentioned in the core clause are identified.
8. The method according to claim 1, further comprising: Obtaining target parameters of the entity knowledge and search knowledge, wherein the target parameters represent the authority of the knowledge; According to the obtained target parameters, authoritative knowledge is selected from the entity knowledge and the search knowledge; The verifying whether the text to be verified is consistent with the facts by using the entity knowledge and the search knowledge as factual basis includes: The screened knowledge is used as factual basis to verify whether the text to be verified is consistent with the facts.
9. The method according to claim 8, wherein: The target parameters of knowledge include at least one of the following parameters: Source of knowledge, quality parameters characterizing text quality, and number of times the knowledge has been viewed.
10. The method according to claim 1, further comprising: Deduplication processing is performed on the entity knowledge and the search knowledge; The verifying whether the text to be verified is consistent with the facts by using the entity knowledge and the search knowledge as factual basis includes: The entity knowledge and search knowledge after deduplication processing are used as factual basis to verify whether the text to be verified is consistent with the facts.
11. The method according to any one of claims 1 to 6, wherein: The identifying the entity name mentioned in the text to be verified includes: The text to be verified is input into a pre-trained entity recognition model to obtain the entity name mentioned in the text to be verified which is output by the entity recognition model.
12. The method according to any one of claims 1 to 6, wherein: The target knowledge base includes an encyclopedia knowledge base and / or a search knowledge base that is updated in real time.
13. A text fact verification device, comprising: An entity name recognition module, used to identify entity names mentioned in the text to be verified; An entity knowledge acquisition module is used to match the identified entity name with the entity name recorded in the target knowledge base, and to acquire the entity knowledge corresponding to the successfully matched entity name from the knowledge recorded in the target knowledge base; A search knowledge acquisition module, used to obtain search results obtained by performing knowledge search using the text title of the text to be verified as a search term, as the search knowledge of the text to be verified; The fact verification module is used to verify whether the text to be verified is consistent with the facts based on the entity knowledge and the search knowledge.
14. The device according to claim 13, wherein: The fact verification module is specifically used for: The text to be verified is processed into blocks to obtain multiple block texts; Taking the entity knowledge and the search knowledge as factual basis, verifying in turn whether each block of text is consistent with the facts; If it is verified that there are block texts that are inconsistent with the facts, it is determined that the text to be verified is inconsistent with the facts.
15. The device according to claim 13, wherein: The fact verification module comprises: An instruction generation submodule, used for generating a model prompt instruction including the text to be verified, the entity knowledge and the search knowledge; The model reasoning submodule is used to input the model prompt instruction into a pre-trained fact verification large language model to obtain a verification result output by the fact verification large language model, wherein the verification result is: the fact verification large language model verifies whether the text to be verified is consistent with the facts based on the entity knowledge and search knowledge.
16. The device according to claim 15, wherein: The instruction generation submodule is specifically used for: Performing abbreviation processing on the text to be verified; Generate a model prompt instruction including the text to be verified after abbreviation processing, the entity knowledge and the search knowledge.
17. The device according to claim 15, wherein: The model prompt instruction also includes at least one of the following information: first indication information, wherein the first indication information instructs the fact verification large language model to output an erroneous statement that is inconsistent with the fact when verifying that the text to be verified is inconsistent with the fact; Second indication information, wherein the second indication information indicates the error reason why the error statement output by the fact verification large language model does not conform to the facts.
18. The device according to claim 15, wherein: In the case where the model prompt instruction includes the second indication information, the model prompt instruction further includes: a maximum limit on the number of words of the error cause.
19. The device according to any one of claims 13 to 18, wherein: The entity name recognition module is specifically used for: Sentence processing is performed on the text to be verified to obtain each text sentence; Identify the core clauses in each text clause; The entity names mentioned in the core clause are identified.
20. The apparatus according to claim 13, further comprising: A parameter acquisition module, used to obtain target parameters of the entity knowledge and search knowledge, wherein the target parameters represent the authority of the knowledge; A knowledge screening module, used for screening authoritative knowledge from the entity knowledge and search knowledge according to the obtained target parameters; The fact verification module is specifically used for: The screened knowledge is used as factual basis to verify whether the text to be verified is consistent with the facts.
21. The device according to claim 20, wherein: The target parameters of knowledge include at least one of the following parameters: Source of knowledge, quality parameters characterizing text quality, and number of times the knowledge has been viewed.
22. The apparatus according to claim 13, further comprising: A knowledge deduplication module, used for deduplicating the entity knowledge and search knowledge; The fact verification module is specifically used for: The entity knowledge and search knowledge after deduplication processing are used as factual basis to verify whether the text to be verified is consistent with the facts.
23. The device according to any one of claims 13 to 18, wherein: The entity name recognition module is specifically used for: The text to be verified is input into a pre-trained entity recognition model to obtain the entity name mentioned in the text to be verified which is output by the entity recognition model.
24. The device according to any one of claims 13 to 18, wherein: The target knowledge base includes an encyclopedia knowledge base and / or a search knowledge base that is updated in real time.
25. An electronic device comprising: at least one processor; as well as a memory communicatively connected to the at least one processor; wherein, The memory stores instructions that can be executed by the at least one processor, and the instructions are executed by the at least one processor to enable the at least one processor to perform the method according to any one of claims 1 to 12.
26. A non-transitory computer-readable storage medium storing computer instructions, wherein: The computer instructions are used to cause the computer to execute the method according to any one of claims 1-12.
27. A computer program product comprising a computer program, which, when executed by a processor, implements the method according to any one of claims 1 to 12.
Citation Information
Patent Citations
Text factuality verification method and device, equipment and medium
CN118468846A
Information query method and device and storage medium
CN118535791A
Dynamic data visualization from factual statements in text
US20200175032A1
Fact validation method and system, computer device and storage medium
US20220230050A1
Cited By
system
JP2026155652A