Skip to content

Download music/books data in german version #76

@suryapa1

Description

@suryapa1

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)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions