tasks/DREAM/preprocess.py
def encode_sentences(sentences, lexicon_dictionary):
    """
    Change words in sentences into their one-hot index.
    :param sentences: A list of sentences where all words are in lexicon_dictionary
    :param lexicon_dictionary: A dictionary including all the words in the dataset
           sentences are being drawn from.
    :return: sentences with each word replaced by a number.
    """
    new_sentence = []
    for word in sentences.split():
        new_sentence.append(lexicon_dictionary[word])
    return new_sentence

    Change words in sentences into their one-hot index.
    :param sentences: A list of sentences where all words are in lexicon_dictionary
    :param lexicon_dictionary: A dictionary including all the words in the dataset
           sentences are being drawn from.
    :return: sentences with each word replaced by a number.
    
Change words in sentences into their one-hot index.
Change words in sentences into their one - hot index .
def encode_sentences(sentences, lexicon_dictionary):
    new_sentence = []
    for word in sentences.split():
        new_sentence.append(lexicon_dictionary[word])
    return new_sentence
def encode_sentences ( sentences , lexicon_dictionary ) : new_sentence = [ ] for word in sentences . split ( ) : new_sentence . append ( lexicon_dictionary [ word ] ) return new_sentence
Change words in sentences into their one-hot index.
Change words in sentences into their one - hot index .
"""
    Change words in sentences into their one-hot index.
    :param sentences: A list of sentences where all words are in lexicon_dictionary
    :param lexicon_dictionary: A dictionary including all the words in the dataset
           sentences are being drawn from.
    :return: sentences with each word replaced by a number.
    """
sentences with each word replaced by a number.
sentences with each word replaced by a number .
sentences
A list of sentences where all words are in lexicon_dictionary
A list of sentences where all words are in lexicon_dictionary
lexicon_dictionary
A dictionary including all the words in the dataset
sentences are being drawn from.
A dictionary including all the words in the dataset sentences are being drawn from .