Method, device, and apparatus for verifying veracity of statement, and medium
Implementations of the present disclosure provide a method, a device, and an apparatus for verifying a veracity of a statement, and a medium. In One method, includes: training data including a statement, an evidence set, and a label are acquired. The statement is divided into a plurality of phrases based on a grammatical analysis of the statement. A phrase verification model is trained based on the training data and the plurality of phrases, so that the phrase verification model determines a plurality of phrase veracities of the plurality of phrases respectively based on the evidence set. A statement verification model is trained based on the training data and the plurality of phrases, so that the statement verification model determines a statement veracity of the statement based on the evidence set, where the plurality of phrase veracities provide an interpretation for the statement veracity.
1 . A method, comprising:
acquiring training data comprising a statement, an evidence set, and a label, wherein the statement represents verified content, the evidence set comprises at least one piece of evidence for supporting verification of the veracity of the statement, and the label represents a result of verifying the veracity of the statement based on the evidence set;
dividing the statement into a plurality of phrases based on a grammatical analysis of the statement;
determining a plurality of local premises based on the evidence set, wherein each of the plurality of local premises corresponds to one of the plurality of phrases, and wherein each of the plurality of local premises comprises a modified version of the statement in which the corresponding one of the plurality of phrases has been replaced with an evidence phrase generated based on the evidence set;
training a phrase verification model based on the training data and the plurality of local premises, so that the phrase verification model determines a plurality of phrase veracities of the plurality of phrases respectively based on the evidence set;
training a statement verification model based on the training data and the plurality of local premises, so that the statement verification model determines a statement veracity of the statement based on the evidence set, wherein the plurality of phrase veracities provide an interpretation for the statement veracity; and
applying the trained phrase verification model and the trained statement verification model to determine an overall veracity of an input statement based on an input evidence set, wherein the trained phrase verification model is configured to generate initial veracity values for each phrase of the input statement based on the input evidence set, and wherein the trained statement verification model is configured to determine the overall veracity of the input statement based on the initial veracity values.
2 . The method according to claim 1 , wherein each of the plurality of local premises represents knowledge for verifying a veracity of the corresponding phrase.
3 . The method according to claim 1 , wherein the evidence phrase associated with one of the plurality of phrases represents a knowledge point for determining the veracity of the phrase.
4 . The method according to claim 1 , further comprising determining the evidence phrase associated with one of the plurality of phrases comprises:
generating a probing question associated with the phrase based on the statement; and
retrieving an answer to the probing question from the evidence set to serve as the evidence phrase.
5 . The method according to claim 4 , wherein generating the probing question comprises at least one of:
removing the phrase from the statement to take a cloze sentence associated with the statement as the probing question; and
taking an interrogative sentence for querying the phrase as the probing question based on a position of the phrase in the statement.
6 . The method according to claim 4 , wherein the label comprises any one of: “supported”, “refuted”, and “unverifiable”, and wherein retrieving the answer comprises:
establishing a reading comprehension model, wherein the reading comprehension model enables the answer to be consistent with a real answer to the probing question;
acquiring another piece of training data comprising a statement, an evidence set, and a label; and
in response to a label of the other piece of training data being “supported”, using the other piece of training data to train the reading comprehension model.
7 . The method according to claim 2 , further comprising:
establishing an objective function for jointly training the phrase verification model and the statement verification model, wherein the objective function enables a relationship between the statement veracity and the label to meet a predetermined condition; and
wherein training the phrase verification module and the statement verification module comprises: jointly training the phrase verification model and the statement verification model by using the objective function.
8 . The method according to claim 7 , further comprising:
acquiring a logical rule constraint between the plurality of phrase veracities and the statement veracity; and
updating the objective function based on the logical rule constraint, wherein the objective function enables a relationship between the plurality of phrase veracities and the statement veracity to meet the logical rule constraint.
9 . The method according to claim 8 , wherein establishing the objective function comprises:
determining a plurality of local codes respectively associated with the plurality of phrases based on the statement and a plurality of local premises;
determining a global code of the statement based on the statement and the evidence set; and
determining the objective function by using the label, the plurality of local codes, and the global code as parameters.
10 . The method according to claim 9 , wherein establishing the objective function further comprises:
determining a plurality of pieces of importance of the plurality of phrases respectively based on a comparison between the plurality of local premises and the statement;
determining a context code of the statement based on the plurality of pieces of importance and the plurality of local codes; and
determining the objective function by using the plurality of phrase veracities, the context code and the global code as parameters.
11 . An electronic device, comprising:
at least one processing unit; and
at least one memory, being coupled to the at least one processing unit and storing instructions for execution by the at least one processing unit, wherein the instructions, when executed by the at least one processing unit, cause the device to perform actions comprising:
acquiring training data comprising a statement, an evidence set, and a label, wherein the statement represents verified content, the evidence set comprises at least one piece of evidence for supporting verification of the veracity of the statement, and the label represents a result of verifying the veracity of the statement based on the evidence set;
dividing the statement into a plurality of phrases based on a grammatical analysis of the statement;
determining a plurality of local premises based on the evidence set, wherein each of the plurality of local premises corresponds to one of the plurality of phrases, and wherein each of the plurality of local premises comprises a modified version of the statement in which the corresponding one of the plurality of phrases has been replaced with an evidence phrase generated based on the evidence set;
training a phrase verification model based on the training data and the plurality of local premises, so that the phrase verification model determines a plurality of phrase veracities of the plurality of phrases respectively based on the evidence set;
training a statement verification model based on the training data and the plurality of local premises, so that the statement verification model determines a statement veracity of the statement based on the evidence set, wherein the plurality of phrase veracities provide an interpretation for the statement veracity; and
applying the trained phrase verification model and the trained statement verification model to determine an overall veracity of an input statement based on an input evidence set, wherein the trained phrase verification model is configured to generate initial veracity values for each phrase of the input statement based on the input evidence set, and wherein the trained statement verification model is configured to determine the overall veracity of the input statement based on the initial veracity values.
12 . The device according to claim 11 , wherein each of the plurality of local premises represents knowledge for verifying a veracity of the corresponding phrase.
13 . The device according to claim 11 , wherein the evidence phrase associated with one of the plurality of phrases represents a knowledge point for determining the veracity of the phrase.
14 . The device according to claim 13 , wherein the instructions, when executed by the at least one processing unit, further cause the device to perform actions comprising:
generating a probing question associated with the phrase based on the statement; and
retrieving an answer to the probing question from the evidence set to serve as the evidence phrase.
15 . The device according to claim 14 , wherein generating the probing question comprises at least one of:
removing the phrase from the statement to take a cloze sentence associated with the statement as the probing question; and
taking an interrogative sentence for querying the phrase as the probing question based on a position of the phrase in the statement.
16 . The device according to claim 14 , wherein the label comprises any one of:
“supported”, “refuted”, and “unverifiable”, and wherein retrieving the answer comprises:
establishing a reading comprehension model, wherein the reading comprehension model enables the answer to be consistent with a real answer to the probing question;
acquiring another piece of training data comprising a statement, an evidence set, and a label; and
in response to a label of the other piece of training data being “supported”, using the other piece of training data to train the reading comprehension model.
17 . The device according to claim 12 , further comprising:
establishing an objective function for jointly training the phrase verification model and the statement verification model, wherein the objective function enables a relationship between the statement veracity and the label to meet a predetermined condition; and
wherein training the phrase verification module and the statement verification module comprises: jointly training the phrase verification model and the statement verification model by using the objective function.
18 . The device according to claim 17 , further comprising:
acquiring a logical rule constraint between the plurality of phrase veracities and the statement veracity; and
updating the objective function based on the logical rule constraint, wherein the objective function enables a relationship between the plurality of phrase veracities and the statement veracity to meet the logical rule constraint.
19 . The device according to claim 18 , wherein establishing the objective function comprises:
determining a plurality of local codes respectively associated with the plurality of phrases based on the statement and a plurality of local premises;
determining a global code of the statement based on the statement and the evidence set; and
determining the objective function by using the label, the plurality of local codes, and the global code as parameters.
20 . A non-transitory computer-readable storage medium, having a computer program stored thereon, wherein the program, when executed by a processor, implements operations comprising:
acquiring training data comprising a statement, an evidence set, and a label, wherein the statement represents verified content, the evidence set comprises at least one piece of evidence for supporting verification of the veracity of the statement, and the label represents a result of verifying the veracity of the statement based on the evidence set;
dividing the statement into a plurality of phrases based on a grammatical analysis of the statement;
determining a plurality of local premises based on the evidence set, wherein each of the plurality of local premises corresponds to one of the plurality of phrases, and wherein each of the plurality of local premises comprises a modified version of the statement in which the corresponding one of the plurality of phrases has been replaced with an evidence phrase generated based on the evidence set;
training a phrase verification model based on the training data and the plurality of local premises, so that the phrase verification model determines a plurality of phrase veracities of the plurality of phrases respectively based on the evidence set;
training a statement verification model based on the training data and the plurality of local premises, so that the statement verification model determines a statement veracity of the statement based on the evidence set, wherein the plurality of phrase veracities provide an interpretation for the statement veracity; and
applying the trained phrase verification model and the trained statement verification model to determine an overall veracity of an input statement based on an input evidence set, wherein the trained phrase verification model is configured to generate initial veracity values for each phrase of the input statement based on the input evidence set, and wherein the trained statement verification model is configured to determine the overall veracity of the input statement based on the initial veracity values.