5b8864d1863ac0474db8b657f023341686f4b1fb,benchmark/imdb.py,,imdb_raw,#,9

Before Change


    word_to_id = {k: (v + index_offset) for k, v in word_to_id.items()}
    word_to_id["<PAD>"] = 0
    word_to_id["<START>"] = 1
    word_to_id["<UNK>"] = 2

    id_to_word = {value: key for key, value in word_to_id.items()}
    x_train = list(

After Change


    )
    
    // set path to dataset
    IMDB_DATADIR = os.path.join(os.path.dirname(dataset), "aclImdb")
    
    classes = ["pos", "neg"]
    train_data = load_files(os.path.join(IMDB_DATADIR, "train"), shuffle=True, categories=classes)
    test_data = load_files(os.path.join(IMDB_DATADIR,  "test"), shuffle=False, categories=classes)

    encoding = "utf-8"
    x_train = np.array(train_data.data)
    y_train = np.array(train_data.target)
    x_test = np.array(test_data.data)
    y_test = np.array(test_data.target)
    return (x_train, y_train), (x_test, y_test)


def main():
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 4

Instances


Project Name: keras-team/autokeras
Commit Name: 5b8864d1863ac0474db8b657f023341686f4b1fb
Time: 2020-09-24
Author: jhfjhfj1@gmail.com
File Name: benchmark/imdb.py
Class Name:
Method Name: imdb_raw


Project Name: tryolabs/luminoth
Commit Name: 8a600f790ba68880e9a76a5eda33a3f4fccd22c4
Time: 2017-11-17
Author: javirey@gmail.com
File Name: luminoth/utils/predicting.py
Class Name:
Method Name: get_predictions


Project Name: Hironsan/anago
Commit Name: 943f07b22b0def07446093aa92cd85bf2e74d877
Time: 2017-08-29
Author: light.tree.1.13@gmail.com
File Name: tests/train_test.py
Class Name: TrainerTest
Method Name: test_train