avoid using fixed configuration list
Browse files- bbc_alltime.py +5 -2
bbc_alltime.py
CHANGED
|
@@ -1,5 +1,7 @@
|
|
| 1 |
import datasets
|
| 2 |
import json
|
|
|
|
|
|
|
| 3 |
|
| 4 |
_CITATION = """\
|
| 5 |
@misc{li2023estimating,
|
|
@@ -18,8 +20,9 @@ This dataset contains BBC News articles from 2017 to 2022. The articles are arra
|
|
| 18 |
|
| 19 |
_HOMEPAGE = "https://github.com/liyucheng09/Contamination_Detector"
|
| 20 |
|
| 21 |
-
|
| 22 |
-
|
|
|
|
| 23 |
|
| 24 |
class Bbc_alltimes(datasets.GeneratorBasedBuilder):
|
| 25 |
|
|
|
|
| 1 |
import datasets
|
| 2 |
import json
|
| 3 |
+
import glob
|
| 4 |
+
import os
|
| 5 |
|
| 6 |
_CITATION = """\
|
| 7 |
@misc{li2023estimating,
|
|
|
|
| 20 |
|
| 21 |
_HOMEPAGE = "https://github.com/liyucheng09/Contamination_Detector"
|
| 22 |
|
| 23 |
+
all_articles = glob.glob('articles/*.json')
|
| 24 |
+
file_names = [os.path.splitext(os.path.basename(path))[0] for path in all_articles]
|
| 25 |
+
_TIMES = file_names.sort() + ['all']
|
| 26 |
|
| 27 |
class Bbc_alltimes(datasets.GeneratorBasedBuilder):
|
| 28 |
|