"remove the rar extractfile, prevent small files"

refactor_docs
dzhwinter 8 years ago
parent b4b967a7c2
commit b098ef69a4

@ -24,8 +24,9 @@ import conll05
import uci_housing
import sentiment
import wmt14
import mq2007
__all__ = [
'mnist', 'imikolov', 'imdb', 'cifar', 'movielens', 'conll05', 'sentiment'
'uci_housing', 'wmt14'
'uci_housing', 'wmt14', 'mq2007'
]

@ -41,9 +41,7 @@ def __initialize_meta_info__():
"""
fn = fetch()
rar = rarfile.RarFile(fn)
dirpath = os.path.dirname(fn)
rar.extractall(path=dirpath)
return dirpath
return rar
class Query(object):
@ -273,7 +271,7 @@ def load_from_text(filepath, shuffle=True, fill_missing=-1):
querylists = []
querylist = None
fn = __initialize_meta_info__()
with open(os.path.join(fn, filepath)) as f:
with fn.open(os.path.join(fn, filepath)) as f:
for line in f:
query = Query()
query = query._parse_(line)

Loading…
Cancel
Save