提交 b098ef69 编写于 作者: D dzhwinter

"remove the rar extractfile, prevent small files"

上级 b4b967a7
......@@ -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)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册