Vu Anh commited on
Commit
6ffef05
·
1 Parent(s): 8fc4e4f
Files changed (1) hide show
  1. UTS2017_Bank.py +59 -0
UTS2017_Bank.py ADDED
@@ -0,0 +1,59 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import datasets
2
+
3
+ _DESCRIPTION = """\
4
+ UTS2017_Bank
5
+ """
6
+
7
+ _CITATION = """\
8
+ """
9
+
10
+
11
+ class UTS2017Bank(datasets.GeneratorBasedBuilder):
12
+ """UTS Word Tokenize datasets"""
13
+ VERSION = datasets.Version("1.0.0")
14
+
15
+ def _info(self):
16
+ return datasets.DatasetInfo(
17
+ description=_DESCRIPTION,
18
+ features=datasets.Features(
19
+ {
20
+ "text": datasets.Value("string"),
21
+ }
22
+ ),
23
+ supervised_keys=None,
24
+ homepage=None,
25
+ citation=_CITATION
26
+ )
27
+
28
+ def _split_generators(self, dl_manager):
29
+ """Returns SplitGenerators."""
30
+
31
+ # Sample texts for train and test
32
+ train_texts = [
33
+ "Ngân hàng Nhà nước Việt Nam",
34
+ "Tài khoản tiết kiệm lãi suất cao"
35
+ ]
36
+
37
+ test_texts = [
38
+ "Chuyển khoản nhanh 24/7",
39
+ "Vay tín chấp không thế chấp"
40
+ ]
41
+
42
+ splits = [
43
+ datasets.SplitGenerator(
44
+ name=datasets.Split.TRAIN,
45
+ gen_kwargs={"texts": train_texts}
46
+ ),
47
+ datasets.SplitGenerator(
48
+ name=datasets.Split.TEST,
49
+ gen_kwargs={"texts": test_texts}
50
+ )
51
+ ]
52
+ return splits
53
+
54
+ def _generate_examples(self, texts):
55
+ for guid, text in enumerate(texts):
56
+ item = {
57
+ "text": text
58
+ }
59
+ yield guid, item