Update make_qas_comparison.py
Browse files- make_qas_comparison.py +10 -11
make_qas_comparison.py
CHANGED
|
@@ -48,15 +48,14 @@ def read_excel(file):
|
|
| 48 |
print(f"include {len(qas)} qas from {file}")
|
| 49 |
return qas
|
| 50 |
|
| 51 |
-
input_dir = "./
|
| 52 |
-
|
| 53 |
-
|
| 54 |
-
|
| 55 |
-
|
| 56 |
-
|
| 57 |
-
|
| 58 |
-
|
| 59 |
-
qas += read_excel(f"{input_dir}/{file}")
|
| 60 |
|
| 61 |
-
|
| 62 |
-
|
|
|
|
| 48 |
print(f"include {len(qas)} qas from {file}")
|
| 49 |
return qas
|
| 50 |
|
| 51 |
+
input_dir = "./"
|
| 52 |
+
qas = []
|
| 53 |
+
for file in os.listdir(input_dir):
|
| 54 |
+
if file.startswith("~$"):
|
| 55 |
+
continue
|
| 56 |
+
if not file.endswith(".xlsx"):
|
| 57 |
+
continue
|
| 58 |
+
qas += read_excel(f"{input_dir}/{file}")
|
|
|
|
| 59 |
|
| 60 |
+
with open(f"{input_dir}/qas.json", "w", encoding="utf-8") as f:
|
| 61 |
+
f.write(json.dumps(qas, ensure_ascii=False))
|