5b8864d1863ac0474db8b657f023341686f4b1fb,benchmark/imdb.py,,imdb_raw,#,9
Before Change
(x_train, y_train), (x_test, y_test) = imdb.load_data(index_from=index_offset)
word_to_id = imdb.get_word_index()
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(
map(lambda sentence: " ".join(id_to_word[i] for i in sentence), x_train)
)
After Change
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():

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: NervanaSystems/coach
Commit Name: 49dea39d34a562a46daa562051a66846326f66f4
Time: 2018-11-07
Author: gal.leibovich@intel.com
File Name: rl_coach/core_types.py
Class Name: Batch
Method Name: info
Project Name: chainer/chainercv
Commit Name: f233621dbb8b80df8549376fb2d86bd6a2b780ce
Time: 2017-05-26
Author: Hakuyume@users.noreply.github.com
File Name: chainercv/visualizations/vis_label.py
Class Name:
Method Name: vis_label