JuliaHealth / JuliaHealth/HealthSampleData.jl

[FEATURE] Download Data Sources from HuggingFace

Open
#12 0 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

enhancement good first issue help wanted
Dominant language
Julia
Stars
2
Forks
2
PR merge metrics
No merged PRs in 30d

Description

In discussion with @ParamThakkar123, we realized that distributing data sources from HuggingFace is quite important! Here is an issue describing how we should build this out:

Issue Description

Difficulty: Intermediate
Time: 12 - 15 hours

Description:
This issue aims to extend HealthSampleData.jl with automatic dataset fetching and management capabilities using HuggingFaceHub.jl and DataDeps.jl. Currently, users must manually download datasets (e.g., synthea_1M_3YR.duckdb) from external sources.
With this enhancement, users will be able to run:

using HealthSampleData
path = HealthSampleData.load("synthea_1M_3YR") # Or something like this

and have the dataset automatically downloaded, cached, and reproducibly managed using Hugging Face and DataDeps.


Requirements

  • Add dependencies

    • Add HuggingFaceHub.jl and DataDeps.jl to Project.toml.
    • Ensure both packages are available and compatible with at least Julia 1.10.
  • Create dataset registration helpers for HuggingFaceHub.jl

    • Implement a function _huggingface_dataset_register(name::String, repo::String, filename::String).

    • Use HF.info(HF.Dataset, repo) to locate dataset metadata and HF.file_download() to retrieve files.

    • Register the dataset using DataDeps.jl (you'll need to consult the documentation here):

      register(DataDep(
          name,
          """
          JuliaHealth synthetic dataset (1M patients, 3 years of data).
          Source: https://huggingface.co/JuliaHealthOrg/JuliaHealthDatasets
          """,
          "https://huggingface.co/datasets/JuliaHealthOrg/JuliaHealthDatasets/resolve/main/synthea_1M_3YR.duckdb";
          post_fetch_method = somethingsomething
      ))
      
  • Register JuliaHealthDatasets as DataDeps

  • Documentation

    • Update README.md with:

      • Installation instructions for HuggingFaceHub.jl and DataDeps.jl.
      • Examples of dataset loading and caching.
      • Instructions for setting Hugging Face tokens.

Expected Outcomes

The implemented functionality should:

  1. Automatically download datasets from Hugging Face Hub using HuggingFaceHub.jl.
  2. Cache and manage datasets locally using DataDeps.jl.
  3. Provide a reproducible and Julia-native dataset management workflow.

Example Implementation

using HuggingFaceHub, DataDeps

function _huggingface_dataset_register(name::String, repo::String, filename::String)
    dataset = HF.info(HF.Dataset, repo)
    HF.file_download(dataset, filename)

end

#= 

Register DataDep later using information

=# 

    register(DataDep(
        name,
        "Dataset from Hugging Face repository $(repo).",
        "https://huggingface.co/datasets/$(repo)/resolve/main/$(filename)";
        post_fetch_method = identity
    ))
Example user workflow:
julia> using HealthSampleData
julia> path = HealthSampleData.load("synthea_1M_3YR")
Downloading dataset from Hugging Face...
100% complete!
@info "Dataset available at /home/datadeps/synthea_1M_3YR.duckdb"

You can then open the dataset as:

using DuckDB
con = DBInterface.connect(DuckDB.DB, path)

Future Extensions

  • Data versioning using Hugging Face revision tags.
  • Command-line interface (healthdata list, healthdata download) for dataset management.

References

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by inspecting Project.toml, README.md, and the existing HealthSampleData.load entry point. Read the HuggingFaceHub.jl and DataDeps.jl documentation referenced in the issue before defining the dataset registration flow. Done means datasets can be loaded by name with automatic Hugging Face fetching, local caching, reproducible management, and documented setup and token instructions.

Written by the indexing model from the issue text.

Assessment

Tech stack
julia
Domain
data
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.