def __call__(self, data: List) -> np.ndarray:
<EOL>max_length = max(len(x) for x in data)<EOL>answer = np.zeros(shape=(len(data), max_length, self.dim), dtype=int)<EOL>for i, sent in enumerate(data):<EOL><INDENT>for j, word in enumerate(sent):<EOL><INDENT>answer[i, j][self._get_word_indexes(word)] = <NUM_LIT:1><EOL><DEDENT><DEDENT>return answer<EOL>
Transforms words to one-hot encoding according to the dictionary.

Args:
    data: the batch of words

Returns:
    a 3D array. answer[i][j][k] = 1 iff data[i][j] is the k-th word in the dictionary.