Added prints to debug 0 records issue
Browse files- sefaria.py +4 -1
sefaria.py
CHANGED
@@ -27,7 +27,7 @@ _HOMEPAGE = "https://github.com/Sefaria/Sefaria-Export"
|
|
27 |
_LICENSE = "Each text is licensed separately, so there is no overall license for this repository."
|
28 |
|
29 |
class Sefaria(datasets.GeneratorBasedBuilder):
|
30 |
-
VERSION = datasets.Version("1.0.
|
31 |
|
32 |
BUILDER_CONFIGS = [
|
33 |
datasets.BuilderConfig(name="english", version=VERSION, description="This configuration contains only English texts"),
|
@@ -62,6 +62,8 @@ class Sefaria(datasets.GeneratorBasedBuilder):
|
|
62 |
else:
|
63 |
filepaths = [os.path.join(data_dir, f) for f in os.listdir(data_dir) if f.endswith(".parquet")]
|
64 |
|
|
|
|
|
65 |
return [
|
66 |
datasets.SplitGenerator(
|
67 |
name=datasets.Split.TRAIN,
|
@@ -74,6 +76,7 @@ class Sefaria(datasets.GeneratorBasedBuilder):
|
|
74 |
def _generate_examples(self, filepaths):
|
75 |
for filepath in filepaths:
|
76 |
df = pd.read_parquet(filepath)
|
|
|
77 |
for idx, row in df.iterrows():
|
78 |
yield idx, {
|
79 |
"text": row["text"],
|
|
|
27 |
_LICENSE = "Each text is licensed separately, so there is no overall license for this repository."
|
28 |
|
29 |
class Sefaria(datasets.GeneratorBasedBuilder):
|
30 |
+
VERSION = datasets.Version("1.0.2")
|
31 |
|
32 |
BUILDER_CONFIGS = [
|
33 |
datasets.BuilderConfig(name="english", version=VERSION, description="This configuration contains only English texts"),
|
|
|
62 |
else:
|
63 |
filepaths = [os.path.join(data_dir, f) for f in os.listdir(data_dir) if f.endswith(".parquet")]
|
64 |
|
65 |
+
print(f"Filepaths found: {filepaths}") # Add this line to print the filepaths
|
66 |
+
|
67 |
return [
|
68 |
datasets.SplitGenerator(
|
69 |
name=datasets.Split.TRAIN,
|
|
|
76 |
def _generate_examples(self, filepaths):
|
77 |
for filepath in filepaths:
|
78 |
df = pd.read_parquet(filepath)
|
79 |
+
print(f"Reading file: {filepath}, number of rows: {len(df)}") # Add this line to print the number of row
|
80 |
for idx, row in df.iterrows():
|
81 |
yield idx, {
|
82 |
"text": row["text"],
|