IP Library Granted Patent US 12,493,744
Granted Patent B2
US 12,493,744 · App. 17/667,320 · Granted Dec 9, 2025

Context-based keyphrase extraction from input text

Inventors: Yingrui Yang (San Mateo, CA); Yen-Yun Yu (Murray, UT)
Assignee: Ancestry.com Operations Inc.
G06F40/289G06F40/284G06F40/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 12,493,744
App. No.
17/667,320
Granted
Dec 9, 2025
Kind
B2
Abstract

Described herein are systems, methods, and other techniques for extracting one or more keyphrases from an input text. The input text may include a plurality of words. A plurality of token-level attention matrices may be generated using a transformer-based machine learning model. The plurality of token-level attention matrices may be converted into a plurality of word-level attention matrices. A set of candidate phrases may be identified from the plurality of words based on the plurality of word-level attention matrices. The one or more keyphrases may be selected from the set of candidate phrases.

Claims (63)

1 . A computer-implemented method for extracting one or more keyphrases from an input text, the computer-implemented method comprising:

receiving the input text having a plurality of words;

providing the plurality of words to a transformer-based machine learning model;

generating, using the transformer-based machine learning model, a plurality of token-level attention matrices that indicate token-level context-based relationship values between tokens in the plurality of words;

converting the plurality of token-level attention matrices into a plurality of word-level attention matrices that indicate word-level context-based relationship values between the plurality of words;

identifying, according to the word-level context-based relationship values defined by the plurality of word-level attention matrices, a set of candidate phrases from the plurality of words, wherein each of the set of candidate phrases includes one or more words from the plurality of words; and

selecting the one or more keyphrases from the set of candidate phrases by:

sorting the set of candidate phrases according to first token positions within the set of candidate phrases;

determining, based on sorting the set of candidate phrases, an amount of candidate phrase overlap between a first candidate phrase and a second candidate phrase among the set of candidate phrases; and

generating a keyphrase score by combining a first score for the first candidate phrase with a second score for the second candidate phrase according to the amount of candidate phrase overlap.

2 . The computer-implemented method of claim 1 , further comprising:

generating a plurality of clusters based on the plurality of word-level attention matrices, wherein each of the plurality of clusters is generated based on the word-level context-based relationship values, and wherein the set of candidate phrases are identified based on the plurality of clusters.

3 . The computer-implemented method of claim 2 , wherein the plurality of clusters are generated by determining which of the word-level context-based relationship values are greater than a threshold.

4 . The computer-implemented method of claim 1 , further comprising:

preprocessing the input text by dividing the plurality of words into a plurality of segments, wherein each of the plurality of segments is separately provided to the transformer-based machine learning model.

5 . The computer-implemented method of claim 1 , wherein the transformer-based machine learning model includes a plurality of heads, wherein each of the plurality of heads (i) includes a set of attention weights and (ii) generates one of the plurality of token-level attention matrices.

6 . The computer-implemented method of claim 1 , further comprising:

determining that the amount of candidate phrase overlap satisfies an overlap threshold; and

combining the first candidate phrase and the second candidate phrase based on determining that the amount of candidate phrase overlap satisfies the overlap threshold.

7 . The computer-implemented method of claim 1 , further comprising:

utilizing a duplicate detector to detect that a third candidate phrase is a duplicate of the first candidate phrase; and

based on detecting that the third candidate phrase is a duplicate of the first candidate phrase:

increasing the keyphrase score associated with the first candidate phrase; and

removing the third candidate phrase from the set of candidate phrases.

8 . A non-transitory computer-readable medium comprising instructions that, when executed by one or more processors, cause the one or more processors to perform operations comprising:

receiving an input text having a plurality of words;

providing the plurality of words to a transformer-based machine learning model;

generating, using the transformer-based machine learning model, a plurality of token-level attention matrices that indicate token-level context-based relationship values between tokens in the plurality of words;

converting the plurality of token-level attention matrices into a plurality of word-level attention matrices that indicate word-level context-based relationship values between the plurality of words;

identifying, according to the word-level context-based relationship values defined by the plurality of word-level attention matrices, a set of candidate phrases from the plurality of words, wherein each of the set of candidate phrases includes one or more words from the plurality of words; and

selecting one or more keyphrases from the set of candidate phrases by:

sorting the set of candidate phrases according to first token positions within the set of candidate phrases;

determining, based on sorting the set of candidate phrases, an amount of candidate phrase overlap between a first candidate phrase and a second candidate phrase among the set of candidate phrases; and

generating a keyphrase score by combining a first score for the first candidate phrase with a second score for the second candidate phrase according to the amount of candidate phrase overlap.

9 . The non-transitory computer-readable medium of claim 8 , wherein the operations further comprise:

generating a plurality of clusters based on the plurality of word-level attention matrices, wherein each of the plurality of clusters is generated based on the word-level context-based relationship values, and wherein the set of candidate phrases are identified based on the plurality of clusters.

10 . The non-transitory computer-readable medium of claim 9 , wherein the plurality of clusters are generated by determining which of the word-level context-based relationship values are greater than a threshold.

11 . The non-transitory computer-readable medium of claim 8 , further comprising:

preprocessing the input text by dividing the plurality of words into a plurality of segments, wherein each of the plurality of segments is separately provided to the transformer-based machine learning model.

12 . The non-transitory computer-readable medium of claim 8 , wherein the transformer-based machine learning model includes a plurality of heads, wherein each of the plurality of heads (i) includes a set of attention weights and (ii) generates one of the plurality of token-level attention matrices.

13 . The non-transitory computer-readable medium of claim 8 , wherein the transformer-based machine learning model is a Bidirectional Encoder Representations from Transformers (BERT) model.

14 . The non-transitory computer-readable medium of claim 8 , wherein selecting the one or more keyphrases from the set of candidate phrases includes:

determining a set of scores for the set of candidate phrases based on the word-level context-based relationship values between the plurality of words.

15 . A system comprising,

one or more processors; and

a non-transitory computer-readable medium comprising instructions that, when executed by the one or more processors, cause the one or more processors to perform operations comprising:

receiving an input text having a plurality of words;

providing the plurality of words to a transformer-based machine learning model;

generating, using the transformer-based machine learning model, a plurality of token-level attention matrices that indicate token-level context-based relationship values between tokens in the plurality of words;

converting the plurality of token-level attention matrices into a plurality of word-level attention matrices that indicate word-level context-based relationship values between the plurality of words;

identifying, according to the word-level context-based relationship values defined by the plurality of word-level attention matrices, a set of candidate phrases from the plurality of words, wherein each of the set of candidate phrases includes one or more words from the plurality of words; and

selecting one or more keyphrases from the set of candidate phrases by:

sorting the set of candidate phrases according to first token positions within the set of candidate phrases;

determining, based on sorting the set of candidate phrases, an amount of candidate phrase overlap between a first candidate phrase and a second candidate phrase among the set of candidate phrases; and

generating a keyphrase score by combining a first score for the first candidate phrase with a second score for the second candidate phrase according to the amount of candidate phrase overlap.

16 . The system of claim 15 , wherein the operations further comprise:

generating a plurality of clusters based on the plurality of word-level attention matrices, wherein each of the plurality of clusters is generated based on the word-level context-based relationship values, and wherein the set of candidate phrases are identified based on the plurality of clusters.

17 . The system of claim 16 , wherein the plurality of clusters are generated by determining which of the word-level context-based relationship values are greater than a threshold.

18 . The system of claim 15 , further comprising:

preprocessing the input text by dividing the plurality of words into a plurality of segments, wherein each of the plurality of segments is separately provided to the transformer-based machine learning model.

19 . The system of claim 15 , wherein the transformer-based machine learning model includes a plurality of heads, wherein each of the plurality of heads (i) includes a set of attention weights and (ii) generates one of the plurality of token-level attention matrices.

20 . The system of claim 15 , wherein selecting the one or more keyphrases from the set of candidate phrases includes:

determining a set of scores for the set of candidate phrases based on the word-level context-based relationship values between the plurality of words.

Assignments (1)
ASSIGNMENT OF ASSIGNOR'S INTEREST Recorded Feb 14, 2022
From: YANG, YINGRUI; YU, YEN-YUN
To: ANCESTRY.COM OPERATIONS INC.
Reel/Frame 059006/0375 →
Continuity (2)
Provisional Application 63147494 · Feb 9, 2021
Related Publication 20220253604A1 · Aug 11, 2022
References Cited (9)
US 11650986B1 · Agbemabiese · 2023 [cited by examiner]
US 20160342589A1 · Brugger · 2016 [cited by examiner]
US 20190266250A1 · Toplyn · 2019 [cited by examiner]
US 20200394364A1 · Venkateshwaran · 2020 [cited by examiner]
US 20210081613A1 · Begun · 2021 [cited by examiner]
US 20210319188A1 · Zhou · 2021 [cited by examiner]
US 20220138432A1 · Galitsky · 2022 [cited by examiner]
What Does BERT Look At ?; Clark et al (Year: 2019). [cited by examiner]
TDAM: A topic-dependent attention model for sentiment analysis; Pergola et al (Year: 2018). [cited by examiner]