Initial commit
Browse files- data/label.txt +7 -0
- data/test.tsv +10 -0
- data/train.tsv +0 -0
- data/valid.tsv +0 -0
- klue-tc-tsv.py +50 -0
data/label.txt
ADDED
@@ -0,0 +1,7 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
์ ์น
|
2 |
+
์ธ๊ณ
|
3 |
+
IT๊ณผํ
|
4 |
+
์คํฌ์ธ
|
5 |
+
์ฌํ
|
6 |
+
๊ฒฝ์
|
7 |
+
์ํ๋ฌธํ
|
data/test.tsv
ADDED
@@ -0,0 +1,10 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
5์ต์ ๋ฌด์ด์ ์ต์๋ ๋๊ณ 7์ฒ๋ง์ ์ด์ฌ๋น๋ ์๋๋ค ์ฌํ
|
2 |
+
์ ์์์ถฉ์ ์๋ง ๋ ๋ฉ๋ฆฌ ๋จ์ด์ ธ์ผ ํ๋ ํ๊ฒฝ์ฐ ๊ท์ ๊ฐํ ๊ฑด์ ์ฌํ
|
3 |
+
ํญ์๊ณ ์ ์ฑ๋ถ ์ฝ๋ก๋19์ ํจ๊ณผโฆ์ธํฌ์คํ์ ํ์ธ IT๊ณผํ
|
4 |
+
์ค๊ฑฐ๋๊ฐ ๊ฐ์ฅ ๋น์ผ ์ญ์ธ๊ถ์ ์ ๋ฐํฌ์ญโฆ3.3ใก๋น 1์ต ์ก๋ฐ ๊ฒฝ์
|
5 |
+
๊ธฐ์ํ๊ฒฌ ํ๋ ์ฑ ์์์ ๋จ์ฒด ์ฌํ
|
6 |
+
๋ชจ์์ ๊ฑฐ ๊ต์ก ๋ถํ ์ ๊ด์ยท๊ต์ก๋ถ ๊ฐ์ฑํ๋ผ ์ฌํ
|
7 |
+
๋ฎค์ง์ปฌ ์์
ํฉ๋ฅํ ์์ฌ์ฑ ์ ์ฑํ์ ๋ค๋ฅธ ์์ค๊ทผ ๋ณด์ฌ์ค๊ฒ ์ํ๋ฌธํ
|
8 |
+
๊ฐ์ง๋ด์ค ์ง๋ฒ์ ์ํด๋ฐฐ์์ ๋ ๋์
๋ณํ ํ ๋ก ํ ์ฌํ
|
9 |
+
MBN ๋
ธ์กฐ ๋ถ๋์ฐ ๋ฌผ์ ๋ถํ ์ค๋จํ๊ณ ์์ ๊ฒฝ์ ๋ถ๋ฆฌํด์ผ ์ฌํ
|
10 |
+
ํฌ์ค์ฝ๊ฑด์ค 11๋
๋ง์ ๋ ์ต ๋ธ๋๋ ๋ก๊ณ ๊ต์ฒด ๊ฒฝ์
|
data/train.tsv
ADDED
The diff for this file is too large to render.
See raw diff
|
|
data/valid.tsv
ADDED
The diff for this file is too large to render.
See raw diff
|
|
klue-tc-tsv.py
ADDED
@@ -0,0 +1,50 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
from __future__ import absolute_import, division, print_function
|
2 |
+
import datasets
|
3 |
+
_URL = "data/"
|
4 |
+
_URLs = {
|
5 |
+
"train": _URL + "train.tsv",
|
6 |
+
"valid": _URL + "valid.tsv",
|
7 |
+
"test": _URL + "test.tsv",
|
8 |
+
}
|
9 |
+
class KlueTC(datasets.GeneratorBasedBuilder):
|
10 |
+
def _info(self):
|
11 |
+
return datasets.DatasetInfo(
|
12 |
+
description="KLUE Topic Classification",
|
13 |
+
features=datasets.Features(
|
14 |
+
{
|
15 |
+
"text": datasets.Value("string"),
|
16 |
+
"label": datasets.features.ClassLabel(names=['์ ์น', '์ธ๊ณ', 'IT๊ณผํ', '์คํฌ์ธ ', '์ฌํ', '๊ฒฝ์ ', '์ํ๋ฌธํ']),
|
17 |
+
}
|
18 |
+
),
|
19 |
+
supervised_keys=None,
|
20 |
+
license="",
|
21 |
+
homepage="",
|
22 |
+
citation="",
|
23 |
+
)
|
24 |
+
def _split_generators(self, dl_manager):
|
25 |
+
downloaded_files = dl_manager.download_and_extract(_URLs)
|
26 |
+
return [
|
27 |
+
datasets.SplitGenerator(
|
28 |
+
name=datasets.Split.TRAIN,
|
29 |
+
gen_kwargs={
|
30 |
+
"filepath": downloaded_files["train"],
|
31 |
+
}
|
32 |
+
),
|
33 |
+
datasets.SplitGenerator(
|
34 |
+
name=datasets.Split.VALIDATION,
|
35 |
+
gen_kwargs={
|
36 |
+
"filepath": downloaded_files["valid"],
|
37 |
+
}
|
38 |
+
),
|
39 |
+
datasets.SplitGenerator(
|
40 |
+
name=datasets.Split.TEST,
|
41 |
+
gen_kwargs={
|
42 |
+
"filepath": downloaded_files["test"],
|
43 |
+
}
|
44 |
+
),
|
45 |
+
]
|
46 |
+
def _generate_examples(self, filepath):
|
47 |
+
with open(filepath, "r", encoding='ISO-8859-1') as f:
|
48 |
+
for idx, line in enumerate(f):
|
49 |
+
text, label = line.split("\t")
|
50 |
+
yield idx, {"text": text.strip(), "label": label.strip()}
|