Patent attributes
A sentence generation method is provided for an electronic device. The method includes obtaining an input sequence, encoding the input sequence to obtain a sentence eigenvector, decoding the sentence eigenvector to obtain a first predetermined quantity of candidate sentence sequences, clustering the first predetermined quantity of candidate sentence sequences to obtain sentence sequence sets of at least two types, screening out a second predetermined quantity of candidate sentence sequences from the sentence sequence sets of at least two types, the second predetermined quantity of candidate sentence sequences including at least two sentence feature types, and determining an output sequence corresponding to the input sequence according to the second predetermined quantity of candidate sentence sequences.