Method and apparatus for generating a text, and storage medium

US2022138435A1 · US · A1

Patent metadata
FieldValue
Publication numberUS-2022138435-A1
Application numberUS-202217572930-A
CountryUS
Kind codeA1
Filing dateJan 11, 2022
Priority dateJun 30, 2021
Publication dateMay 5, 2022
Grant date

How to read this patent

A practical reading order for non-experts. Skip the full description unless you need deep technical detail.

  1. Title

    What the patent document calls the invention.

  2. Abstract

    A short plain-language summary of the technical disclosure.

  3. Assignees and inventors

    Who owns or filed the patent and who is credited as inventor.

  4. Key dates

    Filing, priority, publication, and grant dates set the timeline.

  5. First independent claim

    The legal scope of protection — read this for what is actually claimed.

  6. CPC / IPC classifications

    Technology tags used to group this patent with similar filings.

  7. Citations and related patents

    Prior art links and similar publications in this corpus.

Abstract

Official abstract text for this publication.

The disclosure provides a method for generating a text. The method includes: obtaining a coding sequence of a first text by coding the first text; obtaining a controllable attribute of a second text to be generated; predicting a hidden state of the second text based on the coding sequence of the first text and the controllable attribute of the second text; and obtaining a second text corresponding to the first text by decoding the coding sequence of the first text based on the hidden state of the second text.

First claim

Opening claim text (preview).

What is claimed is: 1 . A method for generating a text, comprising: obtaining a coding sequence of a first text by coding the first text; obtaining a controllable attribute of a second text to be generated; predicting a hidden state of the second text based on the coding sequence of the first text and the controllable attribute of the second text; and obtaining a second text corresponding to the first text by decoding the coding sequence of the first text based on the hidden state of the second text. 2 . The method according to claim 1 , wherein obtaining the controllable attribute of the second text to be generated comprises: obtaining a target value of the controllable attribute; and predicting a value of a controllable attribute of each character in the second text based on the target value and codes of each character of the first text in the coding sequence in a case that the controllable attribute is a local attribute. 3 . The method according to claim 2 , wherein after obtaining the target value of the controllable attribute, the method further comprises: determining that the value of the controllable attribute of each character in the second text is the target value in a case that the controllable attribute is a global attribute. 4 . The method according to claim 2 , wherein obtaining the target value of the controllable attribute comprises: determining the target value of the controllable attribute by a user operation; or obtaining the target value by predicting the controllable attribute based on the coding sequence of the first text. 5 . The method according to claim 2 , wherein predicting the hidden state of the second text based on the coding sequence of the first text and the controllable attribute of the second text comprises: obtaining a hidden state of a first character in the second text by fusing the coding sequence and the controllable attribute of the first character of the second text and decoding using a first recurrent neural network; and obtaining a hidden state of an n th character in the second text by fusing a hidden state of an (n−1) th character in the second text and a controllable attribute of the n th character in the second text, and decoding using the first recurrent neural network, where n is an integer greater than 1. 6 . The method according to claim 5 , wherein obtaining the second text corresponding to the first text by decoding the coding sequence of the first text based on the hidden state of the second text, comprises: obtaining a code of the first character in the second text by fusing the coding sequence and the hidden state of the first character in the second text, and decoding by using a second recurrent neural network; obtaining a code of the n th character in the second text by fusing the coding sequence of the first text, the hidden state of the n th character in the second text and a code of the (n−1) th character in the second text, and decoding by using the second recurrent neural network; and determining the second text based on a code of each character in the second text. 7 . The method according to claim 2 , wherein predicting the value of the controllable attribute of each character of the second text based on the target value and the code of each character of the first text, comprises: obtaining a value of the controllable attribute of a first character in the second text by fusing the target value and the coding sequence of the first text, and inputting into a third recurrent neural network; and obtaining a value of the controllable attribute of the n th character in the second text by fusing the value of the controllable attribute of the (n−1) th character in the second text, the target value and the coding sequence of the first text, and decoding by the third recurrent neural network. 8 . An apparatus for generating a text, comprising: at least one processor and a memory communicatively connected with the at least one processor, wherein the memory stores instructions executable by the at least one processor, and the at least one processor is configured to: obtain a coding sequence of a first text by coding the first text; obtain a controllable attribute of a second text to be generated; predict a hidden state of the second text based on the coding sequence of the first text and the controllable attribute of the second text; and obtain a second text corresponding to the first text by decoding the coding sequence of the first text based on the hidden state of the second text. 9 . The apparatus according to claim 8 , wherein the at least one processor is configured to: obtain a target value of the controllable attribute; and predict a value of a controllable attribute of each character in the second text based on the target value and codes of each character of the first text in the coding sequence in a case that the controllable attribute is a local attribute. 10 . The apparatus according to claim 9 , wherein the at least one processor is configured to: determine that the value of the controllable attribute of each character in the second text is the target value in a case that the controllable attribute is a global attribute. 11 . The apparatus according to claim 9 , wherein the at least one processor is configured to: determine the target value of the controllable attribute by a user operation; or obtain the target value by predicting the controllable attribute based on the coding sequence of the first text. 12 . The apparatus according to claim 9 , wherein the at least one processor is configured to: obtain a hidden state of a first character in the second text by fusing the coding sequence and the controllable attribute of the first character of the second text and decode using a first recurrent neural network; and obtain a hidden state of an n th character in the second text by fusing a hidden state of an (n−1) th character in the second text and a controllable attribute of the n th character in the second text, and decode using the first recurrent neural network, where n is an integer greater than 1. 13 . The apparatus according to claim 12 , wherein the at least one processor is configured to: obtain a code of the first character in the second text by fusing the coding sequence and the hidden state of the first character in the second text, and decoding by using a second recurrent neural network; obtain a code of the n th character in the second text by fusing the coding sequence of the first text, the hidden state of the n th character in the second text and a code of the (n−1) th character in the second text, and decoding by using the second recurrent neural network; and determine the second text based on a code of each character in the second text. 14 . The apparatus according to claim 9 , wherein the at least one processor is configured to: obtain a value of the controllable attribute of a first character in the second text by fusing the target value and the coding sequence of the first text, and inputting into a third recurrent neural network; and obtain a value of the controllable attribute of the n th character in the second text by fusing the value of the controllable attribute of the (n−1) th character in the second text, the target value and the coding sequence of the first text, and decoding by the third recurrent neural network. 15 . A non-transitory computer-readable storage medium storing computer instructions, wherein the computer instructions are configured to make a computer execute the method according to claim 1 , and the method comprises:

Assignees

Inventors

Classifications

  • G06F40/56Primary

    Natural language generation · CPC title

  • Tagging; Marking up (details of markup languages G06F40/143); Designating a block; Setting of attributes (style sheets, e.g. eXtensible Stylesheet Language Transformation [XSLT], G06F40/154) · CPC title

  • Dictionaries · CPC title

  • G06F40/40Primary

    Processing or translation of natural language (natural language analysis G06F40/20; semantic analysis G06F40/30) · CPC title

  • Semantic analysis · CPC title

Patent family

Related publications grouped by family.

External sources

Frequently asked questions

Answers are generated from the same data shown on this page.

What does patent US2022138435A1 cover?
The disclosure provides a method for generating a text. The method includes: obtaining a coding sequence of a first text by coding the first text; obtaining a controllable attribute of a second text to be generated; predicting a hidden state of the second text based on the coding sequence of the first text and the controllable attribute of the second text; and obtaining a second text correspond…
Who is the assignee on this patent?
Beijing Baidu Netcom Sci & Tech Co Ltd
What technology area does this patent fall under?
Primary CPC classification G06F40/56. Mapped technology areas include Physics.
When was this patent published?
Publication date Thu May 05 2022 00:00:00 GMT+0000 (Coordinated Universal Time) (A1). Legal status and post-grant events are not shown on this page.
What related patents are in patentsdb?
We list 4 related publications on this page (citations in our corpus or others sharing the same primary CPC).