akeyhero commited on
Commit
541e4cc
1 Parent(s): e6f263d

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +38 -0
README.md CHANGED
@@ -12,6 +12,8 @@ size_categories:
12
  # Overview
13
  This dataset provides a convenient and user-friendly format of data from [Aozora Bunko (青空文庫)](https://www.aozora.gr.jp/), a website that compiles public-domain books in Japan, ideal for Machine Learning applications.
14
 
 
 
15
  # Methodology
16
 
17
  The code to reproduce this dataset is made available on GitHub: [globis-org/aozorabunko-exctractor](https://github.com/globis-org/aozorabunko-extractor).
@@ -41,5 +43,41 @@ The data in the `text` field was then cleaned in the following sequence:
41
 
42
  If you prefer to employ only modern Japanese, you can filter entries with: `row["meta"]["文字遣い種別"] == "新字新仮名"`.
43
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
44
  # License
45
  CC BY 4.0
 
12
  # Overview
13
  This dataset provides a convenient and user-friendly format of data from [Aozora Bunko (青空文庫)](https://www.aozora.gr.jp/), a website that compiles public-domain books in Japan, ideal for Machine Learning applications.
14
 
15
+ [For Japanese] 日本語での概要説明を Qiita に記載しました: https://qiita.com/akeyhero/items/b53eae1c0bc4d54e321f
16
+
17
  # Methodology
18
 
19
  The code to reproduce this dataset is made available on GitHub: [globis-org/aozorabunko-exctractor](https://github.com/globis-org/aozorabunko-extractor).
 
43
 
44
  If you prefer to employ only modern Japanese, you can filter entries with: `row["meta"]["文字遣い種別"] == "新字新仮名"`.
45
 
46
+ # Example
47
+
48
+ ```py
49
+ >>> from datasets import load_dataset
50
+ >>> ds = load_dataset('globis-university/aozorabunko-clean')
51
+ >>> ds
52
+ DatasetDict({
53
+ train: Dataset({
54
+ features: ['text', 'footnote', 'meta'],
55
+ num_rows: 16951
56
+ })
57
+ })
58
+ >>> ds = ds.filter(lambda row: row['meta']['文字遣い種別'] == '新字新仮名') # only modern Japanese
59
+ >>> ds
60
+ DatasetDict({
61
+ train: Dataset({
62
+ features: ['text', 'footnote', 'meta'],
63
+ num_rows: 10246
64
+ })
65
+ })
66
+ >>> book = ds['train'][0] # one of works
67
+ >>> book['meta']['作品名']
68
+ 'ウェストミンスター寺院'
69
+ >>> text = book['text'] # main content
70
+ >>> len(text)
71
+ 10639
72
+ >>> print(text[:100])
73
+ 深いおどろきにうたれて、
74
+ 名高いウェストミンスターに
75
+ 真鍮や石の記念碑となって
76
+ すべての王侯貴族が集まっているのをみれば、
77
+ 今はさげすみも、ほこりも、見栄もない。
78
+ 善にかえった貴人の姿、
79
+ 華美と俗世の
80
+ ```
81
+
82
  # License
83
  CC BY 4.0