IP Library Granted Patent US 12670329
Granted Patent B2
US 12670329 · App. 18/599,315 · Granted Jun 30, 2026

Method, apparatus, device, and storage medium for clustering extraction of entity relationships

Inventors: Feng Hong (Beijing, CN); Min Huang (Beijing, CN); Weijie Zhou (Beijing, CN); Shanliang Xiong (Beijing, CN); Wenbi Cai (Beijing, CN); Youpeng Wei (Beijing, CN)
Assignee: Beijing Hydrophis Network Technology Co., Ltd.
G06Q10/40G06F40/30
View Patent ↗
Loading inventors, assignments & file history…
Monitor This Case
Get email alerts when status or documents change.
Order Certified Copies
Most orders are placed with the USPTO same day — all within 24 business hours.
Order via The Patent Place →
Pre-filled with this patent's details
Quick Facts
Patent No.
US 12670329
App. No.
18/599,315
Granted
Jun 30, 2026
Kind
B2
Abstract

The present disclosure relates to an artificial intelligence technology, and discloses a method, an apparatus, a device, and a storage medium for clustering extraction of entity relationships. The method includes: capturing social relationship data of a user, performing entity recognition operation on the social relationship data to obtain an entity recognition result, and performing reverse marking operation on the social relationship data according to the entity recognition result to obtain a data marking sequence set; performing entity relationship recognition on various data marking sequences in the data marking sequence set to obtain a relationship recognition result, and constructing to obtain an entity-relationship group set; and calculating a character similarity between various entities and a semantic similarity between various entity relationships in the entity-relationship group set, and clustering various entity-relationship groups in the entity-relationship group set. The present disclosure may improve the extraction efficiency of entity relationships.

Claims (155)

1 . A method for clustering extraction of entity relationships from unstructured social network text data, the method being configured to improve accuracy of relationship extraction by mitigating misinterpretation caused by short associated words between entities, the method comprising:

capturing social relationship data of a user from a pre-constructed data source platform set, performing entity recognition operation on the social relationship data to obtain an entity recognition result, and performing reverse marking operation on the social relationship data according to the entity recognition result to obtain a data marking sequence set;

performing entity relationship recognition on various data marking sequences in the data marking sequence set by utilizing a pre-trained context semantic recognition model to obtain a relationship recognition result, and constructing to obtain an entity-relationship group set according to the relationship recognition result; and

calculating a character similarity between various entities and a semantic similarity between various entity relationships in the entity-relationship group set according to a pre-configured combined similarity clustering method, and clustering various entity-relationship groups in the entity-relationship group set according to the character similarity and the semantic similarity to obtain an entity-relationship diagram set;

wherein performing entity relationship recognition on various data marking sequences in the data marking sequence set by utilizing a pre-trained context semantic recognition model to obtain a relationship recognition result comprises:

marking tags of preceding text, middle text, and following text on the data marking sequence according to marks corresponding to two entity recognition results in the data marking sequence to obtain a full text marking sequence;

performing word segmentation quantization operation on the full text marking sequence by utilizing the pre-trained context semantic recognition model to obtain a preceding text quantization sequence, a middle text quantization sequence, and a following text quantization sequence;

performing intra-text and inter-text based self-attention configuration on the preceding text quantization sequence, the middle text quantization sequence, and the following text quantization sequence to obtain a text self-attention enhancement sequence; and

performing feature extraction operation on the text self-attention enhancement sequence to obtain a feature sequence set, and performing full connection classification operation on the feature sequence set to obtain a relationship recognition result based on a semantic intention;

wherein prior to performing entity relationship recognition on various data marking sequences in the data marking sequence set by utilizing a pre-trained context semantic recognition model to obtain a relationship recognition result, the method further comprises:

acquiring a pre-constructed context semantic recognition model and a training sample set, each training sample in the training sample set comprising a text statement divided into an upper portion, a middle portion and a lower portion, and a corresponding semantic tag;

successively extracting one training sample from the training sample set as a target sample, and performing entity relationship prediction on the text statement of the target sample by utilizing the context semantic recognition model to obtain a relationship prediction result;

calculating a loss value between a semantic tag of the target sample and the relationship prediction result by utilizing a cross entropy loss algorithm, minimizing the loss value according to a gradient descent method to obtain a network model parameter with the minimum loss value, and performing network reverse update on the network model parameter to obtain an updated context semantic recognition model;

determining convergence of the loss value;

when the loss value does not converge, returning to the above step of successively extracting one training sample from the training sample set as a target sample, and iteratively updating the updated context semantic recognition model; and

when the loss value converges, obtaining a trained context semantic recognition model.

2 . The method for clustering extraction of entity relationships of claim 1 , wherein the combined similarity clustering method comprises:

calculating the character similarity between the entities in various entity-relationship groups by an edit distance algorithm package in C# language;

calculating the semantic similarity between the entity relationships among the entities in various entity-relationship groups by a Deep Structured Semantic Model (DSSN) model; and

clustering various entity-relationship groups in the entity-relationship group set by a K nearest node (KNN) clustering algorithm and according to the character similarity and the semantic similarity to obtain the entity-relationship diagram set.

3 . The method for clustering extraction of entity relationships of claim 1 , wherein clustering various entity-relationship groups in the entity-relationship group set according to the character similarity and the semantic similarity to obtain the entity-relationship diagram set comprises:

configuring a first weight N of the character similarity and a second weight 1-N of the semantic similarity according to the combined similarity clustering method, and performing weighted calculation on the character similarity and the semantic similarity according to the first weight and the second weight to obtain a mixed similarity; and

clustering various entity-relationship groups in the entity-relationship group set according to a nearest node algorithm and the mixed similarity to obtain the entity-relationship diagram set;

the N belonging to an interval of (0, 1).

4 . The method for clustering extraction of entity relationships of claim 3 , wherein a calculation formula of the mixed similarity is as follows:

H

i

=

N

*

H

1

i

+

(

1

-

N

)

*

H

2

i

where H i represents the mixed similarity between various entities in the i th entity-relationship group, H 1i represents the character similarity between the entities in the i th entity-relationship group, and H 2i represents the semantic similarity between the entity relationships among the entities in the i th entity-relationship group.

5 . The method for clustering extraction of entity relationships of claim 1 , wherein the performing entity recognition operation on the social relationship data to obtain an entity recognition result comprises:

performing word segmentation operation on the social relationship data to obtain a word segmentation result, and performing arrangement and quantification operation on the word segmentation result to obtain a social relationship text sequence set;

successively extracting one social relationship text sequence from the social relationship text sequence set, and performing convolution operation on the social relationship text sequence by utilizing a pre-constructed convolution kernel set to obtain a convolution matrix set;

performing average pooling operation on the convolution matrix set to obtain a pooling matrix set;

performing flatten operation on various pooling matrices in the pooling matrix set, and connecting various flatten results to obtain a social text feature sequence corresponding to the social relationship text sequence; and

performing entity recognition on the social text feature sequence by utilizing a pre-constructed conditional random field to obtain an entity recognition result of the social relationship text sequence.

6 . An electronic device for clustering extraction of entity relationships from unstructured social network text data, the method being configured to improve accuracy of relationship extraction by mitigating misinterpretation caused by short associated words between entities, the electronic device comprising:

at least one processor; and

a memory in communication connection with the at least one processor; wherein

the memory stores a computer program executable by the at least one processor, and the computer program is executed by the at least one processor to enable the at least one processor to execute the steps of:

capturing social relationship data of a user from a pre-constructed data source platform set, performing entity recognition operation on the social relationship data to obtain an entity recognition result, and performing reverse marking operation on the social relationship data according to the entity recognition result to obtain a data marking sequence set;

performing entity relationship recognition on various data marking sequences in the data marking sequence set by utilizing a pre-trained context semantic recognition model to obtain a relationship recognition result, and constructing to obtain an entity-relationship group set according to the relationship recognition result; and

calculating a character similarity between various entities and a semantic similarity between various entity relationships in the entity-relationship group set according to a pre-configured combined similarity clustering method, and clustering various entity-relationship groups in the entity-relationship group set according to the character similarity and the semantic similarity to obtain an entity-relationship diagram set;

wherein performing entity relationship recognition on various data marking sequences in the data marking sequence set by utilizing a pre-trained context semantic recognition model to obtain a relationship recognition result comprises:

marking tags of preceding text, middle text, and following text on the data marking sequence according to marks corresponding to two entity recognition results in the data marking sequence to obtain a full text marking sequence;

performing word segmentation quantization operation on the full text marking sequence by utilizing the pre-trained context semantic recognition model to obtain a preceding text quantization sequence, a middle text quantization sequence, and a following text quantization sequence;

performing intra-text and inter-text based self-attention configuration on the preceding text quantization sequence, the middle text quantization sequence, and the following text quantization sequence to obtain a text self-attention enhancement sequence; and

performing feature extraction operation on the text self-attention enhancement sequence to obtain a feature sequence set, and performing full connection classification operation on the feature sequence set to obtain a relationship recognition result based on a semantic intention;

wherein prior to performing entity relationship recognition on various data marking sequences in the data marking sequence set by utilizing a pre-trained context semantic recognition model to obtain a relationship recognition result, the method further comprises:

acquiring a pre-constructed context semantic recognition model and a training sample set, each training sample in the training sample set comprising a text statement divided into an upper portion, a middle portion and a lower portion, and a corresponding semantic tag;

successively extracting one training sample from the training sample set as a target sample, and performing entity relationship prediction on the text statement of the target sample by utilizing the context semantic recognition model to obtain a relationship prediction result;

calculating a loss value between a semantic tag of the target sample and the relationship prediction result by utilizing a cross entropy loss algorithm, minimizing the loss value according to a gradient descent method to obtain a network model parameter with the minimum loss value, and performing network reverse update on the network model parameter to obtain an updated context semantic recognition model;

determining convergence of the loss value;

when the loss value does not converge, returning to the above step of successively extracting one training sample from the training sample set as a target sample, and iteratively updating the updated context semantic recognition model; and

when the loss value converges, obtaining a trained context semantic recognition model.

7 . The electronic device of claim 6 , wherein the combined similarity clustering method comprises:

calculating the character similarity between the entities in various entity-relationship groups by an edit distance algorithm package in C# language;

calculating the semantic similarity between the entity relationships among the entities in various entity-relationship groups by a Deep Structured Semantic Model (DSSN) model; and

clustering various entity-relationship groups in the entity-relationship group set by a K nearest node (KNN) clustering algorithm and according to the character similarity and the semantic similarity to obtain the entity-relationship diagram set.

8 . The electronic device of claim 6 , wherein the clustering various entity-relationship groups in the entity-relationship group set according to the character similarity and the semantic similarity to obtain the entity-relationship diagram set comprises:

configuring a first weight N of the character similarity and a second weight 1-N of the semantic similarity according to the combined similarity clustering method, and performing weighted calculation on the character similarity and the semantic similarity according to the first weight and the second weight to obtain a mixed similarity; and

clustering various entity-relationship groups in the entity-relationship group set according to a nearest node algorithm and the mixed similarity to obtain the entity-relationship diagram set;

the N belonging to an interval of (0, 1).

9 . The electronic device of claim 8 , wherein a calculation formula of the mixed similarity is as follows:

H

i

=

N

*

H

1

i

+

(

1

-

N

)

*

H

2

i

where H i represents the mixed similarity between various entities in the i th entity-relationship group, H 1i represents the character similarity between the entities in the i th entity-relationship group, and H 2i represents the semantic similarity between the entity relationships among the entities in the i th entity-relationship group.

10 . The electronic device of claim 6 , wherein the performing entity recognition operation on the social relationship data to obtain an entity recognition result comprises:

performing word segmentation operation on the social relationship data to obtain a word segmentation result, and performing arrangement and quantification operation on the word segmentation result to obtain a social relationship text sequence set;

successively extracting one social relationship text sequence from the social relationship text sequence set, and performing convolution operation on the social relationship text sequence by utilizing a pre-constructed convolution kernel set to obtain a convolution matrix set;

performing average pooling operation on the convolution matrix set to obtain a pooling matrix set;

performing flatten operation on various pooling matrices in the pooling matrix set, and connecting various flatten results to obtain a social text feature sequence corresponding to the social relationship text sequence; and

performing entity recognition on the social text feature sequence by utilizing a pre-constructed conditional random field to obtain an entity recognition result of the social relationship text sequence.

11 . A non-transitory computer-readable storage medium storing a computer program for clustering extraction of entity relationships from unstructured social network text data, the method being configured to improve accuracy of relationship extraction by mitigating misinterpretation caused by short associated words between entities, the computer program, when executed by a processor, implementing the steps of:

capturing social relationship data of a user from a pre-constructed data source platform set, performing entity recognition operation on the social relationship data to obtain an entity recognition result, and performing reverse marking operation on the social relationship data according to the entity recognition result to obtain a data marking sequence set;

performing entity relationship recognition on various data marking sequences in the data marking sequence set by utilizing a pre-trained context semantic recognition model to obtain a relationship recognition result, and constructing to obtain an entity-relationship group set according to the relationship recognition result; and

calculating a character similarity between various entities and a semantic similarity between various entity relationships in the entity-relationship group set according to a pre-configured combined similarity clustering method, and clustering various entity-relationship groups in the entity-relationship group set according to the character similarity and the semantic similarity to obtain an entity-relationship diagram set;

wherein performing entity relationship recognition on various data marking sequences in the data marking sequence set by utilizing a pre-trained context semantic recognition model to obtain a relationship recognition result comprises:

marking tags of preceding text, middle text, and following text on the data marking sequence according to marks corresponding to two entity recognition results in the data marking sequence to obtain a full text marking sequence;

performing word segmentation quantization operation on the full text marking sequence by utilizing the pre-trained context semantic recognition model to obtain a preceding text quantization sequence, a middle text quantization sequence, and a following text quantization sequence;

performing intra-text and inter-text based self-attention configuration on the preceding text quantization sequence, the middle text quantization sequence, and the following text quantization sequence to obtain a text self-attention enhancement sequence; and

performing feature extraction operation on the text self-attention enhancement sequence to obtain a feature sequence set, and performing full connection classification operation on the feature sequence set to obtain a relationship recognition result based on a semantic intention;

wherein prior to performing entity relationship recognition on various data marking sequences in the data marking sequence set by utilizing a pre-trained context semantic recognition model to obtain a relationship recognition result, the method further comprises:

acquiring a pre-constructed context semantic recognition model and a training sample set, each training sample in the training sample set comprising a text statement divided into an upper portion, a middle portion and a lower portion, and a corresponding semantic tag;

successively extracting one training sample from the training sample set as a target sample, and performing entity relationship prediction on the text statement of the target sample by utilizing the context semantic recognition model to obtain a relationship prediction result;

calculating a loss value between a semantic tag of the target sample and the relationship prediction result by utilizing a cross entropy loss algorithm, minimizing the loss value according to a gradient descent method to obtain a network model parameter with the minimum loss value, and performing network reverse update on the network model parameter to obtain an updated context semantic recognition model;

determining convergence of the loss value;

when the loss value does not converge, returning to the above step of successively extracting one training sample from the training sample set as a target sample, and iteratively updating the updated context semantic recognition model; and

when the loss value converges, obtaining a trained context semantic recognition model.

12 . The non-transitory computer-readable storage medium of claim 11 , wherein the clustering various entity-relationship groups in the entity-relationship group set according to the character similarity and the semantic similarity to obtain an entity-relationship diagram set comprises:

configuring a first weight N of the character similarity and a second weight 1-N of the semantic similarity according to the combined similarity clustering method, and performing weighted calculation on the character similarity and the semantic similarity according to the first weight and the second weight to obtain a mixed similarity; and

clustering various entity-relationship groups in the entity-relationship group set according to a nearest node algorithm and the mixed similarity to obtain the entity-relationship diagram set;

the N belonging to an interval of (0, 1).

13 . The non-transitory computer-readable storage medium of claim 12 , wherein a calculation formula of the mixed similarity is as follows:

H

i

=

N

*

H

1

i

+

(

1

-

N

)

*

H

2

i

where H i represents the mixed similarity between various entities in the i th entity-relationship group, H 1i represents the character similarity between the entities in the i th entity-relationship group, and H 2i represents the semantic similarity between the entity relationships among the entities in the i th entity-relationship group.

14 . The non-transitory computer-readable storage medium of claim 11 , wherein the performing entity recognition operation on the social relationship data to obtain an entity recognition result comprises:

performing word segmentation operation on the social relationship data to obtain a word segmentation result, and performing arrangement and quantification operation on the word segmentation result to obtain a social relationship text sequence set;

successively extracting one social relationship text sequence from the social relationship text sequence set, and performing convolution operation on the social relationship text sequence by utilizing a pre-constructed convolution kernel set to obtain a convolution matrix set;

performing average pooling operation on the convolution matrix set to obtain a pooling matrix set;

performing flatten operation on various pooling matrices in the pooling matrix set, and connecting various flatten results to obtain a social text feature sequence corresponding to the social relationship text sequence; and

performing entity recognition on the social text feature sequence by utilizing a pre-constructed conditional random field to obtain an entity recognition result of the social relationship text sequence.