CPC G06F 40/44 (2020.01) [G06F 40/284 (2020.01); G06F 40/56 (2020.01)] | 15 Claims |
1. A method of obtaining, by an electronic device, a sentence corresponding to context information based on at least one data and outputting the obtained sentence on a display, the method comprising:
receiving a user input using a user input interface;
obtaining the context information corresponding to the user input by encoding the user input;
obtaining first output information including at least one word output by decoding the context information based on first-first data stored in a memory;
determining whether an end token is included in the first output information;
based on detecting that the end token is not included in the first output information, obtaining second output information including at least one word output by decoding the context information based on first-second data stored in the memory;
based on a number of words included in the second output information being determined to be greater than or equal to a first reference value, the first-first data is replaced with second-first data;
obtaining the sentence corresponding to the context information based on the first output information and the second output information; and
outputting the obtained sentence using the display,
wherein the end token represents an end of the sentence,
wherein the replacing the first-first data with the second-first data increases a probability that the first output information including the end token is obtained, and
wherein at least one of the decodinq of the context information based on the first-first data and the decodinq of the context information based on the second-first data is performed by a recurrent neural network.
|