{"id":19542055,"url":"https://github.com/bigscience-workshop/catalogue_data","last_synced_at":"2025-04-26T17:31:03.238Z","repository":{"id":41873279,"uuid":"454273890","full_name":"bigscience-workshop/catalogue_data","owner":"bigscience-workshop","description":"Scripts to prepare catalogue data","archived":false,"fork":false,"pushed_at":"2022-04-25T11:51:09.000Z","size":282,"stargazers_count":8,"open_issues_count":8,"forks_count":1,"subscribers_count":21,"default_branch":"master","last_synced_at":"2025-04-04T16:41:46.789Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Jupyter Notebook","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/bigscience-workshop.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2022-02-01T05:35:53.000Z","updated_at":"2024-03-12T07:58:52.000Z","dependencies_parsed_at":"2022-08-11T19:51:00.660Z","dependency_job_id":null,"html_url":"https://github.com/bigscience-workshop/catalogue_data","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bigscience-workshop%2Fcatalogue_data","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bigscience-workshop%2Fcatalogue_data/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bigscience-workshop%2Fcatalogue_data/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bigscience-workshop%2Fcatalogue_data/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/bigscience-workshop","download_url":"https://codeload.github.com/bigscience-workshop/catalogue_data/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":251025660,"owners_count":21524841,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-11T03:13:00.677Z","updated_at":"2025-04-26T17:31:02.910Z","avatar_url":"https://github.com/bigscience-workshop.png","language":"Jupyter Notebook","readme":"# catalogue_data\nScripts to prepare catalogue data.\n\n## Setup\nClone this repo.\n\nInstall git-lfs: https://github.com/git-lfs/git-lfs/wiki/Installation\n```shell\nsudo apt-get install git-lfs\ngit lfs install\n```\n\nInstall dependencies:\n```shell\nsudo apt-add-repository non-free\nsudo apt-get update\nsudo apt-get install unrar\n```\n\nCreate virtual environment, activate it and install dependencies:\n```shell\npython -m venv .venv\nsource .venv/bin/activate\npip install -r requirements.txt\n```\n\nCreate User Access Token (with write access) at Hugging Face Hub: https://huggingface.co/settings/token\nand set environment variables in the `.env` file at the root directory:\n```\nHF_USERNAME=\u003cReplace with your Hugging Face username\u003e\nHF_USER_ACCESS_TOKEN=\u003cReplace with your Hugging Face API token\u003e\nGIT_USER=\u003cReplace with your Git user\u003e\nGIT_EMAIL=\u003cReplace with your Git email\u003e\n```\n\n## Create metadata\nTo create dataset metadata (in file `dataset_infos.json`) run:\n```shell\npython create_metadata.py --repo \u003crepo_id\u003e\n```\nwhere you should replace `\u003crepo_id\u003e`, e.g. `bigscience-catalogue-lm-data/lm_ca_viquiquad`\n\n\n## Aggregate datasets\nTo create an aggregated dataset from multiple datasets, and save it as sharded JSON Lines GZIP files, run:\n```shell\npython aggregate_datasets.py --dataset_ratios_path \u003cpath_to_file_with_dataset_ratios\u003e --save_path \u003cdir_path_to_save_aggregated_dataset\u003e\n```\nwhere you should replace:\n- `path_to_file_with_dataset_ratios`: path to JSON file containing a dict with dataset names (keys) and their ratio\n  (values) between 0 and 1.\n- `\u003cdir_path_to_save_aggregated_dataset\u003e`: directory path to save the aggregated dataset\n\n\n## Downloads for cleaning\n\n### Stanza\n\n```python\nimport stanza\n\nfor lang in {\"ar\", \"ca\", \"eu\", \"id\", \"vi\", \"zh-hans\", \"zh-hant\"}:\n    stanza.download(lang, logging_level=\"WARNING\")\n```\n\n### Indic NLP library\n\n```bash\ngit clone https://github.com/anoopkunchukuttan/indic_nlp_resources.git\nexport INDIC_RESOURCES_PATH=\u003cPATH_TO_REPO\u003e\n```\n\n### NLTK\nimport nltk\nnltk.download(\"punkt\")\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbigscience-workshop%2Fcatalogue_data","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbigscience-workshop%2Fcatalogue_data","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbigscience-workshop%2Fcatalogue_data/lists"}