Can we have file extension to data split mapping ?

#11
by ravindra34 - opened

For example, if I am interested in YAML files which data partition to download is not evident from this:
https://gist.github.com/ppisarczyk/43962d06686722d26d176fad46879d41

It is clear for Dockerfile, for example:

# specific language (e.g. Dockerfiles)
ds = load_dataset("bigcode/the-stack", data_dir="data/dockerfile", split="train")

Thanks

BigCode org

You would have to load the entire dataset and .filter() to only allow YAML files. The different configs correspond to the 30 languages mentioned in the dataset card.

@cakiki , I downloaded smaller subset and ran the following code still yields 0 num_rows or yaml files.

from datasets import load_dataset, load_from_disk                                                                                                                                    
parts = [                                                                                        
        "assembly", "batchfile", "c++", "c", "c-sharp",                                          
        "cmake", "css", "dockerfile", "fortran", "go", "haskell", "html", "java",                
        "javascript", "julia", "lua", "makefile", "markdown", "perl",                            
        "php", "powershell", "python", "ruby", "rust", "scala", "shell", "sql", "tex", "typescript", "visual-basic"]
# bigcode/the-stack-smol 
for part in parts:
    ds = load_dataset("bigcode/the-stack-smol", data_dir=f"data/{part}", split="train")          
    ds.save_to_disk(f"{part}.hf")                                                                
for part in parts: 
    ds = load_from_disk(f"{part}.hf")                                                            
    yaml_ds = ds.filter(lambda example: example['path'].endswith('yaml') or \
                                        example['path'].endswith('yml') or \
                                        example['path'].endswith('reek') or \
                                        example['path'].endswith('rviz') or \
                                        example['path'].endswith('sublime-syntax') or \
                                        example['path'].endswith('syntax') or \
                                        example['path'].endswith('yaml-tmlanguage'))
    print(yaml_ds)
BigCode org

Actually you will not find yaml files in the dataset, the only languages we filtered for (by file extension) are the 30 languages mentioned in the dataset card.

Thanks @loubnabnl , I thought the same. I was under the assumption that they were included, since the paper mentioned in the section "C Included programming language extensions".

Any rationale, to exclude yaml files for model training or is it just data distribution being too low ?

BigCode org

Indeed we selected 30 of the most popular programming languages, more will be added in the next release. You can comment on this issue https://github.com/bigcode-project/bigcode-dataset/issues/2 with the languages you want and we'll include them if there's enough interest

ravindra34 changed discussion status to closed

Sign up or log in to comment