# US 2021/0240603 A1 · Entity and relationship joint extraction method oriented to software bug knowledge

> Agents: this data is available as JSON from the patentgrep API and MCP server — see https://patentgrep.com/llms.txt

- Number: US 2021/0240603 A1
- Document ID: US20210240603A1
- Status: Published application
- Kind: A1
- Application number: 17/054,301
- Filed: 2019-08-28
- Published: 2021-08-05
- Earliest claimed: 2018-11-05
- Assignees: Yangzhou University
- Applicants: Yangzhou University
- Inventors: Bin Li; Dingshan Chen; Cheng Zhou; Xiaobing Sun
- Web page: https://patentgrep.com/patent/US20210240603A1

## CPC

- G06F 11/3692: {for test results analysis}
- G06F 16/36: Creation of semantic tools, e.g. ontology or thesauri
- G06F 11/3698: Environments for analysis, debugging or testing of software
- G06F 16/288: {Entity relationship models}
- G06F 16/9024: {Graphs; Linked lists (G06F16/9027 takes precedence)}
- G06N 3/044: Recurrent networks, e.g. Hopfield networks
- G06N 3/0442: characterised by memory or gating, e.g. long short-term memory [LSTM] or gated recurrent units [GRU]
- G06N 3/045: Combinations of networks
- G06N 3/047: Probabilistic or stochastic networks
- G06N 3/09: Supervised learning
- G06N 7/01: Probabilistic graphical models, e.g. probabilistic networks
- G06N 3/048: Activation functions
- G06F: ELECTRIC DIGITAL DATA PROCESSING (computer systems based on specific computational models G06N)
- G06N: COMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS

## Abstract

Provided is an entity and relationship joint extraction method oriented to software bug knowledge. The method includes collecting text data of an open-source bug library and preprocessing the text data to obtain a bug text data corpus; extracting, from the bug text data corpus, a statement S for describing a bug, and then processing S, and using the processed S as a subsequent input statement; constructing an entity and relationship joint extraction model; obtaining, in conjunction with the constructed entity and relationship joint extraction model based on a transition system, an entity set E and a relationship set R corresponding to the input statement; and outputting the entity set E and the relationship set R to complete joint extraction of entities and relationships.

## Claims

### Claim 1

An entity and relationship joint extraction method oriented to software bug knowledge, comprising:
step 1: collecting text data of an open-source bug library and preprocessing the text data to obtain a bug text data corpus;
step 2: extracting, from the bug text data corpus obtained in step 1, a statement S for describing a bug, processing S, and then using the processed S as an input statement of step 4;
step 3: constructing an entity and relationship joint extraction model based on a transition system;
step 4: obtaining, in conjunction with the constructed entity and relationship joint extraction model based on the transition system in step 3, an entity set E and a relationship set R corresponding to the input statement of step 2; and,
step 5: outputting the entity set E and the relationship set R obtained in step 4 to complete joint extraction of entities and relationships.

### Claim 2 (depends on 1)

The entity and relationship joint extraction method oriented to software bug knowledge of claim 1, wherein the text data of step 1 comprises a title, a description and a comment in a bug report, and a question and an answer in a question and answer website.

### Claim 3 (depends on 1)

The entity and relationship joint extraction method oriented to software bug knowledge of claim 1, wherein in step 1, preprocessing the text data to obtain the bug text data corpus comprises:
preprocessing the text data by using a natural language processing tool, and storing the preprocessed related text data in a form of text to obtain the bug text data corpus, wherein the preprocessing comprises text extraction, word segmentation, part-of-speech tagging and lemmatization.

### Claim 4 (depends on 1)

The entity and relationship joint extraction method oriented to software bug knowledge of claim 1, wherein in step 2, the statement S for describing the bug is:
S={w1,w2,w3, . . . ,wn},
where wi denotes an i-th word in a statement sequence S, and i=1, 2, . . . , n.

### Claim 5 (depends on 1)

The entity and relationship joint extraction method oriented to software bug knowledge of claim 1, wherein in step 2, processing S comprises:
step 2-1: performing word embedding processing on S; and,
step 2-2: performing Bi-LSTM coding processing on S processed in step 2-1.

### Claim 6 (depends on 1)

The entity and relationship joint extraction method oriented to software bug knowledge of claim 1, wherein in step 3, constructing the entity and relationship joint extraction model based on the transition system comprises:
step 3-1: determining an initial transition state T0 of the entity and relationship joint extraction model based on the transition system;
step 3-2: determining an optimal transition action corresponding to the initial transition state T0 of step 3-1 and performing the optimal transition action on the initial transition state T0 to obtain a transition state at a next moment; and,
step 3-3: determining an optimal transition action corresponding to the transition state at the next moment, performing the optimal transition action on the transition state at the next moment, and looping in such manner until a final transition state Tn is reached, so as to complete the construction of the entity and relationship joint extraction model based on the transition system;
wherein the transition state is represented by an LSTM-based method by using the following formula:
T=(α,δ,e,β,R,E),
where σ denotes a stack storing a generated entity, δ denotes a transition stack storing an entity temporarily popping out of σ and then repressed into σ, e denotes a stack storing part of entity blocks being processed, β denotes a buffer storing unprocessed words, R denotes a relationship set, and E denotes an entity set;
wherein the initial transition state T0 is a transition state in which β is not empty and σ, δ, e, R and E are empty, wherein T0 is represented by:
T0=([ ],[ ],[ ],[w1,w2,w3, . . . ,wm],Ø,Ø),
where m denotes a number of the unprocessed words; and,
wherein the final transition state Tn is a transition state in which β and e are empty, wherein Tn is represented by:
Tn=(σ,δ,[ ],[ ],R,E).

### Claim 7 (depends on 6)

The entity and relationship joint extraction method oriented to software bug knowledge of claim 6, wherein in step 3-1 to step 3-3, the transition action comprises:
generating a directed graph by using a transition strategy formed by an arc-eager algorithm, wherein according to characteristics of the directed graph, the transition strategy comprises two types of transition actions:
(1) an entity generation action, which is used for generating an entity arc; and,
(2) a relationship generation action, which is used for generating a relationship arc.

### Claim 8 (depends on 6)

The entity and relationship joint extraction method oriented to software bug knowledge of claim 6, wherein in step 3-2 to step 3-3, determining the optimal transition action corresponding to the transition state comprises: determining, in conjunction with a softmax function and an arc-standard algorithm based on greedy search, the optimal transition action corresponding to the transition state, which comprises:
(1) assuming that a transition state of the entity and relationship joint extraction model based on the transition system at moment t is:
mt=max {0,Z},
where Z=W[σt; δt; at; βt; et]+d, W denotes a parameter matrix, σt, δt, at, βt, et denote a state of σ at the moment t, a state of δ at the moment t, a state of A at the moment t, a state of β at the moment t, a state of e at the moment t respectively, and d denotes a bias item in a neural network;
(2) obtaining a probability of a certain transition action at at the moment t by using the softmax function, wherein the obtained probability is:
p
⁡
(
a
t
⁢
|
⁢
m
t
)
=
exp
⁡
(
g
a
t
T
⁢
m
t
+
q
a
t
)
∑
a
′
∈
A
⁡
(
S
,
B
)
⁢
exp
⁡
(
g
a
′
T
⁢
m
t
+
q
a
′
)
,
where at denotes the transition action at the moment t, gat denotes a column vector of an embedding representation of the transition action ai, qat denotes a bias item corresponding to the transition action at, mt denotes a state of the model, that is, a coding set of information about all decisions made by the model, at the moment t, A(S, B) denotes an adoptable effective action set when a current state is stored, a′ denotes a certain transition action in set A, ga′ denotes a column vector of an embedding representation of the transition action a′, and T denotes transposition, and,
wherein a probability of a transition action sequence a is:
p(a|ω)=Πt=1|a|p(at|mt),
where |a| denotes a number of transition actions in the transition action sequence a; and,
(3) repeating (2) to obtain probabilities of all transition action sequences, and then using a transition action sequence with a highest probability as an optimal transition action corresponding to the transition state at the moment t.

### Claim 9 (depends on 6)

The entity and relationship joint extraction method oriented to software bug knowledge of claim 6, wherein in step 4, obtaining, in conjunction with the constructed entity and relationship joint extraction model based on the transition system in step 3, the entity set E and the relationship set R corresponding to the input statement of step 2 comprises:
performing, according to a series of optimal transition actions obtained during the construction of the entity and relationship joint extraction model based on the transition system of step 3, a series of transition actions on the input statement of step 2 to obtain the entity set E and the relationship set R corresponding to the input statement.

### Claim 10 (depends on 4)

The entity and relationship joint extraction method oriented to software bug knowledge of claim 4, wherein the entity set E obtained in step 4 is:
E={(ei,ej,r)},
where 1≤i≤j≤n, r denotes a user-defined entity type of a software bug, ei and ej denote entities, and r comprises core, GUI, Network, I/O, Driver, File System, Hardware, Language, API, Standard, Platform, Framework, Defect test, Mobile, common adjective and common verb; and,
wherein the relationship set R is:
R={(ei,wj,l)},
where 1≤i≤j≤n, denotes a user-defined attribute tag of a bug relationship, and ei and ej denote entities; and l is described in a Table 2 as follows:
TABLE 2
The user-defined attribute tag of the bug relationship
Relationship
Relationship
Attribute
Attribute Name
Characteristic
Description
Sibling
Transitivity and
Owned class and attribute are derived from a same
relationship
symmetry
parent class
Identical
Transitivity and
Having a same meaning and different representations
relationship
symmetry
of same knowledge
Inclusive
Inclusiveness
Involving content of another entity, such as a
relationship
concept, nature, etc.
Opposite
Antisymmetry
Two should be non-concurrent and mutually
relationship
exclusive between each other
Inheritance
Reciprocal
A parent-child relationship and a child-inheriting-
relationship
reflexivity
parent relationship attribute exist
Illustrative
Illustration
Entity A is a description or an operation (an adjective
relationship
or a verb) of entity B
Causal
Dependence
Entity A is a reason for a conclusion of entity B
relationship
Semantically
Transitivity and
A semantic connection exists between the entity A
related
symmetry
and the entity B

### Claim 11 (depends on 9)

The entity and relationship joint extraction method oriented to software bug knowledge of claim 9, wherein the entity set E obtained in step 4 is:
E={(ei,ej,r)},
where 1≤i≤j≤n, r denotes a user-defined entity type of a software bug, ei and ej denote entities, and r comprises core, GUI, Network, I/O, Driver, File System, Hardware, Language, API, Standard, Platform, Framework, Defect test, Mobile, common adjective and common verb; and,
wherein the relationship set R is:
R={(ei,wj,l)},
where 1≤i≤j≤n, l denotes a user-defined attribute tag of a bug relationship, and ei and ej denote entities; and l is described in a Table 2 as follows:
TABLE 2
The user-defined attribute tag of the bug relationship
Relationship
Relationship
Attribute
Attribute Name
Characteristic
Description
Sibling
Transitivity and
Owned class and attribute are derived from a same
relationship
symmetry
parent class
Identical
Transitivity and
Having a same meaning and different representations
relationship
symmetry
of same knowledge
Inclusive
Inclusiveness
Involving content of another entity, such as a
relationship
concept, nature, etc.
Opposite
Antisymmetry
Two should be non-concurrent and mutually
relationship
exclusive between each other
Inheritance
Reciprocal
A parent-child relationship and a child-inheriting-
relationship
reflexivity
parent relationship attribute exist
Illustrative
Illustration
Entity A is a description or an operation (an adjective
relationship
or a verb) of entity B
Causal
Dependence
Entity A is a reason for a conclusion of entity B
relationship
Semantically
Transitivity and
A semantic connection exists between the entity A
related
symmetry
and the entity B
