IP Library › Granted Patent US 12,248,884
Granted Patent B2
US 12,248,884 · App. 18/397,227 · Granted Mar 11, 2025

Method and apparatus for knowledge graph construction, storage medium, and electronic device

Inventors: Hongyu Xiong (Los Angeles, CA); Han Wang (Los Angeles, CA); Yuan Gao (Los Angeles, CA); Yiqi Feng (Los Angeles, CA); Bin Liu (Los Angeles, CA)
Assignee: LEMON INC.
G06N5/02G06F16/288
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 12,248,884
App. No.
18/397,227
Granted
Mar 11, 2025
Kind
B2
Abstract

The present disclosure relates to a method and apparatus for knowledge graph construction, storage medium and electronic device. The method for knowledge graph construction, comprises: identifying an entity concept from a title text of a target web page and at least one entity corresponding to the entity concept from a body text of the target web page; constructing a syntax parse tree of the title text based on syntax parse rules of a language to which the title text belongs, and determining, from the syntax parse tree, a modifier for modifying the entity concept; and generating a knowledge graph based on the entity concept, the modifier, and the at least one entity. Through the solution of the present disclosure, knowledge graphs with high accuracy and high recall rates are constructed without structured processing on target web pages.

Claims (138)

1. A method for knowledge graph construction, comprising:

identifying, through a processing device and by using a web page parser, an entity concept from a title text of the target web page and at least one entity corresponding to the entity concept from a body text of the target web page;

constructing, through the processing device, a syntax parse tree of the title text based on syntax parse rules of a language to which the title text belongs, and determining, from the syntax parse tree, a modifier for modifying the entity concept through the processing device; and

generating, through the electronic device, a knowledge graph based on the entity concept, the modifier, and the at least one entity;

wherein identifying, through the processing device, the at least one entity corresponding to the entity concept from the body text of the target web page comprises:

after obtaining page source code of the target web page, generating, through the processing device, a coding label tree corresponding to the page source code based on encoding labels in the page source code;

determining, from the coding label tree, a plurality of target encoding label subtrees having a similarity greater than a predetermined threshold through the processing device; and

for each of the target encoding label subtrees, determining, through the processing device, the entity from a body text segment corresponding to the target encoding label subtree;

wherein a text pattern of the title text is a top K text pattern, and determining, from the coding label tree, the plurality of target encoding label subtrees having the similarity greater than the predetermined threshold through the processing device, comprises:

determining, through the processing device, a target encoding label node from the coding label tree, the target encoding label node having a number of encoding label subtrees greater than or equal to a predetermined number; and

determining, through the processing device, at least the predetermined number of target encoding label subtrees from encoding label subtrees under the target encoding label node;

wherein the predetermined number is determined by:

determining, from the syntax parse tree, a syntax subtree comprising the entity concept through the processing device; and

determining, from the syntax subtree, a quantifier K corresponding to a cardinal number label through the processing device.

2. The method of claim 1 , wherein identifying, through the processing device and by using the web page parser, the entity concept from the title text of the target web page comprises:

obtaining, by using the web page parser, the page source code of the target web page;

locating, through the processing device, the title text from the page source code based on a title label; and

matching, through the processing device, the entity concept from the title text based on a predetermined set of entity concept words.

3. The method of claim 1 , wherein determining, from the syntax parse tree, the modifier for modifying the entity concept through the processing device comprises:

determining, through the processing device, a title text segment corresponding to the syntax subtree; and

determining, through the processing device, as the modifier an adjective in the title text segment that is closest to the entity concept.

4. The method of claim 1 , wherein the method further comprises: calculating, through the processing device, a similarity between a first encoding label subtree and a second encoding label subtree of any two encoding label subtrees by:

in accordance with a determination that root nodes of the first encoding label subtree and the second encoding label subtree are not the same, determining, through the processing device, the similarity between the first encoding label subtree and the second encoding label subtree is equal to 0;

in accordance with a determination that the root nodes of the first encoding label subtree and the second encoding label subtree are the same, and that forward traversal results and backward traversal results of the first encoding label subtree and the second encoding label subtree are both the same, determining, through the processing device, the similarity between the first encoding label subtree and the second encoding label subtree is equal to 1;

in accordance with a determination that the root nodes of the first encoding label subtree and the second encoding label subtree are the same, and that the forward traversal results or the backward traversal results of the first encoding label subtree and the second encoding label subtree are not the same, determining, through the processing device, the similarity between the two encoding label subtrees by calculating

s

=

0

.

5

+

0

.

5

×

1

N

⁢

∑

i

=

1

N

S

i

,

 where s represents the similarity between the two encoding label subtrees, N is a number of nodes at a first level in the first encoding label subtree, and S i represents a similarity between a first subtree having the i th node among the first level of nodes of the first encoding label subtree as a root node and a second subtree having the i th node among the first level of nodes of the second encoding label subtree as a root node.

5. An electronic device, comprising:

a storage device with a computer program stored thereon; and

a processing device configured to execute the computer program in the storage device to perform acts comprising:

identifying, through the processing device and by using a web page parser, an entity concept from a title text of the target web page and at least one entity corresponding to the entity concept from a body text of the target web page;

constructing, through the processing device, a syntax parse tree of the title text based on syntax parse rules of a language to which the title text belongs, and determining, from the syntax parse tree, a modifier for modifying the entity concept; and

generating, through the processing device, a knowledge graph based on the entity concept, the modifier, and the at least one entity;

wherein identifying, through the processing device, the at least one entity corresponding to the entity concept from the body text of the target web page comprises:

after obtaining page source code of the target web page, generating, through the processing device, a coding label tree corresponding to the page source code based on encoding labels in the page source code;

determining, from the coding label tree, a plurality of target encoding label subtrees having a similarity greater than a predetermined threshold through the processing device; and

for each of the target encoding label subtrees, determining, through the processing device, the entity from a body text segment corresponding to the target encoding label subtree;

wherein a text pattern of the title text is a top K text pattern, and determining, from the coding label tree, the plurality of target encoding label subtrees having the similarity greater than the predetermined threshold through the processing device, comprises:

determining, through the processing device, a target encoding label node from the coding label tree, the target encoding label node having a number of encoding label subtrees greater than or equal to a predetermined number; and

determining, through the processing device, at least the predetermined number of target encoding label subtrees from encoding label subtrees under the target encoding label node;

wherein the predetermined number is determined by:

determining, from the syntax parse tree, a syntax subtree comprising the entity concept through the processing device; and

determining, from the syntax subtree, a quantifier K corresponding to a cardinal number label through the processing device.

6. The electronic device of claim 5 , wherein identifying, through the processing device and by using the web page parser, the entity concept from the title text of the target web page comprises:

obtaining, by using the web page parser, the page source code of the target web page;

locating, through the processing device, the title text from the page source code based on a title label; and

matching, through the processing device, the entity concept from the title text based on a predetermined set of entity concept words.

7. The electronic device of claim 5 , wherein determining, from the syntax parse tree, the modifier for modifying the entity concept through the processing device comprises:

determining, through the processing device, a title text segment corresponding to the syntax subtree; and

determining, through the processing device, as the modifier an adjective in the title text segment that is closest to the entity concept.

8. The electronic device of claim 5 , wherein the acts further comprise: calculating, through the processing device, a similarity between a first encoding label subtree and a second encoding label subtree of any two encoding label subtrees by:

in accordance with a determination that root nodes of the first encoding label subtree and the second encoding label subtree are not the same, determining, through the processing device, the similarity between the first encoding label subtree and the second encoding label subtree is equal to 0;

in accordance with a determination that the root nodes of the first encoding label subtree and the second encoding label subtree are the same, and that forward traversal results and backward traversal results of the first encoding label subtree and the second encoding label subtree are both the same, determining, through the processing device, the similarity between the first encoding label subtree and the second encoding label subtree is equal to 1;

in accordance with a determination that the root nodes of the first encoding label subtree and the second encoding label subtree are the same, and that the forward traversal results or the backward traversal results of the first encoding label subtree and the second encoding label subtree are not the same, determining, through the processing device, the similarity between the two encoding label subtrees by calculating

s

=

0.5

+

0.5

×

1

N

⁢

∑

i

=

1

N

⁢

S

i

,

 where s represents the similarity between the two encoding label subtrees, N is a number of nodes at a first level in the first encoding label subtree, and S i represents a similarity between a first subtree having the i th node among the first level of nodes of the first encoding label subtree as a root node and a second subtree having the i th node among the first level of nodes of the second encoding label subtree as a root node.

9. A non-transitory computer-readable medium having a computer program stored thereon which, when executed by a processing device, performs acts comprising:

obtaining, through the processing device, a target web page by searching for a keyword or sentence using a search engine;

identifying, through the processing device and by using a web page parser, an entity concept from a title text of the target web page and at least one entity corresponding to the entity concept from a body text of the target web page, wherein the title text and the body text are obtained by invoking page source code of the target web page;

constructing, through the processing device, a syntax parse tree of the title text based on syntax parse rules of a language to which the title text belongs, and determining, from the syntax parse tree, a modifier for modifying the entity concept, through the processing device; and

generating, through the processing device, a knowledge graph based on the entity concept, the modifier, and the at least one entity;

wherein identifying, through the processing device, the at least one entity corresponding to the entity concept from the body text of the target web page comprises:

after obtaining the page source code of the target web page, generating, through the processing device, a coding label tree corresponding to the page source code based on encoding labels in the page source code;

determining, from the coding label tree, a plurality of target encoding label subtrees having a similarity greater than a predetermined threshold through the processing device; and

for each of the target encoding label subtrees, determining, through the processing device, the entity from a body text segment corresponding to the target encoding label subtree;

wherein a text pattern of the title text is a top K text pattern, and determining, from the coding label tree, the plurality of target encoding label subtrees having the similarity greater than the predetermined threshold through the processing device, comprises:

determining, through the processing device, a target encoding label node from the coding label tree, the target encoding label node having a number of encoding label subtrees greater than or equal to a predetermined number; and

determining, through the processing device, at least the predetermined number of target encoding label subtrees from encoding label subtrees under the target encoding label node;

wherein the predetermined number is determined by:

determining, from the syntax parse tree, a syntax subtree comprising the entity concept through the processing device; and

determining, from the syntax subtree, a quantifier K corresponding to a cardinal number label through the processing device.

10. The non-transitory computer-readable medium of claim 9 , wherein identifying, through the processing device and by using the web page parser, the entity concept from the title text of the target web page comprises:

obtaining, by using the web page parser, the page source code of the target web page;

locating, through the processing device, the title text from the page source code based on a title label; and

matching, through the processing device, the entity concept from the title text based on a predetermined set of entity concept words.

11. The non-transitory computer-readable medium of claim 9 , wherein determining, from the syntax parse tree, the modifier for modifying the entity concept through the processing device comprises:

determining, through the processing device, a title text segment corresponding to the syntax subtree; and

determining, through the processing device, as the modifier an adjective in the title text segment that is closest to the entity concept.

12. The non-transitory computer-readable medium of claim 9 , wherein the acts further comprise: calculating, through the processing device, a similarity between a first encoding label subtree and a second encoding label subtree of any two encoding label subtrees by:

in accordance with a determination that root nodes of the first encoding label subtree and the second encoding label subtree are not the same, determining, through the processing device, the similarity between the first encoding label subtree and the second encoding label subtree is equal to 0;

in accordance with a determination that the root nodes of the first encoding label subtree and the second encoding label subtree are the same, and that forward traversal results and backward traversal results of the first encoding label subtree and the second encoding label subtree are both the same, determining, through the processing device, the similarity between the first encoding label subtree and the second encoding label subtree is equal to 1;

in accordance with a determination that the root nodes of the first encoding label subtree and the second encoding label subtree are the same, and that the forward traversal results or the backward traversal results of the first encoding label subtree and the second encoding label subtree are not the same, determining, through the processing device, the similarity between the two encoding label subtrees by calculating

s

=

0.5

+

0.5

×

1

N

⁢

∑

i

=

1

N

⁢

S

i

,

where s represents the similarity between the two encoding label subtrees, N is a number of nodes at a first level in the first encoding label subtree, and S i represents a similarity between a first subtree having the i th node among the first level of nodes of the first encoding label subtree as a root node and a second subtree having the i th node among the first level of nodes of the second encoding label subtree as a root node.

Assignments (2)
ASSIGNMENT OF ASSIGNOR'S INTEREST Recorded Feb 6, 2025
From: XIONG, HONGYU; GAO, YUAN; FENG, YIQI; LIU, BIN
To: BYTEDANCE INC.
Reel/Frame 070124/0467 →
ASSIGNMENT OF ASSIGNOR'S INTEREST Recorded Feb 6, 2025
From: BYTEDANCE INC.
To: LEMON INC.
Reel/Frame 070124/0481 →
Priority Claims (1)
CN 202110939279.X · Aug 16, 2021 · national
Continuity (2)
Continuation PCTSG2022050578 · Aug 15, 2022
Related Publication 20240135196A1 · Apr 25, 2024
References Cited (15)
CN 106156365A · 2016 [cited by applicant]
CN 106484767A · 2017 [cited by applicant]
CN 108694208A · 2018 [cited by applicant]
CN 108376160A · 2018 [cited by applicant]
CN 111177591A · 2020 [cited by applicant]
Zhong, Y., et al, A general method for tree-comparison based on subtree similarity and its use in a taxonomic database, [received on Apr. 20, 2024]. Retrieved from Internet: <https://www.sciencedirect.com/science/articl… [cited by examiner]
Cohen, S., et al, A General Algorithm for Subtree Similarity-Search, [received on Apr. 20, 2024]. Retrieved from Internet: <https://ieeexplore.ieee.org/abstract/document/6816712> (Year: 2014). [cited by examiner]
Xue, Y., et al, Web page title extraction and its application, [received Aug. 6, 2024]. Retrieved from Internet:<https://www.sciencedirect.com/science/article/pii/S0306457306001981> (Year: 2007). [cited by examiner]
Zhao, X., HDSKG: Harvesting Domain Specific Knowledge Graph from Content of Webpages, [received Apr. 20, 2024]. Retrieved from Internet: <https://ieeexplore.ieee.org/abstract/document/7884609> (Year: 2017). [cited by examiner]
Wu, X., et al, The CRFs-Based Chinese Open Entity Relation Extraction, [received on Apr. 20, 2024]. Retrieved from Internet :<https:// ieeexplore.ieee.org/abstract/document/8005508> (Year: 2017). [cited by examiner]
Kim, Y., et al, Web Information Extraction by HTML Tree Edit Distance Matching, [received on Apr. 20, 2024]. Retrieved from Internet :< https://ieeexplore.ieee.org/abstract/document/4420619> (Year: 2007). [cited by examiner]
Kocher, D., et al, A Scalable Index for Top-K Subtree Similarity Queries, [received on Apr. 20, 2024]. Retrieved from Internet: <https://dl.acm.org/doi/abs/10.1145/3299869.3319892 (Year: 2019). [cited by examiner]
International Search Report (with English translation) and Written Opinion issued in PCT/SG2022/050578, dated Feb. 28, 2023, 12 pages provided. [cited by applicant]
Office Action issued in corresponding Chinese Application No. 202110939279.X, dated Apr. 19, 2023, with English machine translation. [cited by applicant]
Peilu Wang, Knowledge Graph Construction and Applications for Web Search and Beyond, Data Intelligence, dated Nov. 1, 2019, pp. 333-349. [cited by applicant]
Cited By (1)
US 12,475,607