open files with latin-1 encoding
#1
by
davanstrien
HF staff
- opened
- lancaster_newsbooks.py +1 -1
lancaster_newsbooks.py
CHANGED
@@ -91,7 +91,7 @@ class LancasterNewsbooks(datasets.GeneratorBasedBuilder):
|
|
91 |
for subdir in data_dirs:
|
92 |
for file in glob.glob(os.path.join(subdir, "*.xml")):
|
93 |
text_parts = []
|
94 |
-
with open(file, "r") as fp:
|
95 |
soup = BeautifulSoup(fp, features="xml")
|
96 |
title = soup.find("title").text
|
97 |
id = soup.newsbookDoc.attrs["id"]
|
|
|
91 |
for subdir in data_dirs:
|
92 |
for file in glob.glob(os.path.join(subdir, "*.xml")):
|
93 |
text_parts = []
|
94 |
+
with open(file, "r", encoding="latin-1") as fp:
|
95 |
soup = BeautifulSoup(fp, features="xml")
|
96 |
title = soup.find("title").text
|
97 |
id = soup.newsbookDoc.attrs["id"]
|