Datasets:
fix
Browse files
govreport-summarization.py
CHANGED
@@ -1,6 +1,6 @@
|
|
1 |
import json
|
2 |
import os
|
3 |
-
|
4 |
import datasets
|
5 |
from datasets.tasks import TextClassification
|
6 |
|
@@ -93,4 +93,7 @@ class GovReportSummarizationDataset(datasets.GeneratorBasedBuilder):
|
|
93 |
data = json.loads(row)
|
94 |
report = data["report"]
|
95 |
summary = data["summary"]
|
|
|
|
|
|
|
96 |
yield id_, {"report": report, "summary": summary}
|
|
|
1 |
import json
|
2 |
import os
|
3 |
+
import re
|
4 |
import datasets
|
5 |
from datasets.tasks import TextClassification
|
6 |
|
|
|
93 |
data = json.loads(row)
|
94 |
report = data["report"]
|
95 |
summary = data["summary"]
|
96 |
+
|
97 |
+
report = re.sub("+ ", " ", report)
|
98 |
+
summary = re.sub("+ ", " ", summary)
|
99 |
yield id_, {"report": report, "summary": summary}
|