A symbol string generator that, when a first symbol string x representing a sentence is inputted, generates, via a pre-learned neural network, a second symbol string y that accords with a prescribed purpose that corresponds to the sentence, wherein the symbol string generator is characterized in that: the neural network has an encoding unit that converts elements xi of the inputted first symbol string x to a first hidden state, an attention mechanism unit that applies a weighting to the first hidden state and outputs the weighted first hidden state as a second hidden state, a decoding unit that outputs a third hidden state on the basis of the tth element xt of the first symbol string x, the t-1th element yt-1} of the second symbol string y, and the second hidden state, and an output unit that generates the tth element yt of the second symbol string y on the basis of the second hidden state and the third hidden state and outputs the generated element yt; the attention mechanism unit calculates each of first probabilities Pparent (xj}|xt,x) that the parent of an element xt included in the first symbol string x is an element xj other than the element xt in a dependency structure tree that corresponds to the sentence, calculates, using the calculated first probabilities Pparent (xj}|xt,x), each of second probabilities αd,t,j that the dth order parent of the element xt is a term xj other than the element xt, and outputs γd,t derived by weighting the first hidden state using the calculated second probabilities αd,t j, as the second hidden state.
SYMBOL STRING GENERATOR, SENTENCE COMPACTION DEVICE, SYMBOL STRING GENERATION METHOD, AND PROGRAM