File size: 1,814 Bytes
909c530
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
import os
from huggingface_hub import hf_hub_download

# ALL langauges
langs = {
    'train': ['ar', 'bn', 'en', 'es', 'fa', 'fi', 'fr', 'hi', 'id', 'ja', 'ko', 'ru', 'sw', 'te', 'th', 'zh'],
    'dev': ['ar', 'bn', 'en', 'es', 'fa', 'fi', 'fr', 'hi', 'id', 'ja', 'ko', 'ru', 'sw', 'te', 'th', 'zh'],
    'testA': ['ar', 'bn', 'en', 'fi', 'id', 'ja', 'ko', 'ru', 'sw', 'te', 'th']
}

# the langauges we used in ESSIR
langs = {'train': ['en', 'fa', 'ru', 'zh'], 'dev': ['en', 'fa', 'ru', 'zh']}

for split in ['train', 'dev']:
    for lang in langs[split]:
        # # topic
        # hf_hub_download('miracl/miracl', 
        #     filename=f'topics.miracl-v1.0-{lang}-{split}.tsv', 
        #     subfolder=f'miracl-v1.0-{lang}/topics', 
        #     repo_type='dataset', 
        #     cache_dir='/home/dju/datasets/essir-xlir/miracl/topics',
        #     force_filename=f'topics.miracl-v1.0-{lang}-{split}.tsv'
        # )
        #
        # # qrels
        # hf_hub_download('miracl/miracl', 
        #     filename=f'qrels.miracl-v1.0-{lang}-{split}.tsv', 
        #     subfolder=f'miracl-v1.0-{lang}/qrels', 
        #     repo_type='dataset', 
        #     cache_dir='/home/dju/datasets/essir-xlir/miracl/qrels',
        #     force_filename=f'qrels.miracl-v1.0-{lang}-{split}.tsv'
        # )

        # topic
        hf_hub_download('miracl/miracl-corpus', 
            filename=f'topics.miracl-v1.0-{lang}-{split}.tsv', 
            subfolder=f'miracl-v1.0-{lang}/topics', 
            repo_type='dataset', 
            cache_dir='/home/dju/datasets/essir-xlir/miracl/topics',
            force_filename=f'topics.miracl-v1.0-{lang}-{split}.tsv'
        )

cmd = f'rm -rvf /home/dju/datasets/essir-xlir/miracl/*/*lock'
os.system(cmd)

languages2filesize = { 'en': 66 , 'fa': 5, 'ru': 20, 'zh': 10, }