Datasets:

srzhang commited on
Commit
7ac72b5
·
1 Parent(s): 4b97e7e
Files changed (1) hide show
  1. LongConL.py +6 -5
LongConL.py CHANGED
@@ -19,7 +19,7 @@ _CONFIGS = {
19
  "description": "Jurisdiction-specific legal opinions",
20
  "features": {
21
  "Citation": datasets.Value("string"),
22
- "Case Name": datasets.Value("string"),
23
  "Opinion Text": datasets.Value("string"),
24
  "Numerical Label": datasets.Value("string", id=None), # Will be optional for some tasks
25
  "Text Label": datasets.Value("string"),
@@ -29,7 +29,7 @@ _CONFIGS = {
29
  "description": "Description for other task 1",
30
  "features": {
31
  "Citation": datasets.Value("string"),
32
- "Case Name": datasets.Value("string"),
33
  "Opinion Text": datasets.Value("string"),
34
  "Numerical Label": datasets.Value("string", id=None),
35
  "Text Label": datasets.Value("string"),
@@ -45,7 +45,7 @@ class LongConLDataset(datasets.GeneratorBasedBuilder):
45
  """Return dataset information."""
46
  features = datasets.Features({
47
  "Citation": datasets.Value("string"),
48
- "Case Name": datasets.Value("string"),
49
  "Opinion Text": datasets.Value("string"),
50
  "Numerical Label": datasets.Value("string"), # Will be optional for some tasks
51
  "Text Label": datasets.Value("string"),
@@ -85,11 +85,12 @@ class LongConLDataset(datasets.GeneratorBasedBuilder):
85
  print("Data loaded from file:", file_path)
86
  print(data.head()) # Display first few rows
87
  data_dict = data.to_dict(orient="records")
88
-
 
89
  for id_, row in enumerate(data_dict):
90
  yield id_, {
91
  "Citation": row["Citation"],
92
- "Case Name": row["Case Name"],
93
  "Opinion Text": row["Opinion Text"],
94
  "Numerical Label": row.get("Numerical Label", None), # Use .get() to handle missing keys
95
  "Text Label": row["Text Label"],
 
19
  "description": "Jurisdiction-specific legal opinions",
20
  "features": {
21
  "Citation": datasets.Value("string"),
22
+ "Full Case Name": datasets.Value("string"),
23
  "Opinion Text": datasets.Value("string"),
24
  "Numerical Label": datasets.Value("string", id=None), # Will be optional for some tasks
25
  "Text Label": datasets.Value("string"),
 
29
  "description": "Description for other task 1",
30
  "features": {
31
  "Citation": datasets.Value("string"),
32
+ "Full Case Name": datasets.Value("string"),
33
  "Opinion Text": datasets.Value("string"),
34
  "Numerical Label": datasets.Value("string", id=None),
35
  "Text Label": datasets.Value("string"),
 
45
  """Return dataset information."""
46
  features = datasets.Features({
47
  "Citation": datasets.Value("string"),
48
+ "Full Case Name": datasets.Value("string"),
49
  "Opinion Text": datasets.Value("string"),
50
  "Numerical Label": datasets.Value("string"), # Will be optional for some tasks
51
  "Text Label": datasets.Value("string"),
 
85
  print("Data loaded from file:", file_path)
86
  print(data.head()) # Display first few rows
87
  data_dict = data.to_dict(orient="records")
88
+ print(f"Number of examples to generate: {len(data_dict)}")
89
+
90
  for id_, row in enumerate(data_dict):
91
  yield id_, {
92
  "Citation": row["Citation"],
93
+ "Full Case Name": row["Full Case Name"],
94
  "Opinion Text": row["Opinion Text"],
95
  "Numerical Label": row.get("Numerical Label", None), # Use .get() to handle missing keys
96
  "Text Label": row["Text Label"],