# US 2021/0174024 A1 · Method for training keyword extraction model, keyword extraction method, and computer device

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

- Number: US 2021/0174024 A1
- Document ID: US20210174024A1
- Status: Published application
- Kind: A1
- Application number: 17/183,218
- Filed: 2021-02-23
- Published: 2021-06-10
- Earliest claimed: 2018-12-07
- Assignees: Tencent Technology (Shenzhen) Company Limited
- Applicants: Tencent Technology (Shenzhen) Company Limited
- Inventors: Wenhao ZHENG; Lie KANG; Qiang YAN
- Web page: https://patentgrep.com/patent/US20210174024A1

## CPC

- G06F 40/289: Phrasal analysis, e.g. finite state techniques or chunking
- G06F 40/284: Lexical analysis, e.g. tokenisation or collocates
- G06F 40/30: Semantic analysis
- G06V 30/414: Extracting the geometrical structure, e.g. layout tree; Block segmentation, e.g. bounding boxes for graphics or text
- G06F: ELECTRIC DIGITAL DATA PROCESSING (computer systems based on specific computational models G06N)
- G06V: IMAGE OR VIDEO RECOGNITION OR UNDERSTANDING

## Abstract

This application provides a keyword extraction method. The method includes: receiving an information entity including a title and a text; performing word segmentation on the text, to obtain a plurality of candidate words; and performing character segmentation on the title corresponding to semantics of the text, to obtain a plurality of characters; sequentially inputting the plurality of candidate words to a keyword extraction model, to obtain an attention weight of each candidate word relative to each character; selecting, from the plurality of candidate words, a candidate word that appears in the title; determining an extraction threshold according to an attention weight of the selected candidate word relative to each character; and determining a keyword of the text of the information entity from the candidate words according to the extraction threshold. This application further provide a method for training a keyword extraction model, a computer device, and a storage medium.

## Claims

### Claim 1

A keyword extraction method performed at a computer device, the method comprising:
receiving an information entity, the information entity including a title and a text;
performing word segmentation on the text, to obtain a plurality of candidate words;
performing character segmentation on the title corresponding to semantics of the text, to obtain a plurality of characters;
sequentially inputting the plurality of candidate words to a keyword extraction model, to obtain an attention weight of each candidate word relative to each of the plurality of characters, the attention weight being used for representing a degree of semantic association between the candidate word and the character;
selecting, from the plurality of candidate words, a candidate word that appears in the title;
determining an extraction threshold according to an attention weight of the selected candidate word relative to each of the plurality of characters; and
determining a keyword of the text of the information entity from the candidate words according to the extraction threshold.

### Claim 2 (depends on 1)

The method according to claim 1, wherein the sequentially inputting the plurality of candidate words to a keyword extraction model comprises:
determining, for each candidate word, position information of the candidate word in a preset word list, and obtaining a word vector of the candidate word according to the position information of the candidate word; and
sequentially inputting word vectors of the plurality of candidate words to the keyword extraction model.

### Claim 3 (depends on 1)

The method according to claim 1, wherein the determining an extraction threshold according to an attention weight of the selected candidate word relative to each of the plurality of characters comprises:
determining, for each selected candidate word, a weight corresponding to the candidate word according to the attention weight of the candidate word relative to each of the plurality of characters; and
determining the extraction threshold according to the weight corresponding to the selected candidate word.

### Claim 4 (depends on 3)

The method according to claim 3, wherein the determining, for each selected candidate word, a weight corresponding to the candidate word according to the attention weight of the candidate word relative to each of the plurality of characters comprises:
determining, for the selected candidate word, a maximum attention weight among the attention weights of the plurality of candidate words relative to the plurality of characters as the weight corresponding to the selected candidate word.

### Claim 5 (depends on 3)

The method according to claim 3, wherein the determining, for each selected candidate word, a weight corresponding to the candidate word according to the attention weight of the candidate word relative to each of the plurality of characters comprises:
determining, for the selected candidate word, an average value of the attention weights of the plurality of candidate words relative to the plurality of characters as the weight corresponding to the selected candidate word.

### Claim 6 (depends on 3)

The method according to claim 3, wherein the determining the extraction threshold according to the weight corresponding to the selected candidate word comprises:
determining the extraction threshold according to a maximum weight among the weights corresponding to the selected candidate words.

### Claim 7 (depends on 3)

The method according to claim 3, wherein the determining a keyword of the text of the information entity from the candidate words according to the extraction threshold comprises:
determining, for each candidate word, when the weight corresponding to the candidate word is greater than the extraction threshold, the candidate word as the keyword of the text of the information entity.

### Claim 8 (depends on 1)

The method according to claim 1, wherein no keyword of the text of the information entity exists when none of the plurality of candidate words appear in the title.

### Claim 9

A computer device, comprising one or more processors and one or more memories, the one or more memories storing at least one piece of program code, the at least one piece of program code being loaded and executed by the one or more processors to perform a plurality of operations including:
receiving an information entity, the information entity including a title and a text;
performing word segmentation on the text, to obtain a plurality of candidate words;
performing character segmentation on the title corresponding to semantics of the text, to obtain a plurality of characters;
sequentially inputting the plurality of candidate words to a keyword extraction model, to obtain an attention weight of each candidate word relative to each of the plurality of characters, the attention weight being used for representing a degree of semantic association between the candidate word and the character;
selecting, from the plurality of candidate words, a candidate word that appears in the title;
determining an extraction threshold according to an attention weight of the selected candidate word relative to each of the plurality of characters; and
determining a keyword of the text of the information entity from the candidate words according to the extraction threshold.

### Claim 10 (depends on 9)

The computer device according to claim 9, wherein the sequentially inputting the plurality of candidate words to a keyword extraction model comprises:
determining, for each candidate word, position information of the candidate word in a preset word list, and obtaining a word vector of the candidate word according to the position information of the candidate word; and
sequentially inputting word vectors of the plurality of candidate words to the keyword extraction model.

### Claim 11 (depends on 9)

The computer device according to claim 9, wherein the determining an extraction threshold according to an attention weight of the selected candidate word relative to each of the plurality of characters comprises:
determining, for each selected candidate word, a weight corresponding to the candidate word according to the attention weight of the candidate word relative to each of the plurality of characters; and
determining the extraction threshold according to the weight corresponding to the selected candidate word.

### Claim 12 (depends on 11)

The computer device according to claim 11, wherein the determining, for each selected candidate word, a weight corresponding to the candidate word according to the attention weight of the candidate word relative to each of the plurality of characters comprises:
determining, for the selected candidate word, a maximum attention weight among the attention weights of the plurality of candidate words relative to the plurality of characters as the weight corresponding to the selected candidate word.

### Claim 13 (depends on 11)

The computer device according to claim 11, wherein the determining, for each selected candidate word, a weight corresponding to the candidate word according to the attention weight of the candidate word relative to each of the plurality of characters comprises:
determining, for the selected candidate word, an average value of the attention weights of the plurality of candidate words relative to the plurality of characters as the weight corresponding to the selected candidate w.

### Claim 14 (depends on 11)

The computer device according to claim 11, wherein the determining the extraction threshold according to the weight corresponding to the selected candidate word comprises:
determining the extraction threshold according to a maximum weight among the weights corresponding to the selected candidate words.

### Claim 15 (depends on 9)

The computer device according to claim 9, wherein the keyword extraction model comprises an encoding model and a decoding model, and the one or more processors are configured to perform the following operations:
performing word segmentation on a training text of a training information entity, to obtain a plurality of candidate words;
performing character segmentation on a training title of the training information entity corresponding to semantics of the training text, to obtain a plurality of characters;
sequentially inputting the plurality of candidate words to the encoding model, to obtain a text feature representation of each candidate word;
adjusting the text feature representation of each candidate word according to an attention weight of the candidate word;
obtaining a text feature representation of the training text according to the adjusted text feature representation of the plurality of candidate words;
inputting the text feature representation of the training text and the plurality of characters obtained by character segmentation to the decoding model, to obtain a plurality of target characters; and
comparing the plurality of characters obtained by character segmentation and the plurality of target characters, and respectively adjusting an attention weight corresponding to the text feature representation of the candidate word according to a comparison result.

### Claim 16

A non-transitory computer-readable storage medium, storing computer-readable instructions that, when executed by a processor of a computer device, cause the computer device to perform a plurality of operations including:
receiving an information entity, the information entity including a title and a text;
performing word segmentation on the text, to obtain a plurality of candidate words;
performing character segmentation on the title corresponding to semantics of the text, to obtain a plurality of characters;
sequentially inputting the plurality of candidate words to a keyword extraction model, to obtain an attention weight of each candidate word relative to each of the plurality of characters, the attention weight being used for representing a degree of semantic association between the candidate word and the character;
selecting, from the plurality of candidate words, a candidate word that appears in the title;
determining an extraction threshold according to an attention weight of the selected candidate word relative to each of the plurality of characters; and
determining a keyword of the text of the information entity from the candidate words according to the extraction threshold.

### Claim 17 (depends on 16)

The non-transitory computer-readable storage medium according to claim 16, wherein the sequentially inputting the plurality of candidate words to a keyword extraction model comprises:
determining, for each candidate word, position information of the candidate word in a preset word list, and obtaining a word vector of the candidate word according to the position information of the candidate word; and
sequentially inputting word vectors of the plurality of candidate words to the keyword extraction model.

### Claim 18 (depends on 16)

The non-transitory computer-readable storage medium according to claim 16, wherein the determining an extraction threshold according to an attention weight of the selected candidate word relative to each of the plurality of characters comprises:
determining, for each selected candidate word, a weight corresponding to the candidate word according to the attention weight of the candidate word relative to each of the plurality of characters; and
determining the extraction threshold according to the weight corresponding to the selected candidate word.

### Claim 19 (depends on 18)

The non-transitory computer-readable storage medium according to claim 18, wherein the determining, for each selected candidate word, a weight corresponding to the candidate word according to the attention weight of the candidate word relative to each of the plurality of characters comprises:
determining, for the selected candidate word, a maximum attention weight among the attention weights of the plurality of candidate words relative to the plurality of characters as the weight corresponding to the selected candidate word.

### Claim 20 (depends on 18)

The non-transitory computer-readable storage medium according to claim 18, wherein the determining, for each selected candidate word, a weight corresponding to the candidate word according to the attention weight of the candidate word relative to each of the plurality of characters comprises:
determining, for the selected candidate word, an average value of the attention weights of the plurality of candidate words relative to the plurality of characters as the weight corresponding to the selected candidate w.
