Entity relation mining method and apparatus, electronic device, and storage medium
The present invention relates to artificial intelligence and discloses an entity relation mining method, including steps of acquiring enterprise text information, and extracting an enterprise relation instance in the enterprise text information; performing key entity extraction on the enterprise relation instance to obtain a key entity set; identifying an entity relation between key entities in the key entity set and a first relation weight corresponding to the entity relation, and performing weight calculation on the enterprise text information after deletion of the entity relation instance to obtain a second relation weight; and, using an entity relation having the first relation weight or the second relation weight satisfying a preset reference condition as a standard entity relation. The present invention further provides an entity relation mining apparatus, an electronic device and a storage medium. The present invention can improve the accuracy of entity relation mining.
1 . A computer-implemented entity relation mining method for processing a large volume of enterprise data, the entity relation mining method comprising:
acquiring enterprise text information comprising a plurality of documents, and extracting a plurality of enterprise relation instances from the enterprise text information by processing the enterprise text information using at least one processor;
performing key entity extraction on each of the plurality of enterprise relation instances by using a preset graph sorting algorithm to obtain a key entity set, comprising:
performing instance analysis on the enterprise relation instance to obtain instance analysis data;
performing tokenization and screening on the instance analysis data to obtain a standard token set;
constructing a directed weighted graph according to standard tokens in the standard token set, and calculating node weights corresponding to a plurality of nodes in the directed weighted graph; and
using the nodes having node weights exceeding a preset threshold in the directed weighted graph as key entities, and performing entity collection on the plurality of key entities to obtain a key entity set;
identifying each of a plurality of entity relations between key entities in the key entity set and a first relation weight corresponding to the entity relation, deleting the enterprise relation instance from the enterprise text information, and performing, by using a preset temporal order interpolation algorithm comprising linear interpolation or polynomial interpolation, weight calculation on the modified enterprise text information after deletion of the enterprise relation instance to obtain a second relation weight, wherein the first relation weight is calculated based on an occurrence frequency of the entity relation within a preset time period; and
selecting, as a standard entity relation, either the entity relation associated with the first relation weight or an entity relation derived based on the second relation weight, by evaluating the first relation weight and the second relation weight against a preset reference condition;
wherein the performing, by using a preset temporal order interpolation algorithm, weight calculation on the enterprise text information after deletion of the enterprise relation instance to obtain a second relation weight comprises:
in response to determining that the enterprise text information does not contain enterprise relation instances, backtracking historical enterprise text information corresponding to the enterprise text information by querying a separate corpus of historical enterprise text information temporally preceding the enterprise text information; and
extracting historical entity relations from the historical enterprise text information, applying the temporal order interpolation algorithm to the historical entity relations to calculate a weight of the historical entity relation as the second relation weight.
2 . The entity relation mining method according to claim 1 , wherein the performing tokenization and screening on the instance analysis data to obtain a standard token set comprises:
performing sentence segmentation on the instance analysis data according to a preset symbol to obtain a segmented sentence set;
deleting stop words in the segmented sentence set, and performing tokenization on segmented sentences after deletion of the stop words to obtain an initial token set; and
performing part-of-speech tagging on a plurality of initial tokens in the initial token set, and reserving initial tokens consistent with a preset specified part of speech as standard tokens to obtain a standard token set.
3 . The entity relation mining method according to claim 1 , wherein the node weights corresponding to a plurality of nodes in the directed weighted graph are calculated by a following method:
WS
(
V
i
)
=
(
1
-
d
)
+
d
*
∑
V
j
∈
In
(
V
i
)
W
ji
∑
V
k
∈
Out
(
V
j
)
W
jk
WS
(
V
j
)
where WS(V i ) represents a node weight of a node V i , d is a damping coefficient, In(V i ) is a first node set pointing to the node V i , Out(V j ) is a second node set pointed by the node V i , W ji is a connection weight between nodes V i and V j , and W jk is a connection weight between nodes V k and V j .
4 . An electronic device, the electronic device comprising:
at least one processor; and
a memory in communication connection to the at least one processor, wherein,
the memory stores thereon computer programs executable by the at least one processor that, when executed by the at least one processor, enable the at least one processor to execute a computer-implemented entity relation mining method for processing a large volume of enterprise data, the entity relation mining method comprising:
acquiring enterprise text information comprising a plurality of documents, and extracting a plurality of enterprise relation instances from the enterprise text information by processing the enterprise text information using the at least one processor;
performing key entity extraction on each of the plurality of enterprise relation instances by using a preset graph sorting algorithm to obtain a key entity set, comprising:
performing instance analysis on the enterprise relation instance to obtain instance analysis data;
performing tokenization and screening on the instance analysis data to obtain a standard token set;
constructing a directed weighted graph according to standard tokens in the standard token set, and calculating node weights corresponding to a plurality of nodes in the directed weighted graph; and
using the nodes having node weights exceeding a preset threshold in the directed weighted graph as key entities, and performing entity collection on the plurality of key entities to obtain a key entity set;
identifying each of a plurality of entity relations between key entities in the key entity set and a first relation weight corresponding to the entity relation, deleting the enterprise relation instance from the enterprise text information, and performing, by using a preset temporal order interpolation algorithm comprising linear interpolation or polynomial interpolation, weight calculation on the modified enterprise text information after deletion of the enterprise relation instance to obtain a second relation weight, wherein the first relation weight is calculated based on an occurrence frequency of the entity relation within a preset time period; and
selecting, as a standard entity relation, either the entity relation associated with the first relation weight or an entity relation derived based on the second relation weight, by evaluating the first relation weight and the second relation weight against a preset reference condition;
wherein the performing, by using a preset temporal order interpolation algorithm, weight calculation on the enterprise text information after deletion of the enterprise relation instance to obtain a second relation weight comprises:
in response to determining that the enterprise text information does not contain enterprise relation instances, backtracking historical enterprise text information corresponding to the enterprise text information by querying a separate corpus of historical enterprise text information temporally preceding the enterprise text information; and
extracting historical entity relations from the historical enterprise text information, applying the temporal order interpolation algorithm to the historical entity relations to calculate a weight of the historical entity relation as the second relation weight.
5 . The electronic device according to claim 4 , wherein the performing tokenization and screening on the instance analysis data to obtain a standard token set comprises:
performing sentence segmentation on the instance analysis data according to a preset symbol to obtain a segmented sentence set;
deleting stop words in the segmented sentence set, and performing tokenization on segmented sentences after deletion of the stop words to obtain an initial token set; and
performing part-of-speech tagging on a plurality of initial tokens in the initial token set, and reserving initial tokens consistent with a preset specified part of speech as standard tokens to obtain a standard token set.
6 . The electronic device according to claim 4 , wherein the node weights corresponding to a plurality of nodes in the directed weighted graph are calculated by a following method:
WS
(
V
i
)
=
(
1
-
d
)
+
d
*
∑
V
j
∈
I
n
(
V
i
)
W
j
i
∑
V
k
∈
Out
(
V
j
)
W
jk
WS
(
V
j
)
where WS(V i ) represents a node weight of a node V i , d is a damping coefficient, In(V i ) is a first node set pointing to the node V i , Out(V j ) is a second node set pointed by the node V i , W ji is a connection weight between nodes V i and V i , and W jk is a connection weight between nodes V k and V j .
7 . A non-transitory computer readable storage medium having computer programs stored thereon that, when executed by a processor, implement a computer-implemented entity relation mining method for processing a large volume of enterprise data, the entity relation mining method comprising:
acquiring enterprise text information comprising a plurality of documents, and extracting a plurality of enterprise relation instances from the enterprise text information by processing the enterprise text information using the processor;
performing key entity extraction on each of the plurality of enterprise relations instance by using a preset graph sorting algorithm to obtain a key entity set, comprising:
performing instance analysis on the enterprise relation instance to obtain instance analysis data;
performing tokenization and screening on the instance analysis data to obtain a standard token set;
constructing a directed weighted graph according to standard tokens in the standard token set, and calculating node weights corresponding to a plurality of nodes in the directed weighted graph; and
using the nodes having node weights exceeding a preset threshold in the directed weighted graph as key entities, and performing entity collection on the plurality of key entities to obtain a key entity set;
identifying each of a plurality of entity relations between key entities in the key entity set and a first relation weight corresponding to the entity relation, deleting the enterprise relation instance from the enterprise text information, and performing, by using a preset temporal order interpolation algorithm comprising linear interpolation or polynomial interpolation, weight calculation on the modified enterprise text information after deletion of the enterprise relation instance to obtain a second relation weight, wherein the first relation weight is calculated based on an occurrence frequency of the entity relation within a preset time period; and
selecting, as a standard entity relation, either the entity relation associated with the first relation weight or an entity relation derived based on the second relation weight, by evaluating the first relation weight and the second relation weight against a preset reference condition;
wherein the performing, by using a preset temporal order interpolation algorithm, weight calculation on the enterprise text information after deletion of the enterprise relation instance to obtain a second relation weight comprises:
in response to determining that the enterprise text information does not contain enterprise relation instances, backtracking historical enterprise text information corresponding to the enterprise text information by querying a separate corpus of historical enterprise text information temporally preceding the enterprise text information; and
extracting historical entity relations from the historical enterprise text information, applying the temporal order interpolation algorithm to the historical entity relations to calculate a weight of the historical entity relation as the second relation weight.
8 . The non-transitory computer readable storage medium according to claim 7 , wherein the node weights corresponding to a plurality of nodes in the directed weighted graph are calculated by a following method:
WS
(
V
i
)
=
(
1
-
d
)
+
d
*
∑
V
j
∈
I
n
(
V
i
)
W
j
i
∑
V
k
∈
Out
(
V
j
)
W
jk
WS
(
V
j
)
where WS(V i ) represents a node weight of a node V i , d is a damping coefficient, In(V i ) is a first node set pointing to the node V i , Out(V j ) is a second node set pointed by the node V i , W ji is a connection weight between nodes V i and V j , and W jk is a connection weight between nodes V k and V j .