Kosuke-Yamada
commited on
Commit
•
9869317
1
Parent(s):
15d9383
specify the encoding method when loading the dataset
Browse files- livedoor-news-corpus.py +4 -12
livedoor-news-corpus.py
CHANGED
@@ -4,17 +4,9 @@ import random
|
|
4 |
from pathlib import Path
|
5 |
from typing import Generator
|
6 |
|
7 |
-
from datasets import (
|
8 |
-
|
9 |
-
|
10 |
-
DownloadManager,
|
11 |
-
Features,
|
12 |
-
GeneratorBasedBuilder,
|
13 |
-
Split,
|
14 |
-
SplitGenerator,
|
15 |
-
Value,
|
16 |
-
Version,
|
17 |
-
)
|
18 |
from datasets.data_files import DataFilesDict
|
19 |
|
20 |
_CITATION = ""
|
@@ -87,7 +79,7 @@ class LivedoorNewsCorpus(GeneratorBasedBuilder):
|
|
87 |
for file_name in sorted(dataset_dir.glob("*/*/*")):
|
88 |
if "LICENSE.txt" in str(file_name):
|
89 |
continue
|
90 |
-
with open(file_name, "r") as f:
|
91 |
d = [line.strip() for line in f]
|
92 |
data.append(
|
93 |
{
|
|
|
4 |
from pathlib import Path
|
5 |
from typing import Generator
|
6 |
|
7 |
+
from datasets import (BuilderConfig, DatasetInfo, DownloadManager, Features,
|
8 |
+
GeneratorBasedBuilder, Split, SplitGenerator, Value,
|
9 |
+
Version)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
10 |
from datasets.data_files import DataFilesDict
|
11 |
|
12 |
_CITATION = ""
|
|
|
79 |
for file_name in sorted(dataset_dir.glob("*/*/*")):
|
80 |
if "LICENSE.txt" in str(file_name):
|
81 |
continue
|
82 |
+
with open(file_name, "r", encoding="utf-8") as f:
|
83 |
d = [line.strip() for line in f]
|
84 |
data.append(
|
85 |
{
|