Patent ID: 11966708
Assignee: INTERNATIONAL BUSINESS MACHINES CORPORATION
Field: Computer technology (Electrical engineering)
Classification: CPC G | IPC G

Claim 14:
15. A computer system, comprising one or more processors, one or more memories, and one or more computer readable hardware storage devices, said one or more hardware storage devices containing program code executable by the one or more processors via the one or more memories to implement a method for translating, using a beam search, a sentence S comprising n source words Si, . . . , Sn in a source language into a sentence T comprising n target words T1, . . . , Tn in a target language having a vocabulary characterized by a vocabulary vector V of m vocabulary words denoted as V1, . . . , Vm, wherein n≥2 and m≥3, said method comprising: performing in sequence, by the one or more processors, successive iterations 1, 2, . . . of an iterative process, wherein after setting i to 1 and J1 to 1, performing iteration i of the iterative process comprises:
generating, using a sequence-to-sequence model, Ji probability vectors Pij(j=1, 2, . . . , Ji), wherein each probability vector Pij has m elements Pijk(k=1, 2, . . . , m), wherein each element Pijk of the probability vector Pij is a conditional probability of a respective vocabulary word Vk being a translation of the source word Si, wherein for i>1, the vocabulary word Vk (k=1, 2, . . . , m) terminates a target vector of vocabulary words selected in iteration i−1;
sorting each probability vector Pij(j=1, 2, . . . , Ji) in descending order or ascending order of the elements in each probability vector Pij;
generating Ji probability difference vectors respectively corresponding to the Ji sorted probability vectors, wherein each element of each probability difference vector is a numerical difference between adjacent elements in respective sorted probability vectors;
if i<n, determining, using the Ji probability difference vectors, a beam width Bi via execution of a fully connected neural network (FCNN) and computing Ji+1 as equal to Bi;
if i=n, setting the beam width Bn equal q, wherein q is a specified positive integer subject to 1≤q≤n;
selecting & vocabulary words corresponding to the & highest conditional probabilities in the Ji probability vectors Pij(j=1, 2, . . . , Ji);
if i=1, generating Bi target vectors respectively comprising the selected Bi vocabulary words or if i>1, generating the Bi target vectors by adding each selected vocabulary word to the end of a respective target vector generated in iteration i−1, wherein each target vector generated in iteration i has a translation probability equal to the conditional probability of the selected vocabulary word positioned at the end of the target vector;
if at least one stop condition is satisfied, then outputting the Bn target vectors and stopping the iterative process, wherein the at least one stop condition comprises a first stop condition of i=n;
if at least one stop condition is not satisfied, then incrementing i by 1 and looping back to said generating the Ji probability vectors to perform the next iteration i.