Dialogue text relation extraction method based on speaker enhancement type label

By inserting entity and speaker enhanced type labels into the conversation text and combining the encoder and attention layer, the problem of entity type information being ignored in existing methods is solved, and the performance of conversation text relationship extraction, especially the relationship extraction effect of speaker entities, is improved.

CN115757703BActive Publication Date: 2025-10-10JIANGSU UNIV
View PDF 2 Cites 0 Cited by

Patent Information

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

AI Technical Summary

Technical Problem

Existing methods for extracting relations from conversation texts ignore entity type information, resulting in limited performance improvements in extracting relations from conversation texts.

Method used

A method based on speaker-enhanced type labels is adopted. The entity type module and the relation extraction module are divided into two steps. By inserting entity labels and speaker-enhanced type labels, the encoder is used to generate entity features and entity representations. The window attention layer and the type embedding layer are combined to capture contextual information to improve the quality of entity representation.

Benefits of technology

It significantly improves the performance of relation extraction in conversation texts, especially the relation extraction performance of speaker entities, generates high-quality entity representations, and enhances the robustness of relation extraction in conversation texts.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115757703B_ABST
    Figure CN115757703B_ABST
Patent Text Reader

Abstract

The application discloses a dialogue text relation extraction method based on a speaker enhanced type label, in an entity type module, an entity label is inserted before and after an entity mention in dialogue text to form an input sequence A; the A is converted into a low-dimensional feature sequence, the low-dimensional features corresponding to the head label of the entity label are averaged to generate the features of the entity type and are classified to further predict the entity type; in a relation extraction module, the speaker enhanced type label is inserted before and after the entity mention Entity mention in the dialogue text to form an input sequence B; the B is converted into a low-dimensional feature sequence, the input feature strengthening layer, the feature strengthening layer captures context information and generates entity representations of the subject and object of the entity pair; the entity representations of the subject and object and the global features in the B are input into a relation classifier for classification, so that the relation between the entity pair is predicted. The application significantly improves the performance of dialogue text relation extraction.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention belongs to the technical field of text relationship extraction in artificial intelligence technology, and specifically relates to a method for extracting conversation text relationships based on speaker enhanced type labels. Background Art

[0002] Text relation extraction is a fundamental subtask of information extraction in natural language processing. Its goal is to predict the relationship between two entities mentioned in a text. With the continuous advancement of deep learning and the increasing demand for information extraction, research has gradually shifted from sentence-level relation extraction to document-level relation extraction. However, most research on document-level relation extraction focuses on written text such as websites, news reports, and academic writing, neglecting a more common and important type of text in everyday life: conversational text.

[0003] Daily life involves a large amount of conversation. With the advancement of software and hardware, more and more conversations are being recorded in audio, video, or text formats. Retrieving and mining the rich semantic information contained in these conversations has become a new research hotspot in artificial intelligence. Consequently, the task of extracting relations from conversational text has been proposed. This technique, a technique for mining conversational semantics, aims to extract relationships between given entities from a conversational text. This technique can be used to mine deep semantics from audio and video conversational text, assisting in the construction of knowledge graphs. Applied to public security, it can track suspects and uncover social relationships among high-risk individuals, effectively safeguarding public safety. Applied to smart conferencing, it can be combined with voice technologies such as speech recognition and speaker logging to enable intelligent recording and automatic summarization of meetings. However, compared to formal, coherent, and well-defined written text, conversational text, due to its colloquial nature, low information density, high levels of referential information, and speaker sensitivity, makes extracting relations from conversational text more challenging than traditional textual relation extraction.

[0004] In recent years, new research results have emerged in the field of relation extraction from conversational text. Existing methods often use only pre-trained language models as encoders to extract feature sequences from conversational text. Instead, they leverage the semantic structure of the conversational text to extract entity representations, thereby generating relational features for relationship prediction. These methods focus solely on the multi-level and multi-faceted semantic information of the conversational text, ignoring the irreplaceable role of entity type information in entity representation in conversational text, hindering further improvement in the performance of relation extraction from conversational text. Summary of the Invention

[0005] In response to the shortcomings of the existing technology, the present invention provides a method for extracting conversation text relations based on speaker enhanced type tags, which improves the ability of entity representation in conversation text and significantly improves the performance of conversation text relation extraction.

[0006] The present invention achieves the above technical objectives through the following technical means.

[0007] Dialogue text relation extraction method based on speaker enhanced type label:

[0008] The entity type module inputs the conversation text and inserts the entity label before and after the entity mention in the conversation text to form an input sequence A. The encoder A converts the input sequence A into a low-dimensional feature sequence H, averages the low-dimensional features corresponding to the head label of the entity label, generates entity type features, classifies them, and then predicts the entity type.

[0009] The relation extraction module inputs the conversation text and the predicted entity type, and inserts the speaker enhancement type label before and after the entity mention in the conversation text to form an input sequence B; the encoder B converts the input sequence B into a low-dimensional feature sequence H′, which is input into the feature enhancement layer. The feature enhancement layer captures contextual information and generates entity representations of the subject and object of the entity pair; the entity representations of the subject and object and the global features in the input sequence B are input into the relationship classifier for classification, thereby predicting the relationship between the entity pairs.

[0010] Furthermore, the conversation text with the entity tag inserted is where s i represents the ID of the anonymous speaker in the i-th dialogue round, i = 1, 2, 3…m, m represents the number of dialogue rounds, Represents the adjusted word sequence of the i-th dialogue turn in the entity type module; if the entity of the dialogue text but otherwise, where t i =x i1 ,x i2 ,..,x ij ,..,x in represents the word sequence of the i-th dialogue turn, x ij is a token in the i-th dialogue round, and j = 1, 2, 3…n, where n represents the number of tokens in a dialogue round. [E] and [ / E] are a pair of entity tags, where [E] is the head tag and [ / E] is the tail tag. Represents the pth mention of entity e; entity e represents the subject or object in the entity pair contained in the token sequence.

[0011] Furthermore, the input sequence in, <s>is the start character,< / s> is the terminator, n m Represents the number of tokens in the mth token sequence in the entity type module.

[0012] Furthermore, the characteristic sequence H=H1,…,H b …,H q , where H b is the low-dimensional feature vector of the bth word in the word sequence expanded from the input sequence A, that is, the bth word in the word sequence expanded from the input sequence A is s or x or <s> or< / s> , s represents s1,…,s m x represents a word in the word sequence of the i-th dialogue turn; q represents the total number of words in the input sequence A, that is, m+2+n1+...+n m .

[0013] Furthermore, the dialogue text with the speaker enhancement type tag is inserted represents the adjusted word sequence of the i-th dialogue turn in the relation extraction module, represents the ID of the anonymous speaker after the adjustment of the i-th dialogue round; if s i ∈{s,o}, then otherwise Where s and o represent the subject and object in the entity pair respectively, s i represents the ID of the anonymous speaker in the i-th dialogue round, i = 1, 2, 3…m, and m represents the number of dialogue rounds;

[0014] (1) If e∈{s,o} and t e ≠SPK, where SPK represents the speaker type:

[0015] If the entity Then, in the word sequence containing entity mentions, speaker enhancement type tags are inserted before and after the entity mentions:

[0016]

[0017] otherwise,

[0018] where t i =x i1 ,x i2 ,..,x ij ,..,x in represents the word sequence of the i-th dialogue turn, x ij is a word example in the i-th dialogue round, and j = 1, 2, 3…n, where n represents the number of words in a dialogue round, represents the rth mention of entity e, [E:t e ] is [S:t S ] or [O:t O ],[ / E:t e ] is [ / S:t S] or [ / O:t O ],[S:t s ] and [ / S:t s ]、[O:t o ] and [ / O:t o ] is the speaker enhancement type label of the entity pair subject and object; s is the type of the subject in the entity pair, t o is the type of the object in the entity pair, S and O are substitutes, specifically, if entity e is the subject, then E = S, if entity e is the object, then E = O;

[0019] (2) If e∈{s,o} and t e =SPK:

[0020] If e=s i , then the speaker enhancement type label is inserted before and after the word sequence of the dialogue turn:

[0021]

[0022] otherwise,

[0023] If entity e is a subject, then E = S; if entity e is an object, then E = O;

[0024] Entity e represents the subject and object of the entity pair contained in the token sequence.

[0025] Furthermore, the entity mention includes a word sequence containing the entity mention and a word sequence of a conversation turn when the speaker is the entity.

[0026] Furthermore, the input sequence in <s> is the start character,< / s> is the terminator, c m Represents the number of tokens in the mth token sequence in the relation extraction module.

[0027] Furthermore, the characteristic sequence H′=H1,…,H v …,H u , where H v is the low-dimensional feature vector of the vth word in the word sequence expanded from the input sequence B, that is, the vth word in the word sequence expanded from the input sequence B is s or x or <s> or< / s> , s represents s1,…,s m x represents a word in the word sequence of the i-th dialogue round, and u represents the total number of words in the input sequence B, that is, m+6+c1+...+c m .

[0028] Furthermore, in the feature enhancement layer, the feature sequence H′ is input into the window attention layer to obtain the feature sequence enhanced with local context information The Input type attention layer, use type embedding layer and attention mechanism to build entity representation of subject and object.

[0029] Furthermore, the relation classifier performs classification, specifically:

[0030] Using subject representation h s and object representation h o , get entity pair representation h pair =Tanh([h s ;h o ]·W p +B p );

[0031] Using the global feature H u-2 and H u-1 , get the global entity pair feature h content =Tanh([H u-2 ;H u-1 ]·W c +B c );

[0032] Represent the entity pair h pair and global entity pair feature h content Splicing, and applying normalization method to generate relationship representation h rel , and then through Get the probability distribution of all relations between entity pairs, where represents a learnable parameter.

[0033] The beneficial effects of the present invention are:

[0034] (1) The conversation text relationship extraction method based on speaker enhanced type tags in the present invention is a brand-new relationship extraction framework. For the first time, the conversation text relationship extraction is divided into two steps: entity type classification and relationship extraction. The entity type information obtained by entity type classification is used in relationship extraction to generate more effective entity representation and improve the relationship extraction performance.

[0035] (2) The present invention introduces speaker-enhanced type tags, which fully utilize the key role of entity type information in entity representation. Rich entity context information is extracted in the encoder through the head tag of the speaker-enhanced type tags to assist in generating more robust entity representations and improve the relationship extraction performance. In particular, for speaker entities, by inserting speaker-enhanced type tags before and after the word sequences of all dialogue turns related to the speaker entity, these word sequences are regarded as entity mentions of the speaker entity, and the speaker information implicit in the dialogue text is extracted in an explicit way, thereby improving the quality of speaker entity representation and enhancing the relationship extraction performance of speaker-related entity pairs.

[0036] (3) The present invention introduces a window attention layer to capture the local contextual information of the feature sequence, enrich the local features of the head tag of the speaker enhanced type tag, and introduces a type attention layer to interact with the entity pair type embedding generated by the type embedding layer and the head tag features, aggregate the beneficial features of the head tag features, eliminate irrelevant features, generate high-quality entity representations, and improve the relationship extraction performance. BRIEF DESCRIPTION OF THE DRAWINGS

[0037] Figure 1 This is a diagram of the dialogue text relationship extraction framework based on speaker enhanced type tags according to the present invention. DETAILED DESCRIPTION

[0038] The present invention will be further described below with reference to the accompanying drawings and specific embodiments, but the protection scope of the present invention is not limited thereto.

[0039] like Figure 1 As shown, the conversation text relationship extraction method based on speaker enhanced type tags of the present invention is sequentially entity type module→relationship extraction module according to the data flow transmission process.

[0040] The entity type module inputs the conversation text, inserts the entity label before and after the entity mention in the conversation text to form an input sequence A, converts the input sequence A into a dense low-dimensional feature sequence H through the encoder A, averages the features corresponding to the head label of the entity label (from the low-dimensional feature sequence), generates entity features, and inputs them into the entity type classifier for classification, thereby predicting the entity type.

[0041] The relationship extraction module inputs the conversation text and various entity types, inserts the speaker enhancement type label before and after the entity mention in the conversation text to form an input sequence B, and converts the input sequence B into a dense low-dimensional feature sequence H′ through the encoder B. The feature enhancement layer captures the contextual information and generates entity representations of the subject and object of the entity pair. The entity representations of the subject and object and the global features in the input sequence B are input into the relationship classifier for classification, thereby predicting the relationship between the entity pairs.

[0042] Among them, encoder A and encoder B can be any mainstream pre-trained language model, and the baseline model of the encoder is Transformers. In this embodiment, RoBERTa is selected.

[0043] Use d=s1:t1,s2:t2,…,s m :t m Indicates the input dialogue text, s i Indicates the ID of the anonymous speaker in the i-th dialogue round. The ID value is 1-9. i =x i1 ,x i2 ,..,x ij ,..,x in represents the word sequence of the i-th dialogue turn, where x ij Represents a token in the i-th dialogue turn, i = 1, 2, 3…m, m represents the number of dialogue turns, j = 1, 2, 3…n, n represents the number of tokens in a dialogue turn; s and o represent the subject and object in the entity pair respectively, s and o represent the speaker ID or token sequence. Specifically, the token sequence contains entity mentions corresponding to the subject and object of the entity pair.

[0044] If the subject or object is a speaker entity, s and o represent the speaker ID, and the entity type module can directly determine its entity type as SPK through heuristic rules (SPK represents the entity as a speaker type); if the subject or object is not a speaker entity, s and o represent the word sequence, and the specific process of the entity type module predicting its entity type is as follows:

[0045] 1) The entity type module inputs the dialogue text d, the entity e∈{s,o} of the dialogue text d, defines [E] and [ / E] as a pair of entity tags, where [E] is the head tag and [ / E] is the tail tag, and inserts the entity tags before and after the entity e in the dialogue text. denotes the p-th mention of entity e, and uses Indicates the dialog text where the entity tag is inserted; if but:

[0046]

[0047] otherwise,

[0048] 2) Insert the start symbol before and after the dialogue text of the entity tag <s> and terminator< / s> , and record it as input sequence A: The adjusted word sequence of the i-th dialogue turn The expansion of is determined by whether the entity is included in the word sequence of the i-th dialogue turn;

[0049] Input the input sequence A into the encoder and get the feature sequence H=H1,…,H b …,H q , where H b is the low-dimensional feature vector of the bth word in the word sequence expanded from the input sequence A, that is, the bth word in the word sequence expanded from the input sequence A is s or x or <s> or< / s> , s represents s1,…,s m x represents a word in the word sequence of the i-th dialogue round, and q represents the total number of words in the input sequence A, that is, m+2+n1+...+n m , n m represents the number of tokens in the mth token sequence;

[0050] By averaging the feature vectors corresponding to a head labels [E], we can get the feature H of the entity type. e :

[0051]

[0052] A head tag appears in front of an entity mention, and the feature vector corresponding to the head tag is the feature vector corresponding to x = [E].

[0053] 3) The entity feature H e Input entity type classifier, use one linear layer of entity type classifier to transform entity type feature H e Map it into a 1×6 dimensional vector, input the 1×6 dimensional vector into the Softmax function, and calculate the probability distribution of the 6 entity types.

[0054] 4) Training phase

[0055] The binary cross entropy function (BCELoss) is used to calculate the error between the probability distribution of all entity types and the target value, and back propagation is completed to train the entity type module.

[0056] 5) Testing phase

[0057] The entity type module is used to select the entity type with the highest probability as the prediction result.

[0058] The specific process of predicting the relationship type between entities and subjects and objects is as follows:

[0059] 1) The relation extraction module inputs the conversation text and each entity type, and defines [S:t s ] and [ / S:t s ]、[O:t o ] and [ / O:t o ] is the speaker enhancement type label of the entity to the subject and object, where ts is the type of the subject in the entity pair, t o is the type of the object in the entity pair, Indicates the conversation text with the speaker enhancement type tag inserted;

[0060] a. If entity e is not a speaker, that is, if e∈{s,o} and t e ≠SPK(where: t e Represents t s or t o , SPK represents the speaker type), if Then, in the word sequence containing entity mentions, speaker enhancement type tags are inserted before and after the entity mentions:

[0061]

[0062] otherwise, in, represents the rth mention of entity e; if entity e is the subject, then E = S; if entity e is the object, then E = O;

[0063] If s i ∈{s,o}, then (null character), otherwise

[0064] b. If entity e is a speaker, for each utterance it says (corresponding to a certain word sequence), insert the speaker enhancement type label to surround the entire utterance, that is, if e∈{s,o} and t e =SPK, then e is the anonymous speaker ID, if e=s i , then speaker enhancement type tags are inserted before and after the word sequence:

[0065]

[0066] otherwise,

[0067] If s i ∈{s,o}, then (null character), otherwise

[0068] In the above process, entity mentions and word sequences in word sequences containing entity mentions are collectively referred to as entity mentions.

[0069] 2) Insert the start symbol at the beginning of the dialogue text where the speaker enhancement type tag is inserted <s> , and insert terminators at the end< / s> , terminator, [S:t s ]、[O:t o ], terminator, recorded as input sequence B:

[0070]

[0071] whether the i-th anonymous speaker ID is assigned to a null character needs to be determined according to whether the corresponding speaker ID is an entity, and the adjusted word instance sequence of the i-th dialogue turn in the relation extraction module the expansion formula is determined according to whether the entity is included in the word instance sequence of the i-th dialogue turn or whether the entity is equal to the ID of the anonymous speaker in the i-th dialogue turn;

[0072] input the input sequence B into the encoder B to obtain the feature sequence H' = H1,..., H v …,H u , where H v is a low-dimensional feature vector of the v-th word instance in the expanded word instance sequence of the input sequence B, i.e., the v-th word instance in the expanded word instance sequence of the input sequence B is s or x or <s> or< / s> , s represents one of s1,..., s m , x represents a certain word instance in the word instance sequence of the i-th dialogue turn, and u represents the total number of word instances in the input sequence B, i.e., m+6+c1+...+c m ; c m represents the number of word instances in the m-th word instance sequence, H u-2 , H u-1 represents the corresponding feature vector of the (u-2)th word instance [S:t s ] and the (u-1)th word instance [O:t o ] in the feature sequence H' in the input sequence B.

[0073] 3) In the feature enhancement layer, input the feature sequence H' into the window attention layer, use the multi-head attention layer with K layers of sliding window masks to capture the context information, and obtain the feature sequence enhanced by local context information The sliding window mask of the word instance x i in the input sequence B covers the first N word instances and the last N word instances of x i , including a total of 2N+1 word instances;

[0074] input the feature sequence enhanced by local context information into the type attention layer, use the type embedding layer and the attention mechanism, i.e., through the attention mechanism interaction between the learnable entity pair type embedding and the head label feature (corresponding to the head label in the head label feature), respectively construct the entity representation of the subject and the object.

[0075] The above type embedding layer has 6 type embeddings, respectively corresponding to 6 entity types, and linearly combines the type embeddings corresponding to the entity types of the subject and the object to generate a type pair embedding, i.e., a learnable entity pair type embedding.

[0076] Specifically, use the low-dimensional feature vector h t express The type of embedding, is the set of all entities of type t. Given an entity pair of type t s and t o ,pass Generate type pair embedding h type , where W t 、B t are learnable parameters, [...] represents the connection operation, and Respectively represent t s , t o The corresponding type is embedded. Denotes the mask covering all header tags of entity e, using Q = h type 、 and mask Attention mechanism, output entity representation h of e e ; Repeat the above process and output the subject representation h s and object representation h o .

[0077] 4) In the relation classifier, the subject representation h is used s and object representation h o , get entity pair representation h pair =Tanh([h s ;h o ]·W p +B p ); because H u-2 and H u-1 The global features related to the entity can be learned in the encoder, so H u-2 and H u-1 Considered as a global feature, the global entity pair feature h is obtained content =Tanh([H u-2 ;H u-1 ]·W c +B c ), where W p 、B p 、W c and B c All are learnable parameters;

[0078] Represent the entity pair h pair and global entity pair feature h content Splicing, and applying LayerNorm normalization method to generate relation representation h rel , that is: h rel=LayerNorm([h pair ;h content ]); Input a linear layer to map the relationship representation into a 1×36 dimensional vector, and input the 1×6 dimensional vector into the sigmoid function, that is, through Get the probability distribution of all relations between entity pairs, where represents a learnable parameter.

[0079] 5) Training phase

[0080] The binary cross entropy function is used to calculate the error between the probability distribution of all relationships between entity pairs and the target value, and back propagation is completed to train the relationship extraction module until the module converges and the threshold of the relationship type is obtained.

[0081] 6) Testing phase

[0082] The relationship prediction result is judged by the probability and threshold of a certain relationship between entity pairs: if the probability of a certain relationship is greater than the threshold, the relationship is considered to exist, otherwise it does not exist.

[0083] Based on the same inventive concept as a method for extracting conversation text relationships based on speaker-enhanced type tags, the present application also provides an electronic device comprising one or more processors and one or more memories, wherein the memories store computer-readable code. When executed by the one or more processors, the computer-readable code implements the method for extracting conversation text relationships based on speaker-enhanced type tags. The memory may include a non-volatile storage medium and internal memory; the non-volatile storage medium may store an operating system and the computer-readable code. The computer-readable code includes program instructions that, when executed, cause the processor to execute any method for extracting conversation text relationships based on speaker-enhanced type tags. The processor provides computing and control capabilities, supporting the operation of the entire electronic device. The memory provides an environment for executing the computer-readable code stored in the non-volatile storage medium. When executed by the processor, the computer-readable code causes the processor to execute any method for extracting conversation text relationships based on speaker-enhanced type tags.

[0084] It should be understood that the processor may be a central processing unit (CPU), or other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASIC), field-programmable gate arrays (FPGA), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. The general-purpose processor may be a microprocessor or any conventional processor, etc.

[0085] An embodiment of the present application also provides a computer-readable storage medium, which stores a computer-readable code. The computer-readable code includes program instructions. The processor executes the program instructions to implement the conversation text relationship extraction method based on speaker enhanced type tags of the present application.

[0086] The computer-readable storage medium may be an internal storage unit of the electronic device described in the aforementioned embodiment, such as a hard disk or memory of the computer device. The computer-readable storage medium may also be an external storage device of the electronic device, such as a plug-in hard disk, a smart memory card (SMC), a secure digital (SD) card, a flash memory card, etc. equipped on the electronic device.

[0087] The embodiments described are preferred implementations of the present invention, but the present invention is not limited to the above implementations. Any obvious improvements, substitutions or modifications that can be made by those skilled in the art without departing from the essence of the present invention are within the scope of protection of the present invention.

Claims

1. A method for extracting relations from conversation text based on speaker-enhanced type labels, characterized by: The entity type module inputs the conversation text and inserts the entity label before and after the entity mention in the conversation text to form an input sequence A. The encoder A converts the input sequence A into a low-dimensional feature sequence H, averages the low-dimensional features corresponding to the head label of the entity label, generates entity type features, classifies them, and then predicts the entity type. The relation extraction module inputs the conversation text and predicted entity types, inserts the speaker's enhanced type label before and after the entity mention in the conversation text, and forms an input sequence B. Encoder B converts input sequence B into a low-dimensional feature sequence H′, which is input into the feature enhancement layer. The feature enhancement layer captures contextual information and generates entity representations of the subject and object of the entity pair. The entity representations of the subject and object and the global features in input sequence B are input into the relation classifier for classification, thereby predicting the relationship between the entity pairs. Insert the conversation text with the speaker enhanced type label represents the adjusted word sequence of the i-th dialogue turn in the relation extraction module, represents the ID of the anonymous speaker after the adjustment of the i-th dialogue round; if s i ∈{s,o}, then otherwise Where s and o represent the subject and object in the entity pair respectively, s i represents the ID of the anonymous speaker in the i-th dialogue round, i = 1, 2, 3…m, m represents the number of dialogue rounds, ∈ represents a null character; (1) If e∈{s,o} and t e ≠SPK, where SPK represents the speaker type, t e Represents t s or t o : If the entity Then, in the word sequence containing entity mentions, speaker enhancement type tags are inserted before and after the entity mentions: otherwise, where t i =x i1 ,x i2 ,..,x ij ,..,x in represents the word sequence of the i-th dialogue turn, x ij is a word example in the i-th dialogue round, and j = 1, 2, 3…n, where n represents the number of words in a dialogue round, represents the rth mention of entity e, [E:t e ] is [S:t S ] or [O:t O ],[ / E:t e ] is [ / S:t S ] or [ / O:t O ],[S:t s ] and [ / S:t s ]、[O:t o ] and [ / O:t o ] is the speaker enhancement type label for the entity pair subject and object; t s is the type of the subject in the entity pair, t o is the type of the object in the entity pair, S and O are substitutes, specifically, if entity e is the subject, then E = S, if entity e is the object, then E = O; (2) If e∈{s,o} and t e =SPK: If e=s i , then the speaker enhancement type label is inserted before and after the word sequence of the dialogue turn: otherwise, If entity e is a subject, then E = S; if entity e is an object, then E = O; Entity e represents the subject and object of the entity pair contained in the token sequence.

2. The method for extracting conversational text relations according to claim 1, wherein: The dialog text for inserting entity tags is where s i represents the ID of the anonymous speaker in the i-th dialogue round, i = 1, 2, 3…m, m represents the number of dialogue rounds, Represents the adjusted word sequence of the i-th dialogue turn in the entity type module; if the entity of the dialogue text but otherwise, where t i =x i1 ,x i2 ,..,x ij ,..,x in represents the word sequence of the i-th dialogue turn, x ij is a token in the i-th dialogue round, and j = 1, 2, 3…n, where n represents the number of tokens in a dialogue round. [E] and [ / E] are a pair of entity tags, where [E] is the head tag and [ / E] is the tail tag. Represents the pth mention of entity e; entity e represents the subject or object in the entity pair contained in the token sequence.

3. The method for extracting conversational text relations according to claim 2, wherein: The input sequence in, <s> is the start character,< / s> is the terminator, n m Represents the number of tokens in the mth token sequence in the entity type module.

4. The method for extracting conversational text relations according to claim 3, wherein: The characteristic sequence H=H1,…,H b …,H q , where H b is the low-dimensional feature vector of the bth word in the word sequence expanded from the input sequence A, that is, the bth word in the word sequence expanded from the input sequence A is s or x or <s> or< / s> , s represents s1,…,s m x represents a word in the word sequence of the i-th dialogue turn; q represents the total number of words in the input sequence A, that is, m+2+n1+...+n m .

5. The method for extracting conversation text relations according to claim 1, wherein: The entity mention Entitymention includes a word sequence containing entity mentions and a word sequence of a conversation turn when the speaker is the entity.

6. The method for extracting conversation text relations according to claim 1, characterized in that: The input sequence in <s> is the start character,< / s> is the terminator, c m Represents the number of tokens in the mth token sequence in the relation extraction module.

7. The method for extracting conversational text relations according to claim 6, wherein: The characteristic sequence H′=H1,…,H v …,H u , where H v is the low-dimensional feature vector of the vth word in the word sequence expanded from the input sequence B, that is, the vth word in the word sequence expanded from the input sequence B is s or x or <s> or< / s> , s represents s1,…,s m x represents a word in the word sequence of the i-th dialogue round, and u represents the total number of words in the input sequence B, that is, m+6+c1+...+c m .

8. The method for extracting conversation text relations according to claim 1, wherein: In the feature enhancement layer, the feature sequence H′ is input into the window attention layer to obtain a feature sequence enhanced with local context information The Input type attention layer, use type embedding layer and attention mechanism to build entity representation of subject and object.

9. The method for extracting conversation text relations according to claim 7, wherein: The relation classifier performs classification, specifically: Using subject representation h s and object representation h o , get the entity pair representation h pair =Tanh([h s ;h o ]·W p +B p ); Using the global feature H u-2 and H u-1 , get the global entity pair feature h content =Tanh([H u-2 ;H u-1 ]·W c +B c ); Represent the entity pair h pair and global entity pair feature h content Splicing, and applying normalization method to generate relationship representation h rel , and then through Get the probability distribution of all relations between entity pairs, where represents a learnable parameter; The relationship prediction result is determined by the probability and threshold of a certain relationship between entity pairs; Among them, W p 、B p 、W c and B c are all learnable parameters.

Citation Information

Patent Citations

  • Entity relationship joint extraction method

    CN110781683A

  • Man-machine conversation system and method

    CN114691852A