Mining Method, Device, Electronic Device and Storage Medium for Argumentative Texts
By using the first and second mining networks to generate semantic vectors and hidden vectors during the debate text mining process, and using the proxy probability distribution to correct the initial results, the problem of large errors in the prior art is solved, and high-accurate debate text mining is achieved.
Patent Information
- Application Number
- CN202211545137.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-11-29
- Publication Date
- 2025-08-05
- Estimated Expiration
- 2042-11-29
AI Technical Summary
The prior art is prone to errors in the mining of debate texts, resulting in low accuracy of the mining results.
By obtaining the debate text to be mined, the first mining network generates semantic vectors and semantic hidden vectors, and inputs them into the second mining network, the initial mining result is corrected using the proxy probability distribution to obtain the final mining result.
The accuracy of the debate text mining results is improved, and the accuracy of type identification of debate components and debate relationships is ensured.
Smart Images

Figure CN115994219B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of argumentative text mining, and in particular to a method, device, electronic device, and storage medium for mining argumentative text. Background Art
[0002] With the explosive growth of data volume, people have an increasing demand to quickly obtain the key content of texts, especially argument mining, which is receiving more and more attention.
[0003] During the research and practice of related technologies, the inventors of the present application discovered that errors are easily generated when conducting argument mining, resulting in relatively low accuracy of argument mining results. Summary of the Invention
[0004] The present application provides a method, device, electronic device and storage medium for mining argumentative texts, which can make the mining results finally obtained from the argumentative texts to be mined more accurate.
[0005] In order to solve the above technical problems, the first aspect of the present application is to provide a method for mining argumentative texts, including: obtaining the argumentative text to be mined; inputting the argumentative text to be mined into a first mining network to obtain the semantic vector and semantic latent vector output by the first mining network; inputting the semantic vector and semantic latent vector into a second mining network to obtain the initial mining result corresponding to the argumentative text to be mined output by the second mining network; using the proxy probability distribution to correct the initial mining result to obtain the final mining result, wherein the final mining result represents the argumentative components and the types of argumentative components and / or argumentative relationships and the types of argumentative relationships in the argumentative text to be mined, and the proxy probability distribution is determined based on the predicted label corresponding to the semantic latent vector.
[0006] Among them, the first mining network includes an encoding module and a decoding module. The debate text to be mined is input into the first mining network to obtain the semantic vector and semantic latent vector output by the first mining network, including: determining the character position encoding and word segmentation vector representation of the debate text to be mined; inputting the character position encoding and word segmentation vector representation into the encoding module to obtain the semantic vector of the debate text to be mined; obtaining the reconstructed character position encoding of the debate text to be mined; inputting the reconstructed character position encoding and semantic vector into the decoding module to obtain the semantic latent vector.
[0007] The step of obtaining the reconstructed character position code of the debate text to be mined includes: reconstructing the character position code of the semantic vector according to the attributes corresponding to the semantic vector of the input coding module to obtain the reconstructed character position code.
[0008] The initial mining results include invalid indexes and valid indexes; the initial mining results are corrected using the proxy probability distribution to obtain the final mining results, including: correcting the probability distribution of invalid indexes in the initial mining results using the proxy probability distribution to obtain the final mining results.
[0009] The method comprises the following steps: inputting the semantic vector and the semantic latent vector into the second mining network to obtain the initial mining result corresponding to the debate text to be mined output by the second mining network, including: determining the average semantic vector of the semantic latent vector using the semantic vector; determining the first vocabulary matrix based on the average semantic vector; inputting the semantic latent vector and the first vocabulary matrix into the second mining network to obtain the first probability distribution output by the second mining network; determining the second vocabulary matrix based on the semantic vector; inputting the semantic latent vector and the second vocabulary matrix into the second mining network to obtain the second probability distribution output by the second mining network; and obtaining the initial mining result according to the first probability distribution and the second probability distribution.
[0010] Among them, after the semantic latent vector and the first vocabulary matrix are input into the second mining network and the first probability distribution output by the second mining network is obtained, the method includes: using the first probability distribution to determine a first loss value; after the semantic latent vector and the second vocabulary matrix are input into the second mining network and the second probability distribution output by the second mining network is obtained, the method includes: using the second probability distribution to determine a second loss value; and using the first loss value and the second loss value to adjust the network parameters of the second mining network.
[0011] The method of determining the second loss value by using the second probability distribution includes determining the second loss value based on the second probability distribution and the proxy probability distribution.
[0012] In order to solve the above technical problems, the second aspect of the present application is to provide a device for mining argumentative texts, which includes: an acquisition module, a first input module, a second input module, and a correction module. The acquisition module is used to acquire the argumentative text to be mined; the first input module is used to input the argumentative text to be mined into the first mining network to obtain the semantic vector and semantic latent vector output by the first mining network; the second input module is used to input the semantic vector and semantic latent vector into the second mining network to obtain the initial mining result corresponding to the argumentative text to be mined output by the second mining network; the correction module is used to correct the initial mining result using the proxy probability distribution to obtain the final mining result, wherein the final mining result represents the argumentative components and the types of argumentative components and / or argumentative relations and the types of argumentative relations in the argumentative text to be mined, and the proxy probability distribution is determined based on the predicted label of the semantic latent vector.
[0013] To solve the above technical problems, the third aspect of the present application is to provide an electronic device, which includes a memory and a processor, the memory is used to store program data, and the processor is used to execute the program data to implement the method provided by the above technical solution.
[0014] In order to solve the above technical problems, the fourth aspect of the present application is to provide a computer-readable storage medium, which is used to store a computer program. When the computer program is executed by a processor, it is used to implement the method provided by the above technical solution.
[0015] The beneficial effect of the present application is that, unlike the prior art, the present application uses a proxy probability distribution determined based on the predicted label corresponding to the semantic latent vector to correct the initial mining results of the debate text to be mined, so that the final mining results are more accurate. BRIEF DESCRIPTION OF THE DRAWINGS
[0016] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the following briefly introduces the drawings required for describing the embodiments. Obviously, the drawings described below are only some embodiments of the present application. For those skilled in the art, other drawings can be obtained based on these drawings without inventive efforts. Among them:
[0017] Figure 1 This is a flow chart of the first embodiment of the method for mining argumentative texts provided by this application;
[0018] Figure 2 This is a flow chart of a second embodiment of the method for mining argumentative texts provided by this application;
[0019] Figure 3 This is a flow chart of a third embodiment of the method for mining argumentative texts provided by this application;
[0020] Figure 4 This is a flowchart of a fourth embodiment of the method for mining argumentative texts provided by this application;
[0021] Figure 5 This is a flowchart of a fifth embodiment of the method for mining argumentative texts provided by this application;
[0022] Figure 6 This is a flow chart of a sixth embodiment of the method for mining argumentative texts provided by this application;
[0023] Figure 7 This is a training diagram of an embodiment of a first mining network provided by the present application;
[0024] Figure 8 This is a training diagram of an embodiment of a second mining network provided by the present application;
[0025] Figure 9 This is a schematic structural diagram of an embodiment of a device for mining argumentative texts provided by this application;
[0026] Figure 10 This is a structural diagram of an embodiment of an electronic device provided by the present application;
[0027] Figure 11 It is a structural diagram of an embodiment of a computer-readable storage medium provided by this application. DETAILED DESCRIPTION
[0028] The technical solutions in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. It will be understood that the specific embodiments described herein are only used to explain the present application, rather than to limit the present application. It should also be noted that, for ease of description, only some, rather than all, structures related to the present application are shown in the drawings. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without making creative work are within the scope of protection of this application.
[0029] References herein to "embodiments" mean that a particular feature, structure, or characteristic described in connection with the embodiments may be included in at least one embodiment of the present application. The appearance of this phrase in various places in the specification does not necessarily refer to the same embodiment, nor does it constitute an independent or alternative embodiment that is mutually exclusive of other embodiments. It is understood, both explicitly and implicitly, by those skilled in the art that the embodiments described herein may be combined with other embodiments.
[0030] In related technologies, a second mining network is used to predict the semantic vectors and semantic latent vectors output by the first mining network to obtain the mining results corresponding to the debate text. The inventors of this application have found that the second mining network is prone to prediction errors during prediction. Based on this, this application proposes to use a proxy probability distribution determined based on the predicted labels corresponding to the semantic latent vectors to correct the initial mining results of the debate text to be mined, in order to solve the above problem. Figure 1 , Figure 1 It is a flowchart of the first embodiment of the method for mining argumentative texts provided by this application.
[0031] The method includes:
[0032] Step 110: Obtain the debate text to be mined.
[0033] The argumentative text to be mined can be in Chinese or English and can contain multiple argument components. Each argument component consists of an assertion and one or more premises, where an assertion is a controversial statement and a premise is a reason for or against the assertion. Directed argumentative relationships may exist between multiple argument components, indicating that one argument component supports or opposes another.
[0034] For example, the argumentative text to be mined may include: Component 1: However, although advertising may be false and exaggerated. Component 2: It also does play an important role in the economy. Component 3: It introduces new products and provides a variety of choices, not to mention that they are often visually pleasing. Component 4: Advertising also helps keep prices at reasonable levels, creating a fair environment for business competition.
[0035] Among them, the types of component one, component two, component three, and component four, as well as the argumentative relationships between the components, need to be further identified and confirmed by the mining model.
[0036] Step 120: Input the debate text to be mined into the first mining network to obtain the semantic vector and semantic latent vector output by the first mining network.
[0037] For example, input the debate text to be mined into the first mining network and obtain the semantic vector output by the first mining network. and semantic latent vector H t .
[0038] In some embodiments, the semantic latent vector H t It can be obtained by the following formula:
[0039]
[0040] Among them, h t Represents the hidden vector generated in step t
[0041] Step 130: Input the semantic vector and the semantic latent vector into the second mining network to obtain an initial mining result corresponding to the debate text to be mined output by the second mining network.
[0042] The second mining network may be a common pointer network or a restricted pointer network. The embodiment of the present application is described by taking the restricted pointer network as an example.
[0043] The initial mining result may be a probability distribution corresponding to the semantic latent vector output by the second mining network.
[0044] The first mining network may be a neural network in an autoregressive model, and the second mining network may be a restricted pointer network in an autoregressive model.
[0045] Step 140: Use the proxy probability distribution to modify the initial mining results to obtain the final mining results.
[0046] The final mining result represents the argument components and the types of argument components and / or argument relationships and the types of argument relationships in the argument text to be mined.
[0047] The types of argument components include premise, assertion, and main assertion, where the main assertion is the core argument and the assertion is the sub-argument. The types of argument relationships include support and opposition.
[0048] For example, the argument text to be mined listed in step 110 is "Component 1: However, advertising can be false and exaggerated. Component 2: Advertising does play an important role in the economy. Component 3: Advertising introduces new products and offers a variety of choices, not to mention that they are often visually pleasing. Component 4: Advertising also helps keep prices at reasonable levels, creating a fair environment for business competition." After mining by the first mining network and the second mining network, the mining results that can be obtained are: Component 1 is a premise, Component 2 is an assertion, Component 3 is a premise, and Component 4 is also a premise.
[0049] The argumentative relationship between the various components can be: component one opposes component two, component three supports component two, and component four supports component two.
[0050] Among them, the proxy probability distribution is a binary probability distribution including valid and invalid, which can be determined based on the predicted label corresponding to the semantic latent vector.
[0051] For example, suppose the argument text to be mined is “I believe cloning is beneficial. For example, cloned organs can help patients.” After inputting into the first mining network, the output semantic latent vector H e The corresponding predicted label TS can be [3, 5, Claim, 10, 14, Premise, Support], as shown below:
[0052]
[0053] Based on the predicted label and the generation rule, the proxy probability distribution Q t The following diagram can be shown:
[0054]
[0055] Among them, Q t 0 in the code indicates that the position is invalid, 1 indicates that the position is valid, t is the number of steps, I x ∈[1, n x ], I c ∈[n x +1,n x +n c ], I r ∈[n x +n c +1,n x +n c +n r ] represent the index positions of the input debate text to be mined, debate component labels and debate relationship labels, respectively, n x ,n c ,n r They respectively represent the number of words in the argument text to be mined, the number of types of argument components, and the number of types of argument relations.
[0056] The generation rules may include the following:
[0057] (1) The end position obtained by decoding must be greater than the start position;
[0058] For example, at step t=5, we need to decode the end position of the first argument component segment. According to the label of step t=4, it is 10, so I x Positions ≤10 are invalid.
[0059] (2) A pair of decoded argument component segments cannot overlap with each other;
[0060] For example, at step t=4, we need to decode the starting position of the first argument component segment. According to the "3 to 5 is the first argument component segment" obtained at step t=1 and step t=2, I x =3 or 4 or 5 positions should be invalid.
[0061] (3) The valid index must be consistent with the type in the predicted label. For example, when predicting step t=3, the index of the argument component label is I c It is effective, and the debate texts to be mined I x and debate relationship label I r The index position is invalid.
[0062] In some embodiments, the proxy probability distribution may be used to correct the probability distribution of invalid indexes in the initial mining results to obtain the final mining results.
[0063] For example, suppose the initial mining result is the probability distribution P t , the following formula can be used to calculate Pt Make corrections:
[0064]
[0065] in, is a restricted probability distribution and can also be used as the final mining result. ⊙ is the Hadamard product operation.
[0066] Specifically, it is assumed that the initial mining result is the probability distribution P t As shown below:
[0067]
[0068] It should be noted that Q t The probability distribution and P t There is a one-to-one correspondence, Q t Represents P t In each step, the corresponding word in the vocabulary is valid or invalid. For example, from Q t It can be seen that the sixth and seventh steps, i.e., Q6 and Q7, are x If both are 0, it means the sixth and seventh steps. x are invalid, and the probability distribution P obtained by model prediction t Step 6, P6 I x There is a position of 0.5, then according to Q6 I x are all 0, and I of P6 x The number 0.5 in Q4 can be corrected to 0. x The fourth position is 0, and the I in P4 x The fourth position number 0.7 is corrected to 0, then the proxy probability distribution Q t For the initial mining result P t After the correction, the final mining results can be as follows:
[0069]
[0070] The above list is just the proxy probability distribution Q t For the initial mining result P t One embodiment of the modification, such as by proxying the probability distribution Q t You can also perform the initial mining results P t The invalid positions in the uniform correction are made, and the proxy probability distribution Q t The specific process of correcting the probability distribution of invalid indexes in the initial mining results needs to be determined according to the probability distribution obtained by actual prediction, and this application does not limit it here.
[0071] This embodiment inputs the debate text to be mined into the first mining network and the second mining network for mining processing, thereby simultaneously completing the four subtasks of debate mining, namely, mining the debate components in the debate text and the types of the debate components and / or debate relationships and the types of debate relationships; and by using the proxy probability distribution to correct the initial mining results, the accuracy of the final mining results is relatively high.
[0072] In some embodiments, the first mining network includes an encoding module and a decoding module, see Figure 2 , Figure 2 1 is a flow chart of a second embodiment of the method for mining argumentative texts provided by this application. The method includes:
[0073] Step 210: Obtain the debate text to be mined.
[0074] Among them, step 210 can refer to the detailed description of step 110 in the first embodiment above, and will not be repeated here.
[0075] Step 220: Determine the character position encoding and word segmentation vector representation of the debate text to be mined.
[0076] For example, use the English word segmentation tool to segment the debate text S to be mined, and obtain the word segmentation representation of the debate text S to be mined The participle represents Perform position encoding, and the character position encoding obtained is [1, 2, 3, 4, 5...n x ], where n x Represents the position of the nth word, that is, the last word, in the debate text to be mined.
[0077] The participle represents The word segmentation vector representation is obtained through the Emb(X) mapping function
[0078] Step 230: Input the character position encoding and word segmentation vector representation into the encoding module to obtain the semantic vector of the debate text to be mined.
[0079] For example, the word vector is represented as Input encoding module, encoding module through the mapping function Enc (E) and then the word vector representation Further converted into a semantic vector H e .
[0080] Right now
[0081] Among them, n x is the character length of the input debate text to be mined, d h is the dimension of the semantic vector.
[0082] It should be noted that, in general, the Enc function is implemented using a multi-layer stacked neural network.
[0083] Step 240: Obtain the reconstructed character position codes of the debate text to be mined.
[0084] In some embodiments, the character position encoding may be reconstructed based on the corresponding attributes of each character in the debate text to be mined.
[0085] Alternatively, the character position encoding can be reconstructed based on the acquired part of the debate text to be mined.
[0086] For example, the argument text to be mined is “I believe cloning is beneficial. For example, cloned organs can help patients.”, and the character position encoding is [1, 2, 3, 4, 5…n x ], after the encoding module, the output can be "cloning beneficial <claim>cloned patients <premise> <support>”. The "cloning beneficial" <claim>cloned patients <premise> <support>” is reconstructed by position encoding, and the reconstructed character position encoding is [1, 1, 2, 1, 1, 2, 3].
[0087] Step 250: Input the reconstructed character position code and semantic vector into the decoding module to obtain a semantic latent vector.
[0088] For example, the reconstructed character position is encoded as [1, 1, 2, 1, 1, 2, 3] and the semantic vector Input the decoding module and get the semantic latent vector H t .
[0089] Likewise, in some embodiments, the semantic latent vector H t It can be obtained by the following formula:
[0090]
[0091] Among them, h t Represents the hidden vector generated in step t
[0092] Step 260: Input the semantic vector and the semantic latent vector into the second mining network to obtain the initial mining result corresponding to the debate text to be mined output by the second mining network.
[0093] For example, the semantic vector and semantic latent vector H t Input into the restricted pointer network, the initial mining result can be the probability distribution corresponding to the semantic latent vector.
[0094] Step 270: Use the proxy probability distribution to modify the initial mining results to obtain the final mining results.
[0095] Among them, the final mining results represent the argument components and the types of argument components and / or argument relationships and the types of argument relationships in the argument text to be mined, and the proxy probability distribution is determined based on the predicted labels corresponding to the semantic latent vectors.
[0096] Among them, step 270 can refer to the detailed description of step 140 in the first embodiment above, and will not be repeated here.
[0097] This embodiment modifies the initial mining results of the debate text to be mined by using the proxy probability distribution determined based on the predicted labels corresponding to the semantic latent vectors, so that the final mining results are more accurate.
[0098] In addition, since the original character position encoding of the debate text to be mined is encoded according to the position order of each input character, that is, there is a relative sequential dependency between character sequences. However, in some cases, such sequential dependency will cause errors in the model and thus affect the performance of the model.
[0099] This embodiment reconstructs the character position codes of the debate text to be mined and inputs the reconstructed character position codes into the model for prediction, thereby effectively reducing the sequence errors generated in the model prediction.
[0100] See Figure 3 , Figure 3 1 is a flow chart of a third embodiment of the method for mining argumentative texts provided by this application. The method includes:
[0101] Step 310: Obtain the debate text to be mined.
[0102] Step 320: Determine the character position encoding and word segmentation vector representation of the debate text to be mined.
[0103] Step 330: Input the character position encoding and word segmentation vector representation into the encoding module to obtain the semantic vector of the debate text to be mined.
[0104] Step 340: reconstruct the character position code of the semantic vector according to the attribute corresponding to the semantic vector input to the coding module to obtain a reconstructed character position code.
[0105] The attributes corresponding to the semantic vector may include position attributes and category attributes, and the category attributes include category attributes of argument components and category attributes of argument relations.
[0106] For example, the argument text to be mined is "I believe cloning is beneficial. For example, cloned organs can help patients.", and the character position encoding is [1, 2, 3, 4, 5...n x ], after the encoding module, the output can be "cloning beneficial <claim>cloned patients <premise> <support>". 将 "cloning beneficial <claim>cloned patients <premise> <support>” is reconstructed by position encoding, and the reconstructed character position encoding is [1, 1, 2, 1, 1, 2, 3].
[0107] Among them, "cloning beneficial" represents the position characters of the start and end of the assertion, forming the assertion fragment <claim>, which belongs to the category attribute in the argument component, and "cloned patients" represents the position characters of the beginning and end of the premise, forming the premise fragment <premise>, which belongs to the category attribute in the debate component.
[0108] Step 350: Input the reconstructed character position code and semantic vector into the decoding module to obtain a semantic latent vector.
[0109] Step 360: Input the semantic vector and the semantic latent vector into the second mining network to obtain the initial mining result corresponding to the debate text to be mined output by the second mining network.
[0110] Step 370: Use the proxy probability distribution to modify the initial mining results to obtain the final mining results.
[0111] Among them, the final mining results represent the argument components and the types of argument components and / or argument relationships and the types of argument relationships in the argument text to be mined, and the proxy probability distribution is determined based on the predicted labels corresponding to the semantic latent vectors.
[0112] Among them, step 310, step 320, step 330, step 350, step 360 and step 370 can refer to the specific description of the above embodiment and are not repeated here.
[0113] This embodiment modifies the initial mining results of the debate text to be mined by using the proxy probability distribution determined based on the predicted labels corresponding to the semantic latent vectors, so that the final mining results are more accurate.
[0114] In addition, since the original character position encoding of the debate text to be mined is encoded according to the position order of each input character, that is, there is a relative sequential dependency between character sequences. However, in some cases, such sequential dependency will cause errors in the model and thus affect the performance of the model.
[0115] This embodiment, by reconstructing the character position codes of the debate text to be mined and inputting the reconstructed character position codes into the model for prediction, can effectively reduce the sequence errors generated in the model prediction. Furthermore, the reconstructed character position codes are reconstructed according to the position attributes and category attributes (such as debate components and their types and / or debate relations and their types) corresponding to the semantic vector of the input coding module. This can better fit the four subtasks to be mined in the debate text to be mined, allowing the model to generate a more structured sequence.
[0116] In some embodiments, the initial mining results include invalid indexes and valid indexes. Figure 4 , Figure 4 1 is a flow chart of a fourth embodiment of the method for mining argumentative texts provided by this application. The method includes:
[0117] Step 410: Obtain the debate text to be mined.
[0118] Step 420: Input the debate text to be mined into the first mining network to obtain the semantic vector and semantic latent vector output by the first mining network.
[0119] Step 430: Input the semantic vector and the semantic latent vector into the second mining network to obtain the initial mining result corresponding to the debate text to be mined output by the second mining network.
[0120] Step 440: Using the proxy probability distribution, the probability distribution of the invalid indexes in the initial mining result is corrected to obtain the final mining result.
[0121] Among them, the final mining results represent the argument components and the types of argument components and / or argument relationships and the types of argument relationships in the argument text to be mined, and the proxy probability distribution is determined based on the predicted labels corresponding to the semantic latent vectors.
[0122] Please refer to the detailed description of the above embodiments and will not be repeated here.
[0123] This embodiment modifies the initial mining results of the debate text to be mined by using the proxy probability distribution determined based on the predicted labels corresponding to the semantic latent vectors, so that the final mining results are more accurate.
[0124] See Figure 5 , Figure 5 1 is a flow chart of a fifth embodiment of the method for mining argumentative texts provided by this application. The method includes:
[0125] Step 510: Obtain the debate text to be mined.
[0126] Step 520: Input the debate text to be mined into the first mining network to obtain the semantic vector and semantic latent vector output by the first mining network.
[0127] Step 530: Determine the average semantic vector of the semantic latent vector using the semantic vector.
[0128] For example, the following formula can be used to determine the average semantic vector of the semantic latent vector
[0129]
[0130] Among them, α is the weighting parameter.
[0131] Step 540: Determine a first vocabulary matrix based on the average semantic vector.
[0132] For example, the first vocabulary matrix H p It can be: Among them, Lc is the vector of each component in all debate component labels, and Lr is the vector of each relationship in all debate relationship labels. n x ,n c ,n r They represent the number of words contained in the debate text to be mined, the number of types of debate components, and the number of types of debate relations, respectively. d is the dimension of each vector in the vocabulary.
[0133] Specifically, assuming that the input argument text S to be mined is "I believe cloning is beneficial. For example, cloned organs can help patients." After word segmentation, the obtained word segmentation representation is Contains n words. For the debate text S to be mined, n x is 15, then the vocabulary corresponding to X is [x1, x2, ..., x 15 ], where x i It is a 1*d-dimensional vector, assuming d=4, such as x1=[0.2, 0.23, 0.12, 0.34].
[0134] Assume that all argument component labels included in Lc are main assertion c1, assertion c2 and premise c3; all argument relationship labels included in Lr are support r1 and refutation r2. Then the corresponding vocabularies of Lc and Lr are [c1, c2, c3] and [r1, r2] respectively. Similarly, c i and r i They are all 1*d-dimensional vectors, such as c1=[0.01, 0.2, 0.64, 0.45].
[0135] Then concatenate the vocabulary corresponding to X, the vocabulary corresponding to Lc, and the vocabulary corresponding to Lr to obtain the first vocabulary matrix H p For [x1, x2, x3, x4, …, x 15 , c1, c2, c3, r1, r2], the first vocabulary matrix H p It is a 20*d (d=4) dimensional matrix, and each column vector corresponds to a word.
[0136] Step 550: Input the semantic latent vector and the first vocabulary matrix into the second mining network to obtain a first probability distribution output by the second mining network.
[0137] For example, the semantic latent vector H t and the first vocabulary matrix H p Input into the restricted pointer network, the first probability distribution P can be obtained according to the following formula:
[0138]
[0139] Specifically, assuming that the semantic latent vector H t =[0.98, 0.34, 0.1, 0.75], and the first vocabulary matrix H p Perform matrix multiplication to obtain P in the first probability distribution P t =[0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0.9, 0.1]. Since 0.9 corresponds to the position of r1, it is predicted that the argumentation relationship type between the argumentation components in the argumentation text to be mined is support.
[0140] Step 560: Determine a second vocabulary matrix based on the semantic vector.
[0141] For example, the second vocabulary matrix It can be:
[0142] Step 570: Input the semantic latent vector and the second vocabulary matrix into the second mining network to obtain a second probability distribution output by the second mining network.
[0143] For example, the semantic latent vector H t and the second vocabulary matrix Input to the restricted pointer network, the second probability distribution P can be obtained according to the following formula a :
[0144]
[0145] Among them, for the second vocabulary matrix Acquisition of semantic latent vector H t and the second vocabulary matrix The matrix multiplication calculation between them can refer to the above description of the first vocabulary matrix, which will not be repeated in this application.
[0146] Step 580: Obtain initial mining results according to the first probability distribution and the second probability distribution.
[0147] For example, the first probability distribution P obtained is as follows:
[0148]
[0149] By introducing the second probability distribution Pa as an auxiliary task to give the model a supervision signal, the first probability distribution P is transformed from the above diagram to the following diagram:
[0150]
[0151] By comparing these two diagrams, it can be concluded that the fourth position in P4 changes from 0.8 to 0.7, and the tenth position changes from 0.7 to 0.9. Since the fourth position is an invalid position and the tenth position is a valid position, by introducing the second probability distribution Pa as an auxiliary task to give the model a supervision signal, the probability of invalid positions in the model prediction results can be reduced and the probability of valid positions can be increased.
[0152] Although introducing the second probability distribution Pa as an auxiliary task to provide the model with a supervisory signal can reduce the probability of invalid positions in the model's prediction results and increase the probability of valid positions, due to the relatively complex probability distribution predicted by the model, some errors may still exist in the prediction process. Therefore, it is still necessary to use the probability distribution obtained after supervision and guidance by the second probability distribution Pa as the initial mining result. By using the proxy probability distribution to correct the initial mining result, the final mining result is obtained.
[0153] For example, the following schematic diagram obtained in the above steps can be used as the initial mining result:
[0154]
[0155] The initial mining results are further modified according to the proxy probability distribution, as in step 590 .
[0156] Step 590: Use the proxy probability distribution to modify the initial mining results to obtain the final mining results.
[0157] As for how to use the proxy probability distribution to correct the initial mining results to obtain the final mining results, reference can be made to the detailed description of the first embodiment, and this application will not elaborate on it here.
[0158] Among them, the final mining results represent the argument components and the types of argument components and / or argument relationships and the types of argument relationships in the argument text to be mined, and the proxy probability distribution is determined based on the predicted labels corresponding to the semantic latent vectors.
[0159] This embodiment modifies the initial mining results of the debate text to be mined by using the proxy probability distribution determined based on the predicted labels corresponding to the semantic latent vectors, so that the final mining results are more accurate.
[0160] In addition, the actual probability distribution obtained is relatively complex, and there may be extreme cases. For example, the model may not know which positions are valid or invalid. The model will obtain probability distributions for all positions, and even high probabilities may only appear in invalid positions, while the probability distribution for valid positions is uniform or random. If the proxy probability distribution is only used to correct the initial mining results in the inference phase, the probability distribution for valid positions will actually be inaccurate. Therefore, the introduction of the second probability distribution Pa as an auxiliary task to provide the model with a supervisory signal can theoretically limit the range of the model's probability distribution, making the model's distribution for valid positions more reasonable.
[0161] In other words, introducing the second probability distribution Pa as an auxiliary task to give the model a supervision signal can reduce the probability of invalid positions in the model prediction results and increase the probability of valid positions, thereby making the distribution of the model at valid positions more reasonable.
[0162] See Figure 6 , Figure 6 1 is a flow chart of a sixth embodiment of the method for mining argumentative texts provided by this application. The method includes:
[0163] Step 610: Obtain the debate text to be mined.
[0164] The acquired argument text S to be mined includes multiple pairs of argumentative sentences, each of which includes a source sentence and a target sentence. For example, if one of the argumentative sentences in the argument text S is "I believe cloning is beneficial. For example, cloned organs can help patients.", then the argumentative sentence includes the source sentence "I believe cloning is beneficial." and the target sentence "For example, cloned organs can help patients." The source sentence includes the source component, and the target sentence includes the target component.
[0165] The acquired debate text S to be mined is used as training corpus, and the corresponding labels of each component in the debate text to be mined and the debate relationship between the components are given, such as label Y = [T1, T2, ..., T i ]. Where the tuple It is represented as the i-th source-target argument relationship, and Indicates the start / end position of the source and target components respectively, and Represents the category of the debate component, r i It is the argumentative relationship of the source component to the target component.
[0166] Step 620: Input the debate text to be mined into the first mining network to obtain the semantic vector and semantic latent vector output by the first mining network.
[0167] For example, input the debate text S to be mined into the first mining network, and obtain the semantic vector output by the first mining network and semantic latent vector H t .
[0168] In some embodiments, the semantic latent vector H t It can be obtained by the following formula:
[0169]
[0170] in, To reconstruct the character position encoding, Y is the classification label, the position of Y will be mapped to the corresponding character vector representation at that position. represents the reconstructed position encoding of the i-th source-target argument relationship, such as h t Represents the hidden vector generated in step t
[0171] Step 630: Determine the average semantic vector of the semantic latent vector using the semantic vector.
[0172] For example, the following formula can be used to determine the average semantic vector of the semantic latent vector
[0173]
[0174] Among them, α is the weighting parameter.
[0175] Step 640: Determine a first vocabulary matrix based on the average semantic vector.
[0176] For example, the first vocabulary matrix H p It can be: Among them, Lc is the vector of each component in all debate component labels, and Lr is the vector of each relationship in all debate relationship labels. n x ,n c ,n r They represent the number of words contained in the debate text to be mined, the number of types of debate components, and the number of types of debate relations, respectively. d is the dimension of each vector in the vocabulary.
[0177] Specifically, assuming that the input argument text S to be mined is "I believe cloning is beneficial. For example, cloned organs can help patients." After word segmentation, the obtained word segmentation representation is Contains n words. For the debate text S to be mined, n x is 15, then the vocabulary corresponding to X is [x1, x2, ..., x 15 ], where x i It is a 1*d-dimensional vector, assuming d=4, such as x1=[0.2, 0.23, 0.12, 0.34].
[0178] Assume that all argument component labels included in Lc are main assertion c1, assertion c2 and premise c3; all argument relationship labels included in Lr are support r1 and refutation r2. Then the corresponding vocabularies of Lc and Lr are [c1, c2, c3] and [r1, r2] respectively. Similarly, c i and r i They are all 1*d-dimensional vectors, such as c1=[0.01, 0.2, 0.64, 0.45].
[0179] Then concatenate the vocabulary corresponding to X, the vocabulary corresponding to Lc, and the vocabulary corresponding to Lr to obtain the first vocabulary matrix H p For [x1, x2, x3, x4, …, x 15 , c1, c2, c3, r1, r2], the first vocabulary matrix H p It is a 20*d (d=4) dimensional matrix, and each column vector corresponds to a word.
[0180] Step 650: Input the semantic latent vector and the first vocabulary matrix into the second mining network to obtain a first probability distribution output by the second mining network.
[0181] For example, the semantic latent vector H t and the first vocabulary matrix H p Input into the restricted pointer network, the first probability distribution P can be obtained according to the following formula:
[0182]
[0183] Step 660: Determine a first loss value using the first probability distribution.
[0184] In some embodiments, the first loss value It can be obtained by the following formula:
[0185]
[0186] Where |Y| represents the label length.
[0187] Step 670: Determine a second vocabulary matrix based on the semantic vector.
[0188] For example, the second vocabulary matrix It can be:
[0189] Step 680: Input the semantic latent vector and the second vocabulary matrix into the second mining network to obtain a second probability distribution output by the second mining network.
[0190] For example, the semantic latent vector H t and the second vocabulary matrix Input to the restricted pointer network, the second probability distribution P can be obtained according to the following formula a :
[0191]
[0192] Among them, for the second vocabulary matrix Acquisition of semantic latent vector H t and the second vocabulary matrix The matrix multiplication calculation between them can refer to the above description of the first vocabulary matrix, which will not be repeated in this application.
[0193] Step 690: Determine a second loss value using the second probability distribution.
[0194] In some embodiments, the second loss value may be determined based on the second probability distribution and the proxy probability distribution.
[0195] For example, the second loss value It can be obtained by the following formula:
[0196]
[0197] in, Refers to the probability of the i-th position in the t-th step in the second probability distribution, Q t,i Refers to the proxy probability distribution Q t The probability of the i-th position in .
[0198] Step 700: Obtain initial mining results according to the first probability distribution and the second probability distribution.
[0199] For step 700 , reference may be made to the relevant description of the above embodiment.
[0200] Step 710: Using the first loss value and the second loss value, adjust the network parameters of the second mining network.
[0201] For example, combining the first probability distribution P and the second probability distribution Pa, the model also uses the first loss value and the second loss value As the loss function, the gradient descent optimization algorithm or a variant of the gradient descent optimization algorithm is used to fit the real input debate text sequence to be mined, and the autoregressive language model is iteratively optimized.
[0202] Step 720: Use the proxy probability distribution to modify the initial mining results to obtain the final mining results.
[0203] For example, the following formula can be used to correct the initial mining results:
[0204]
[0205] in, is a restricted probability distribution and ⊙ is the Hadamard product operation.
[0206] Among them, the final mining results represent the argument components and the types of argument components and / or argument relationships and the types of argument relationships in the argument text to be mined, and the proxy probability distribution is determined based on the predicted labels corresponding to the semantic latent vectors.
[0207] This embodiment modifies the initial mining results of the debate text to be mined by using the proxy probability distribution determined based on the predicted labels corresponding to the semantic latent vectors, so that the final mining results are more accurate.
[0208] In addition, this embodiment combines the first probability distribution P and the second probability distribution Pa, and uses the first loss value and the second loss value to adjust the network parameters of the second mining network, thereby improving the performance of the model, reducing the prediction error of the model, and further improving the accuracy of the model prediction.
[0209] The training process of this embodiment can be combined with Figure 7 and Figure 8 , Figure 7 This is a training diagram of an embodiment of the first mining network provided by this application. Figure 8 This is a training diagram of an embodiment of the second mining network provided by this application.
[0210] Specifically, if Figure 7 As shown:
[0211] (1) The segmentation sequence of the argument text to be mined "I believe cloning is beneficial. For example, cloned organs can help patients." is: [ <s> I believecloning is beneficial.For example…< / s> ] Input encoder.
[0212] (2) The encoder encodes the position of each word, and the resulting position code is [0, 1, 2, 3, 4, 5…15], where 0 is <s>, 1 is the encoding of I, 2 is the encoding of believe, 3 is the encoding of cloning, and so on.
[0213] (3) Represent the encoded word segmentation That is, the word segmentation sequence is represented by the word segmentation vector after the Emb(X) mapping function.
[0214] (4) Represent the word segmentation vector Input encoder, encoder uses mapping function Enc(E) to represent word segmentation vector Further converted into a semantic vector H e .
[0215] Right now
[0216] Among them, n x is the character length of the input debate text to be mined, d h is the dimension of the semantic vector.
[0217] (5) The semantic vector H output by the encoder e Input decoder, each step of the decoder takes the output of the previous step and the position code of this step as input. For example, the sequence of input decoder is: [ <s>cloning beneficial <claim>cloned patients <premise> <support>].
[0218] (6) The decoder reconstructs the input sequence by position encoding based on the attributes of each word, and the reconstructed position encoding is: [1, 1, 2, 1, 1, 2, 3].
[0219] (7) The decoder passes the re-encoded word segmentation sequence through the Emb(X) mapping function to obtain the corresponding word segmentation vector representation.
[0220] (8) The corresponding word segmentation vector representation is input into the decoder and processed by multiple layers to obtain the semantic latent vector H t Semantic latent vector H t It can be obtained by the following formula:
[0221]
[0222] Among them, h t Represents the hidden vector generated in step t
[0223] (9) The decoder outputs the corresponding predicted label [3, 5, C, 10, 14, P, S] based on the semantic latent vector. Among them, C stands for Claim, P stands for Premise, and S stands for Support.
[0224] like Figure 8 As shown:
[0225] 1) The word segmentation vector represents the semantic vector H obtained by the encoder e Perform weighted averaging with the word segmentation vector representation E to obtain the average semantic vector of the semantic latent vector The average semantic vector The first vocabulary matrix is obtained by further concatenating the concatenated expanded vocabulary.
[0226] 2) Input the semantic latent vector and the first vocabulary matrix into the restricted pointer network to obtain the first probability distribution P output by the restricted pointer network.
[0227] 3) The semantic vector obtained by the encoder after the word segmentation vector representation is further concatenated with the concatenated extended vocabulary to obtain a second vocabulary matrix.
[0228] 4) Input the semantic latent vector and the second vocabulary matrix into the restricted pointer network to obtain the second probability distribution output by the restricted pointer network, that is, the binary probability distribution P a .
[0229] See Figure 9 , Figure 9 This is a schematic diagram of the structure of an embodiment of the apparatus for mining argumentative texts provided in this application. The apparatus 120 for mining argumentative texts includes: an acquisition module 121, a first input module 122, a second input module 123, and a correction module 124. The acquisition module 121 is used to acquire the argumentative text to be mined; the first input module 122 is used to input the argumentative text to be mined into a first mining network to obtain the semantic vector and semantic latent vector output by the first mining network; the second input module 123 is used to input the semantic vector and semantic latent vector into a second mining network to obtain the initial mining result corresponding to the argumentative text to be mined output by the second mining network; and the correction module 124 is used to correct the initial mining result using a proxy probability distribution to obtain the final mining result.
[0230] It can be understood that the various modules in the debate text mining device 120 are also used to implement the method of any of the above embodiments.
[0231] See Figure 10 , Figure 10 1 is a schematic diagram of the structure of an electronic device according to an embodiment of the present application. The electronic device 130 includes a memory 131 and a processor 132. The memory 131 is used to store program data, and the processor 132 is used to execute the program data to implement the following method:
[0232] Obtain a debate text to be mined; input the debate text to be mined into a first mining network to obtain a semantic vector and a semantic latent vector output by the first mining network; input the semantic vector and the semantic latent vector into a second mining network to obtain an initial mining result corresponding to the debate text to be mined output by the second mining network; use a proxy probability distribution to correct the initial mining result to obtain a final mining result, wherein the final mining result represents the debate components and the types of the debate components and / or the debate relations and the types of the debate relations in the debate text to be mined, and the proxy probability distribution is determined based on the predicted label corresponding to the semantic latent vector.
[0233] It can be understood that the processor 132 is further configured to execute program data to implement the method of any of the above embodiments.
[0234] See Figure 11 , Figure 11 1 is a schematic diagram of the structure of an embodiment of a computer-readable storage medium provided by the present application. The computer-readable storage medium 140 stores program data 141. When the program data 141 is executed by a processor, it is used to implement the following method:
[0235] Obtain a debate text to be mined; input the debate text to be mined into a first mining network to obtain a semantic vector and a semantic latent vector output by the first mining network; input the semantic vector and the semantic latent vector into a second mining network to obtain an initial mining result corresponding to the debate text to be mined output by the second mining network; use a proxy probability distribution to correct the initial mining result to obtain a final mining result, wherein the final mining result represents the debate components and the types of the debate components and / or the debate relations and the types of the debate relations in the debate text to be mined, and the proxy probability distribution is determined based on the predicted label corresponding to the semantic latent vector.
[0236] It can be understood that when the program data 141 is executed by the processor, it is also used to implement the method of any of the above embodiments.
[0237] In the several embodiments provided in this application, it should be understood that the disclosed methods and devices can be implemented in other ways. For example, the device embodiments described above are merely illustrative. For example, the division of modules or units is merely a logical functional division. In actual implementation, other division methods may be used. For example, multiple units or components may be combined or integrated into another system, or some features may be ignored or not implemented.
[0238] Units described as separate components may or may not be physically separate, and components shown as units may or may not be physical units, that is, they may be located in one place or distributed across multiple network units. Some or all of these units may be selected to achieve the purpose of this embodiment according to actual needs.
[0239] In addition, each functional unit in each embodiment of the present application may be integrated into a processing unit, each unit may exist physically separately, or two or more units may be integrated into a single unit. The above-mentioned integrated units may be implemented in the form of hardware or software functional units.
[0240] If the integrated units in the above other embodiments are implemented in the form of software functional units and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present application is essentially or the part that contributes to the prior art or all or part of the technical solution can be embodied in the form of a software product, and the computer software product is stored in a storage medium, including a number of instructions for enabling a computer device (which can be a personal computer, server, or network device, etc.) or a processor to execute all or part of the steps of the various implementation methods of the present application. The aforementioned storage medium includes: various media that can store program codes, such as a USB flash drive, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk.
[0241] The above is only an implementation method of the present application and does not limit the patent scope of the present application. Any equivalent structure or equivalent process transformation made using the contents of the description and drawings of this application, or directly or indirectly applied in other related technical fields, are also included in the patent protection scope of the present application.< / support> < / premise> < / claim> < / s> < / s> < / premise> < / claim> < / support> < / premise> < / claim> < / support> < / premise> < / claim> < / support> < / premise> < / claim> < / support> < / premise> < / claim>
Claims
1. A method for mining argumentative texts, characterized in that: The method comprises: Obtain the debate text to be mined; Inputting the debate text to be mined into a first mining network to obtain a semantic vector and a semantic latent vector output by the first mining network; Determining an average semantic vector of the semantic latent vectors using the semantic vector; Determining a first vocabulary matrix based on the average semantic vector; Inputting the semantic latent vector and the first vocabulary matrix into a second mining network to obtain a first probability distribution output by the second mining network; Determining a second vocabulary matrix based on the semantic vector; Inputting the semantic latent vector and the second vocabulary matrix into a second mining network to obtain a second probability distribution output by the second mining network; Obtaining an initial mining result according to the first probability distribution and the second probability distribution; The initial mining result is modified using a proxy probability distribution to obtain a final mining result, wherein the final mining result represents the argument components and the types of the argument components and / or the argument relations and the types of the argument relations in the argument text to be mined, and the proxy probability distribution is determined based on the predicted label corresponding to the semantic latent vector; The first mining network includes an encoding module and a decoding module. Inputting the debate text to be mined into the first mining network to obtain the semantic vector and semantic latent vector output by the first mining network includes: Determining the character position encoding and word segmentation vector representation of the debate text to be mined; Inputting the character position code and word segmentation vector representation into the encoding module to obtain the semantic vector of the debate text to be mined; Obtaining the reconstructed character position code of the debate text to be mined; The reconstructed character position code and the semantic vector are input into the decoding module to obtain the semantic latent vector.
2. The method according to claim 1, characterized in that The step of obtaining the reconstructed character position code of the debate text to be mined includes: According to the attributes corresponding to the semantic vector input into the encoding module, the semantic vector is reconstructed by character position encoding to obtain a reconstructed character position encoding.
3. The method according to claim 1, characterized in that The initial mining result includes invalid indexes and valid indexes; the initial mining result is corrected by using the proxy probability distribution to obtain the final mining result, including: The probability distribution of invalid indexes in the initial mining result is corrected using the proxy probability distribution to obtain the final mining result.
4. The method according to claim 1, wherein After inputting the semantic latent vector and the first vocabulary matrix into a second mining network to obtain a first probability distribution output by the second mining network, the method includes: determining a first loss value using the first probability distribution; After inputting the semantic latent vector and the second vocabulary matrix into a second mining network to obtain a second probability distribution output by the second mining network, the method includes: determining a second loss value using the second probability distribution; The first loss value and the second loss value are used to adjust network parameters of the second mining network.
5. The method according to claim 4, characterized in that The determining a second loss value by using the second probability distribution includes: A second loss value is determined based on the second probability distribution and the proxy probability distribution.
6. A device for mining argumentative texts, characterized in that: The debate text mining device includes: An acquisition module, configured to acquire the debate text to be mined; A first input module, wherein the first input module is used to input the debate text to be mined into a first mining network to obtain a semantic vector and a semantic latent vector output by the first mining network; The first mining network includes an encoding module and a decoding module, and the first input module is further used to determine the character position encoding and word segmentation vector representation of the debate text to be mined; input the character position encoding and word segmentation vector representation into the encoding module to obtain the semantic vector of the debate text to be mined; obtain the reconstructed character position encoding of the debate text to be mined; input the reconstructed character position encoding and the semantic vector into the decoding module to obtain the semantic latent vector; a second input module, the second input module being configured to determine an average semantic vector of the semantic latent vector using a semantic vector; determine a first vocabulary matrix based on the average semantic vector; input the semantic latent vector and the first vocabulary matrix into a second mining network to obtain a first probability distribution output by the second mining network; determine a second vocabulary matrix based on the semantic vector; input the semantic latent vector and the second vocabulary matrix into a second mining network to obtain a second probability distribution output by the second mining network; and obtain an initial mining result based on the first probability distribution and the second probability distribution; A correction module, wherein the correction module is used to correct the initial mining result using the proxy probability distribution to obtain the final mining result, wherein the final mining result represents the argument components in the argument text to be mined and the types of the argument components and / or the argument relationships and the types of argument relationships, and the proxy probability distribution is determined based on the predicted label of the semantic latent vector.
7. An electronic device, characterized in that: The electronic device includes a memory and a processor, the memory is used to store program data, and the processor is used to execute the program data to implement the method for mining argumentative texts according to any one of claims 1 to 5.
8. A computer-readable storage medium, characterized in that The computer-readable storage medium stores program data, and when the program data is executed by a processor, it is used to implement the method for mining argumentative texts according to any one of claims 1 to 5.
Citation Information
Patent Citations
Viewpoint mining method and device for institutions in investment and financing field and electronic equipment
CN112347245A
Method and apparatus for mining entity focus in text
US20210216715A1