Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Download music/books data in german version #76

Open
suryapa1 opened this issue Jun 15, 2020 · 0 comments
Open

Download music/books data in german version #76

suryapa1 opened this issue Jun 15, 2020 · 0 comments

Comments

@suryapa1
Copy link

prepare_cls.py:

Could you share public URL to fetch cls books/music in german version please ??

def fetch_cls(url_prefix, cls_path="data/cls"):
""" Fetch CLS from server using basic auth
url_prefix should point to CLS stored as follow
"https://user:passwd@server/path/[en|fr|de|jp]/[dvd|music|books].[test|train|unlabeled].csv"
data/cls/de-music/models/sp15k
"""
def fetch(url, CLS):
CLS.parent.mkdir(parents=True, exist_ok=True)
print("fetching", url, CLS)
urllib.request.urlretrieve(url, CLS)
for code in lang_codes:
for category in [ 'music']:
dir = Path(cls_path)/f'{code}-{category}'
fetch(f"{url_prefix}/{code}/{category}/train.csv", dir / f"{code}.train.csv")
fetch(f"{url_prefix}/{code}/{category}/test.csv", dir / f"{code}.test.csv")
fetch(f"{url_prefix}/{code}/{category}/unlabeled.csv", dir / f"{code}.unsup.csv")

if name == "main":
fire.Fire(fetch_cls)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant