提交 b098ef69 编写于 作者: D dzhwinter

"remove the rar extractfile, prevent small files"

上级 b4b967a7
...@@ -24,8 +24,9 @@ import conll05 ...@@ -24,8 +24,9 @@ import conll05
import uci_housing import uci_housing
import sentiment import sentiment
import wmt14 import wmt14
import mq2007
__all__ = [ __all__ = [
'mnist', 'imikolov', 'imdb', 'cifar', 'movielens', 'conll05', 'sentiment' 'mnist', 'imikolov', 'imdb', 'cifar', 'movielens', 'conll05', 'sentiment'
'uci_housing', 'wmt14' 'uci_housing', 'wmt14', 'mq2007'
] ]
...@@ -41,9 +41,7 @@ def __initialize_meta_info__(): ...@@ -41,9 +41,7 @@ def __initialize_meta_info__():
""" """
fn = fetch() fn = fetch()
rar = rarfile.RarFile(fn) rar = rarfile.RarFile(fn)
dirpath = os.path.dirname(fn) return rar
rar.extractall(path=dirpath)
return dirpath
class Query(object): class Query(object):
...@@ -273,7 +271,7 @@ def load_from_text(filepath, shuffle=True, fill_missing=-1): ...@@ -273,7 +271,7 @@ def load_from_text(filepath, shuffle=True, fill_missing=-1):
querylists = [] querylists = []
querylist = None querylist = None
fn = __initialize_meta_info__() 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: for line in f:
query = Query() query = Query()
query = query._parse_(line) query = query._parse_(line)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册