# US 2023/0267282 A1 · Poetry generation

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

- Number: US 2023/0267282 A1
- Document ID: US20230267282A1
- Status: Published application
- Kind: A1
- Application number: 18/140,500
- Filed: 2023-04-27
- Published: 2023-08-24
- Earliest claimed: 2021-01-29
- Assignees: Beijing Sogou Technology Development Co., Ltd.
- Applicants: Beijing Sogou Technology Development Co., Ltd.
- Inventors: Baokui GUO; Qi KANG
- Web page: https://patentgrep.com/patent/US20230267282A1

## CPC

- G06F 40/40: Processing or translation of natural language (natural language analysis G06F40/20; semantic analysis G06F40/30)
- G06F 40/44: Statistical methods, e.g. probability models
- G06F 40/103: Formatting, i.e. changing of presentation of documents (automatic justification G06F40/189; automatic line break hyphenation G06F40/191)
- G06F 40/56: Natural language generation
- G06N 3/08: Learning methods
- G06N 3/0895: Weakly supervised learning, e.g. semi-supervised or self-supervised learning
- G06N 3/09: Supervised learning
- G06N 3/04: Architecture, e.g. interconnection topology
- G06F: ELECTRIC DIGITAL DATA PROCESSING (computer systems based on specific computational models G06N)
- G06N: COMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS

## Abstract

A method for poetry generation includes receiving generation information indicative of a theme for the poetry generation, and determining at least a candidate piece of poetry corresponding to the generation information according to an autoregressive language model that is configured to generate elements in the candidate piece of poetry in an autoregressive manner with a plurality of regression rounds. An element in the elements is a character or a word. The autoregressive language model is configured for generating poetry in a plurality of formats, the autoregressive language model includes a plurality of processing layers connected sequentially, a processing layer in the plurality of processing layers is configured to determine attention levels for potential elements in a potential element list according to generated elements prior to a current regression round, and predict one or more additional element for the current regression round using a neural network according to the attention levels.

## Claims

### Claim 1

A method for poetry generation, the method comprising:
receiving generation information indicative of a theme for the poetry generation; and
determining, by processing circuitry, at least a candidate piece of poetry corresponding to the generation information according to an autoregressive language model, the autoregressive language model being configured to generate elements in the candidate piece of poetry in an autoregressive manner with a plurality of regression rounds, an element in the elements being a character or a word, wherein:
the autoregressive language model is configured to generate poetry in a plurality of formats, the autoregressive language model including a plurality of processing layers connected sequentially,
a processing layer in the plurality of processing layers is configured to determine attention levels for potential elements in a potential element list according to generated elements prior to a current regression round, and predict one or more additional elements for the current regression round using a neural network according to the attention levels.

### Claim 2 (depends on 1)

The method according to claim 1, wherein the generation information comprises:
a beginning element for the poetry generation ; and/or
the theme for the poetry generation.

### Claim 3 (depends on 1)

The method according to claim 1, wherein the autoregressive language model is trained based on a poetry corpus, the poetry corpus comprises:
one or more sample pieces of poetry; and/or
one or more sample pieces of poetry with respective themes.

### Claim 4 (depends on 1)

The method according to claim 1, wherein the autoregressive language model is configured to generate a plurality of candidate pieces of poetry conforming to the plurality of formats.

### Claim 5 (depends on 1)

The method according to claim 1, further comprising:
providing at least a first option of a format parameter and a second option of the format parameter;
determining a target format according to a selection from at least the first option and the second option by a user; and
determining the at least the candidate piece of poetry in the target format based on the autoregressive language model.

### Claim 6 (depends on 1)

The method according to claim 1, wherein the determining the at least the candidate piece of poetry further comprises:
determining a first candidate piece of poetry and a second candidate piece of poetry corresponding to the generation information according to the autoregressive language model, the first candidate piece of poetry being in a first format and the second candidate piece being in a second format.

### Claim 7 (depends on 1)

The method according to claim 1, wherein the determining the at least the candidate piece of poetry comprises:
determining first inputs for the current regression round according to the generated elements prior to the current regression round; and
inputting the first inputs into the autoregressive language model to obtain a first prediction result of the current regression round from the autoregressive language model.

### Claim 8 (depends on 7)

The method according to claim 7, wherein the determining the at least the candidate piece of poetry further comprises:
adding the first prediction result of the current regression round with the first inputs to obtain second inputs for a next regression round after the current regression round; and
inputting the second inputs into the autoregressive language model to obtain a second prediction result of the next regression round from the autoregressive language model.

### Claim 9 (depends on 7)

The method according to claim 7, wherein the first prediction result comprises at least one predicted element with an attention level satisfying a preset condition.

### Claim 10 (depends on 7)

The method according to claim 7, further comprising:
ranking the potential elements in an order according to the attention levels; and
selecting one or more top ranking potential elements according to the order as the first prediction result.

### Claim 11

An apparatus for poetry generation, comprising processing circuitry configured to:
receive generation information indicative of a theme for the poetry generation; and
determine at least a candidate piece of poetry corresponding to the generation information according to an autoregressive language model, the autoregressive language model being configured to generate elements in the candidate piece of poetry in an autoregressive manner with a plurality of regression rounds, an element in the elements being a character or a word, wherein:
the autoregressive language model is configured to generate poetry in a plurality of formats, the autoregressive language model includes a plurality of processing layers connected sequentially, a processing layer in the plurality of processing layers is configured to determine attention levels for potential elements in a potential element list according to generated elements prior to a current regression round, and predict one or more additional elements for the current regression round using a neural network according to the attention levels.

### Claim 12 (depends on 11)

The apparatus according to claim 11, wherein the generation information comprises:
a beginning element for the poetry generation; and/or
the theme for the poetry generation.

### Claim 13 (depends on 11)

The apparatus according to claim 11, wherein the autoregressive language model is trained based on a poetry corpus, the poetry corpus comprises:
one or more sample pieces of poetry; and/or
one or more sample pieces of poetry with respective themes.

### Claim 14 (depends on 11)

The apparatus according to claim 11, wherein the autoregressive language model is configured to generate a plurality of candidate pieces of poetry conforming to the plurality of formats.

### Claim 15 (depends on 11)

The apparatus according to claim 11, wherein the processing circuitry is configured to:
provide at least a first option of a format parameter and a second option of the format parameter;
determine a target format according to a selection from at least the first option and the second option by a user; and
determine the at least the candidate piece of poetry in the target format based on the autoregressive language model.

### Claim 16 (depends on 11)

The apparatus according to claim 11, wherein the processing circuitry is configured to:
determine a first candidate piece of poetry and a second candidate piece of poetry corresponding to the generation information according to the autoregressive language model, the first candidate piece of poetry being in a first format and the second candidate piece being in a second format.

### Claim 17 (depends on 11)

The apparatus according to claim 11, wherein the processing circuitry is configured to:
determine first inputs for the current regression round according to the generated elements prior to the current regression round; and
input the first inputs into the autoregressive language model to obtain a first prediction result of the current regression round from the autoregressive language model.

### Claim 18 (depends on 17)

The apparatus according to claim 17, wherein the processing circuitry is configured to:
add the first prediction result of the current regression round with the first inputs to obtain second inputs for a next regression round after the current regression round; and
input the second inputs into the autoregressive language model to obtain a second prediction result of the next regression round from the autoregressive language model.

### Claim 19 (depends on 17)

The apparatus according to claim 17, wherein the first prediction result comprises at least one predicted element with an attention level satisfying a preset condition.

### Claim 20 (depends on 17)

The apparatus according to claim 17, wherein the processing circuitry is configured to:
rank the potential elements in an order according to the attention levels; and
select one or more top ranking potential elements according to the order as the first prediction result.
