def get_elmo(model, sentence_list, indices_list):
    """
    Get elmo embeddings
    :param model: elmo model
    :param sentence_list: List of sentences for which embeddings will be created
    :param indices_list: List of list of indices. For every sentence: A list of indices for which words embeddings will be created
    :return: List of list of word vectors. First list represents the sentences. Second list contains the word vectors in the same order as the indices were given in the indices_list.
    """
    vector_list = []

    # Give ELMo a list of sentences
    embedding = model.sents2elmo(sentence_list)
    for i in range(0, len(sentence_list)):
        # Extract the words matching the indices for this sentence
        indices = indices_list[i]
        for ind in indices:
            if ind == "":
                continue
            ind = int(ind)

            e = embedding[i][ind]
            vector_list += [e.tolist()]
    return vector_list