def load_matt_mahoney_text8_dataset(path='data/mm_test8/'):
 print 'Load or Download matt_mahoney_text8 Dataset> {}'.format(path)
 filename = 'text8.zip'
 url = 'http://mattmahoney.net/dc/'
 maybe_download_and_extract(filename, path, url, expected_bytes=31344016)
 with zipfile.ZipFile(os.path.join(path, filename)) as f:
  word_list = f.read(f.namelist()[0]).split()
 return word_list

def load_matt_mahoney_text8_dataset ( path = 'data/mm_test8/' ) : print 'Load or Download matt_mahoney_text8 Dataset> {}' . format ( path ) filename = 'text8.zip' url = 'http://mattmahoney.net/dc/' maybe_download_and_extract ( filename , path , url , expected_bytes = 31344016 ) with zipfile . ZipFile ( os . path . join ( path , filename ) ) as f : word_list = f . read ( f . namelist ( ) [ 0 ] ) . split ( ) return word_list
download a text file from matt mahoneys website if not present .