US 12,450,431 B2
Method and apparatus for generating text
Jiahui Liang, Beijing (CN); Junwei Bao, Beijing (CN); and Youzheng Wu, Beijing (CN)
Assigned to Beijing Wodong Tianjun Information Technology Co., Ltd., Beijing (CN); and Beijing Jingdong Century Trading Co., Ltd., Beijing (CN)
Appl. No. 18/273,698
Filed by Beijing Wodong Tianjun Information Technology Co., Ltd., Beijing (CN); and Beijing Jingdong Century Trading Co., Ltd., Beijing (CN)
PCT Filed Dec. 15, 2021, PCT No. PCT/CN2021/138296
§ 371(c)(1), (2) Date Jul. 21, 2023,
PCT Pub. No. WO2022/156434, PCT Pub. Date Jul. 28, 2022.
Claims priority of application No. 202110085890.0 (CN), filed on Jan. 22, 2021.
Prior Publication US 2024/0078385 A1, Mar. 7, 2024
Int. Cl. G06F 40/279 (2020.01)
CPC G06F 40/279 (2020.01) 15 Claims
OG exemplary drawing
 
1. A method for generating a text, comprising:
receiving an original text and an element tag;
generating, based on the original text, an encoded text feature vector and an encoded sentence feature vector of each sentence in the original text using a pre-trained encoder; and
performing, using a decoder that is pre-trained, following decoding steps:
determining, based on a hidden state vector of the decoder at a current moment and the encoded text feature vector, a word attention weight of each word in the original text at the current moment; determining a sentence attention weight of each sentence in the original text at the current moment, based on the hidden state vector of the decoder at the current moment, the encoded sentence feature vector and the element tag; determining a normalized word attention weight of each word in the original text at the current moment based on the sentence attention weight and the word attention weight; and estimating a target word at the current moment based on the encoded text feature vector and normalized word attention weights of words in the original text at the current moment,
wherein the method further comprises: generating a target text based on target words outputted by the decoder at moments.