459d7fe3d7aeb065c42249e955a4053270e81814,examples/babi_memnn.py,,,#,96

Before Change


train_stories = get_stories(tar.extractfile(challenge.format("train")))
test_stories = get_stories(tar.extractfile(challenge.format("test")))

vocab = sorted(reduce(lambda x, y: x | y, (set(story + q + [answer]) for story, q, answer in train_stories + test_stories)))
// Reserve 0 for masking via pad_sequences
vocab_size = len(vocab) + 1
story_maxlen = max(map(len, (x for x, _, _ in train_stories + test_stories)))
query_maxlen = max(map(len, (x for _, x, _ in train_stories + test_stories)))

After Change


test_stories = get_stories(tar.extractfile(challenge.format("test")))

vocab = set()
for story, q, answer in train_stories + test_stories:
    vocab |= set(story + q + [answer])
vocab = sorted(vocab)

// Reserve 0 for masking via pad_sequences
vocab_size = len(vocab) + 1
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 4

Instances


Project Name: keras-team/keras
Commit Name: 459d7fe3d7aeb065c42249e955a4053270e81814
Time: 2017-03-15
Author: francois.chollet@gmail.com
File Name: examples/babi_memnn.py
Class Name:
Method Name:


Project Name: dmlc/gluon-nlp
Commit Name: 4f89ca033537fe83d912d858b3e337e40a8c799d
Time: 2019-06-05
Author: linhaibin.eric@gmail.com
File Name: src/gluonnlp/data/stream.py
Class Name: SimpleDatasetStream
Method Name: __init__


Project Name: keras-team/keras
Commit Name: 459d7fe3d7aeb065c42249e955a4053270e81814
Time: 2017-03-15
Author: francois.chollet@gmail.com
File Name: examples/babi_rnn.py
Class Name:
Method Name: