# US 2020/0004766 A1 · Method, apparatus and electronic device for determining knowledge sample data set

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

- Number: US 2020/0004766 A1
- Document ID: US20200004766A1
- Status: Published application
- Kind: A1
- Application number: 16/362,584
- Filed: 2019-03-22
- Published: 2020-01-02
- Earliest claimed: 2018-06-29
- Assignees: Beijing Baidu Netcom Science Technology Co., Ltd.
- Applicants: Beijing Baidu Netcom Science Technology Co., Ltd.
- Inventors: SHUANGJIE LI; YABING SHI; HAIJIN LIANG; YANG ZHANG; YONG ZHU
- Web page: https://patentgrep.com/patent/US20200004766A1

## CPC

- G06F 16/335: Filtering based on additional data, e.g. user or group profiles (filtering in web context G06F16/9535, G06F16/9536)
- G06N 5/022: Knowledge engineering; Knowledge acquisition
- G06F 40/289: Phrasal analysis, e.g. finite state techniques or chunking
- G06F 40/30: Semantic analysis
- G06N 20/00: Machine learning
- G06F: ELECTRIC DIGITAL DATA PROCESSING (computer systems based on specific computational models G06N)
- G06N: COMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS

## Abstract

Provided are a method, an apparatus and an electronic device for determining a knowledge sample data set, the method includes: acquiring a preset number of SPO triplet formats and source texts; acquiring, according to the SPO triplet formats, n SPO entries corresponding to the SPO triplet formats; searching, in the source texts, m first texts that match the n SPO entries, and generating a first knowledge sample data set; determining k second texts that meet the SPO triplet formats from the m first texts and generating a second knowledge sample data set; generating a target knowledge sample data set according to the first knowledge sample data set and the second knowledge sample data set. In the embodiments, the knowledge sample data set is automatically generated, the volume generation speed is fast, the cost is low, and the data size that can be produced is large, thus meeting the training requirement.

## Claims

### Claim 1

A method for determining a knowledge sample data set, comprising:
acquiring a preset number of subject-predicate-object (SPO) triplet formats and source texts;
acquiring, according to the SPO triplet formats, n SPO entries corresponding to the SPO triplet formats;
searching, in the source texts, m first texts that match the n SPO entries, and generating a first knowledge sample data set, wherein each sample in the first knowledge sample data set comprises a four-tuple composed of S, P, O and a first text;
determining k second texts that meet the SPO triplet formats from the m first texts, and generating a second knowledge sample data set, wherein each sample in the second knowledge sample data set comprises a four-tuple composed of S, P, O, and a second text;
generating a target knowledge sample data set according to the first knowledge sample data set and the second knowledge sample data set.

### Claim 2 (depends on 1)

The method according to claim 1, wherein before the generating a target knowledge sample data set according to the first knowledge sample data set and the second knowledge sample data set, the method further comprises:
taking samples with the same P, and with the same S or the same O in the first knowledge sample data set and the second knowledge sample data set as a group of samples;
acquiring parallel words of elements with different element values in each group of samples;
supplementing the parallel words to an SPO triplet of the corresponding group of samples and generating a third knowledge sample data set;
wherein the generating a target knowledge sample data set according to the first knowledge sample data set and the second knowledge sample data set comprises:
generating the target knowledge sample data set according to the first knowledge sample data set, the second knowledge sample data set, and the third knowledge sample data set.

### Claim 3 (depends on 1)

The method according to claim 1, wherein before the searching, in the source texts, m first texts that match the n SPO entries, the method comprises:
for each source file, dividing the source text and generating a first candidate sentence text set;
performing a filtering process on the first candidate sentence text set and generating a second candidate sentence text set;
wherein the searching, in the source texts, m first texts that match the n SPO entries comprises:
for each source file, searching, in the second candidate sentence text set, a first text that matches the n SPO entries.

### Claim 4 (depends on 3)

The method according to claim 3, wherein the performing a filtering process on the first candidate sentence text set and generating a second candidate sentence text set comprises:
filtering first candidate sentence texts whose lengths satisfy a preset range in the first candidate sentence text set and generating the second candidate sentence text set.

### Claim 5 (depends on 1)

The method according to claim 1, wherein after the generating a target knowledge sample data set, the method further comprises:
performing a right-or-wrong check on each sample in the target knowledge sample data set, and deleting a wrong sample from the target knowledge sample data set.

### Claim 6 (depends on 5)

The method according to claim 5, wherein the performing a right-or-wrong check on each sample in the target knowledge sample data set comprises:
converting each sample in the target knowledge sample data set into a preset format, and performing a right-or-wrong check on each sample in the target knowledge sample data set in the preset format, and deleting a wrong sample from the target knowledge sample data set.

### Claim 7

An apparatus for determining a knowledge sample data set, comprising a processor and a memory having executable instructions stored thereon that when executed by the processor cause the processor to:
acquire a preset number of subject-predicate-object (SPO) triplet formats and source texts;
acquire, according to the SPO triplet formats, n SPO entries corresponding to the SPO triplet formats;
search, in the source texts, m first texts that match the n SPO entries, and generate a first knowledge sample data set, wherein each sample in the first knowledge sample data set comprises a four-tuple composed of S, P, O and a first text;
determine k second texts that meet the SPO triplet formats from the m first texts and generate a second knowledge sample data set, wherein each sample in the second knowledge sample data set comprises a four-tuple composed of S, P, O, and a second text;
generate a target knowledge sample data set according to the first knowledge sample data set and the second knowledge sample data set.

### Claim 8 (depends on 7)

The apparatus according to claim 7, wherein the processor is further configured to:
take samples with the same P, and with the same S or the same O in the first knowledge sample data set and the second knowledge sample data set as a group of samples;
acquire parallel words of elements with different element values in each group of samples;
supplement the parallel words to an SPO triplet of the corresponding group of samples and generate a third knowledge sample data set;
generate the target knowledge sample data set according to the first knowledge sample data set, the second knowledge sample data set, and the third knowledge sample data set.

### Claim 9 (depends on 7)

The apparatus according to claim 7, wherein the processor is configured to:
divide the source text for each source file and generate a first candidate sentence text set;
perform a filtering process on the first candidate sentence text set and generate a second candidate sentence text set;
for each source file, search, in the second candidate sentence text set, a first text that matches the n SPO entries.

### Claim 10 (depends on 9)

The apparatus according to claim 9, wherein:
the processor is configured to filter first candidate sentence texts whose lengths satisfy a preset range in the first candidate sentence text set and generate the second candidate sentence text set.

### Claim 11 (depends on 7)

The apparatus according to claim 7, wherein the processor is further configured to:
perform a right-or-wrong check on each sample in the target knowledge sample data set, and delete a wrong sample from the target knowledge sample data set.

### Claim 12 (depends on 11)

The apparatus according to claim 11, wherein:
the processor is configured to convert each sample in the target knowledge sample data set into a preset format, and perform a right-or-wrong check on each sample in the target knowledge sample data set in the preset format and delete a wrong sample from the target knowledge sample data set.

### Claim 13

A non-volatile computer storage medium, wherein the non-volatile storage medium stores a computer program, the computer program, when executed, implements:
acquiring a preset number of subject-predicate-object (SPO) triplet formats and source texts;
acquiring, according to the SPO triplet formats, n SPO entries corresponding to the SPO triplet formats;
searching, in the source texts, m first texts that match the n SPO entries, and generating a first knowledge sample data set, wherein each sample in the first knowledge sample data set comprises a four-tuple composed of S, P, O and a first text;
determining k second texts that meet the SPO triplet formats from the m first texts, and generating a second knowledge sample data set, wherein each sample in the second knowledge sample data set comprises a four-tuple composed of S, P, O, and a second text;
generating a target knowledge sample data set according to the first knowledge sample data set and the second knowledge sample data set.

### Claim 14 (depends on 13)

The non-volatile computer storage medium according to claim 13, wherein the computer program, when executed, further implements:
taking samples with the same P, and with the same S or the same O in the first knowledge sample data set and the second knowledge sample data set as a group of samples;
acquiring parallel words of elements with different element values in each group of samples;
supplementing the parallel words to an SPO triplet of the corresponding group of samples and generating a third knowledge sample data set;
wherein the generating a target knowledge sample data set according to the first knowledge sample data set and the second knowledge sample data set comprises:
generating the target knowledge sample data set according to the first knowledge sample data set, the second knowledge sample data set, and the third knowledge sample data set.

### Claim 15 (depends on 13)

The non-volatile computer storage medium according to claim 13, wherein the computer program, when executed, further implements:
for each source file, dividing the source text and generating a first candidate sentence text set;
performing a filtering process on the first candidate sentence text set and generating a second candidate sentence text set;
wherein the searching, in the source texts, m first texts that match the n SPO entries comprises:
for each source file, searching, in the second candidate sentence text set, a first text that matches the n SPO entries.

### Claim 16 (depends on 15)

The non-volatile computer storage medium according to claim 15, wherein the computer program, when executed, further implements:
filtering first candidate sentence texts whose lengths satisfy a preset range in the first candidate sentence text set and generating the second candidate sentence text set.

### Claim 17 (depends on 13)

The non-volatile computer storage medium according to claim 13, wherein the computer program, when executed, further implements:
performing a right-or-wrong check on each sample in the target knowledge sample data set, and deleting a wrong sample from the target knowledge sample data set.

### Claim 18 (depends on 17)

The non-volatile computer storage medium according to claim 17, wherein the computer program, when executed, further implements:
converting each sample in the target knowledge sample data set into a preset format, and performing a right-or-wrong check on each sample in the target knowledge sample data set in the preset format, and deleting a wrong sample from the target knowledge sample data set.
