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

Claim 0:
1. A method for translating, using a beam search, a sentence S comprising n source words S1, . . . , 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 one or more processors of a computer system, 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 Bi vocabulary words corresponding to the Bi 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 the 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.