allenai / document-qa

Apache License 2.0
434 stars 122 forks source link

Bug in func. shuffle in docqa/dataset.py #56

Open YeDeming opened 5 years ago

YeDeming commented 5 years ago

Hi, Clark

Thanks for your opening source code!

I found a bug in shuffle function:

def shuffle_list_buckets(data, key, rng):
    start = 0
    end = 0
    while start < len(data):
        while end < len(data) and key(data[start]) == key(data[end]):
            end += 1
        rng.shuffle(data[start:end])
        start = end
    return data

rng.shuffle(data[start:end]) doesn't shuffle the the slice of data

Deming Ye