Datasets:

srzhang commited on
Commit
2fcb3cb
·
verified ·
1 Parent(s): 24a46eb

Update LongConL.py

Browse files
Files changed (1) hide show
  1. LongConL.py +7 -7
LongConL.py CHANGED
@@ -9,9 +9,9 @@ _LICENSE = ""
9
 
10
  # Updated URLs to dynamically handle task names
11
  _URLS = {
12
- "train": "data/LongConL-tasks-subsample/{task_name}/{task_name}_subsample_train.csv",
13
- "validation": "data/LongConL-tasks-subsample/{task_name}/{task_name}_subsample_val.csv",
14
- "test": "data/LongConL-tasks-subsample/{task_name}/{task_name}_subsample_test.csv",
15
  }
16
 
17
  TASK_NAMES = [
@@ -35,7 +35,7 @@ _CONFIGS = {
35
  "Opinion Text": datasets.Value("string"),
36
  "Numerical Label": datasets.Value("string"), # Will be optional for some tasks
37
  "Text Label": datasets.Value("string"), # Will be optional for some tasks
38
- #"Syllabus": datasets.Value("string") # Will be optional for some tasks
39
  },
40
  }
41
  for task_name in TASK_NAMES
@@ -54,7 +54,7 @@ class LongConLDataset(datasets.GeneratorBasedBuilder):
54
  "Opinion Text": datasets.Value("string"),
55
  "Numerical Label": datasets.Value("string"), # Will be optional for some tasks
56
  "Text Label": datasets.Value("string"), # Will be optional for some tasks
57
- #"Syllabus": datasets.Value("string") # Will be optional for some tasks
58
  })
59
  return datasets.DatasetInfo(
60
  description=_DESCRIPTION,
@@ -70,7 +70,7 @@ class LongConLDataset(datasets.GeneratorBasedBuilder):
70
  valid_task_name = task_name.replace("-", "_") # Replace hyphens with underscores
71
 
72
  # Update URLs with the valid task name
73
- urls = {key: val.format(task_name=valid_task_name) for key, val in _URLS.items()}
74
  downloaded_files = dl_manager.download_and_extract(urls)
75
 
76
  return [
@@ -104,7 +104,7 @@ class LongConLDataset(datasets.GeneratorBasedBuilder):
104
  "Opinion Text": row["Opinion Text"],
105
  "Numerical Label": row.get("Numerical Label", None), # Use .get() to handle missing keys
106
  "Text Label": row["Text Label"],
107
- #"Syllabus": row["Syllabus"]
108
  }
109
 
110
  # Use a dynamic config
 
9
 
10
  # Updated URLs to dynamically handle task names
11
  _URLS = {
12
+ "train": "data/LongConL-tasks-syllabus/{task_name}/{task_name}_with_syllabus_filtered_date_token_train.csv",
13
+ "validation": "data/LongConL-tasks-syllabus/{task_name}/{task_name}_with_syllabus_filtered_date_token_val.csv",
14
+ "test": "data/LongConL-tasks-syllabus/{task_name}/{task_name}_with_syllabus_filtered_date_token_test.csv",
15
  }
16
 
17
  TASK_NAMES = [
 
35
  "Opinion Text": datasets.Value("string"),
36
  "Numerical Label": datasets.Value("string"), # Will be optional for some tasks
37
  "Text Label": datasets.Value("string"), # Will be optional for some tasks
38
+ "Syllabus": datasets.Value("string") # Will be optional for some tasks
39
  },
40
  }
41
  for task_name in TASK_NAMES
 
54
  "Opinion Text": datasets.Value("string"),
55
  "Numerical Label": datasets.Value("string"), # Will be optional for some tasks
56
  "Text Label": datasets.Value("string"), # Will be optional for some tasks
57
+ "Syllabus": datasets.Value("string") # Will be optional for some tasks
58
  })
59
  return datasets.DatasetInfo(
60
  description=_DESCRIPTION,
 
70
  valid_task_name = task_name.replace("-", "_") # Replace hyphens with underscores
71
 
72
  # Update URLs with the valid task name
73
+ urls = {key: val.format(task_name=task_name) for key, val in _URLS.items()}
74
  downloaded_files = dl_manager.download_and_extract(urls)
75
 
76
  return [
 
104
  "Opinion Text": row["Opinion Text"],
105
  "Numerical Label": row.get("Numerical Label", None), # Use .get() to handle missing keys
106
  "Text Label": row["Text Label"],
107
+ "Syllabus": row["Syllabus"]
108
  }
109
 
110
  # Use a dynamic config