yaml
Browse files- create_yaml.py +5 -6
create_yaml.py
CHANGED
@@ -1,6 +1,7 @@
|
|
1 |
import glob
|
2 |
import os
|
3 |
|
|
|
4 |
def read_folder(folder):
|
5 |
folder_name = os.path.basename(folder)
|
6 |
|
@@ -10,9 +11,9 @@ def read_folder(folder):
|
|
10 |
path: {folder_name}/corpus/*
|
11 |
- config_name: {folder_name}-queries
|
12 |
data_files:"""
|
13 |
-
|
14 |
for filepath in glob.glob(f"{folder}/queries/*.parquet"):
|
15 |
-
|
16 |
- split: {os.path.basename(filepath).split('.')[0]}
|
17 |
path: {filepath}"""
|
18 |
|
@@ -20,13 +21,11 @@ def read_folder(folder):
|
|
20 |
- config_name: {folder_name}-qrels
|
21 |
data_files:"""
|
22 |
for filepath in glob.glob(f"{folder}/qrels/*.parquet"):
|
23 |
-
|
24 |
- split: {os.path.basename(filepath).split('.')[0]}
|
25 |
path: {filepath}"""
|
26 |
-
|
27 |
-
return template
|
28 |
-
|
29 |
|
|
|
30 |
|
31 |
|
32 |
for filepath in sorted(glob.glob("*")):
|
|
|
1 |
import glob
|
2 |
import os
|
3 |
|
4 |
+
|
5 |
def read_folder(folder):
|
6 |
folder_name = os.path.basename(folder)
|
7 |
|
|
|
11 |
path: {folder_name}/corpus/*
|
12 |
- config_name: {folder_name}-queries
|
13 |
data_files:"""
|
14 |
+
|
15 |
for filepath in glob.glob(f"{folder}/queries/*.parquet"):
|
16 |
+
template += f"""
|
17 |
- split: {os.path.basename(filepath).split('.')[0]}
|
18 |
path: {filepath}"""
|
19 |
|
|
|
21 |
- config_name: {folder_name}-qrels
|
22 |
data_files:"""
|
23 |
for filepath in glob.glob(f"{folder}/qrels/*.parquet"):
|
24 |
+
template += f"""
|
25 |
- split: {os.path.basename(filepath).split('.')[0]}
|
26 |
path: {filepath}"""
|
|
|
|
|
|
|
27 |
|
28 |
+
return template
|
29 |
|
30 |
|
31 |
for filepath in sorted(glob.glob("*")):
|