Update README.md
Browse files
README.md
CHANGED
@@ -12,6 +12,8 @@ size_categories:
|
|
12 |
# Overview
|
13 |
This dataset is of conversations extracted from [Aozora Bunko (青空文庫)](https://www.aozora.gr.jp/), which collects public-domain books in Japan, using a simple heuristic approach.
|
14 |
|
|
|
|
|
15 |
# Method
|
16 |
First, lines surrounded by quotation mark pairs (`「」`) are extracted as utterances from the `text` field of [globis-university/aozorabunko-clean](https://huggingface.co/datasets/globis-university/aozorabunko-clean).
|
17 |
Then, consecutive utterances are collected and grouped together.
|
@@ -24,5 +26,40 @@ As the conversations are extracted using a simple heuristic, a certain amount of
|
|
24 |
# Tips
|
25 |
If you prefer to employ only modern Japanese, you can filter entries with: `row["meta"]["文字遣い種別"] == "新字新仮名"`.
|
26 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
27 |
# License
|
28 |
CC BY 4.0
|
|
|
12 |
# Overview
|
13 |
This dataset is of conversations extracted from [Aozora Bunko (青空文庫)](https://www.aozora.gr.jp/), which collects public-domain books in Japan, using a simple heuristic approach.
|
14 |
|
15 |
+
[For Japanese] 日本語での概要説明を Qiita に記載しました: https://qiita.com/akeyhero/items/b53eae1c0bc4d54e321f
|
16 |
+
|
17 |
# Method
|
18 |
First, lines surrounded by quotation mark pairs (`「」`) are extracted as utterances from the `text` field of [globis-university/aozorabunko-clean](https://huggingface.co/datasets/globis-university/aozorabunko-clean).
|
19 |
Then, consecutive utterances are collected and grouped together.
|
|
|
26 |
# Tips
|
27 |
If you prefer to employ only modern Japanese, you can filter entries with: `row["meta"]["文字遣い種別"] == "新字新仮名"`.
|
28 |
|
29 |
+
# Example
|
30 |
+
|
31 |
+
```py
|
32 |
+
>>> from datasets import load_dataset
|
33 |
+
>>> ds = load_dataset('globis-university/aozorabunko-chats')
|
34 |
+
>>> ds
|
35 |
+
DatasetDict({
|
36 |
+
train: Dataset({
|
37 |
+
features: ['chats', 'footnote', 'meta'],
|
38 |
+
num_rows: 5531
|
39 |
+
})
|
40 |
+
})
|
41 |
+
>>> ds = ds.filter(lambda row: row['meta']['文字遣い種別'] == '新字新仮名') # only modern Japanese
|
42 |
+
>>> ds
|
43 |
+
DatasetDict({
|
44 |
+
train: Dataset({
|
45 |
+
features: ['chats', 'footnote', 'meta'],
|
46 |
+
num_rows: 4139
|
47 |
+
})
|
48 |
+
})
|
49 |
+
>>> book = ds['train'][0] # one of the works
|
50 |
+
>>> book['meta']['作品名']
|
51 |
+
'スリーピー・ホローの伝説'
|
52 |
+
>>> chats = book['chats'] # list of the chats in the work; type: list[list[str]]
|
53 |
+
>>> len(chats)
|
54 |
+
1
|
55 |
+
>>> chat = chats[0] # one of the chats; type: list[str]
|
56 |
+
>>> for utterance in chat:
|
57 |
+
... print(utterance)
|
58 |
+
...
|
59 |
+
人生においては、たとえどんな場合でも必ず利点や愉快なことがあるはずです。もっともそれは、わたくしどもが冗談をすなおに受けとればのことですが
|
60 |
+
そこで、悪魔の騎士と競走することになった人は、とかくめちゃくちゃに走るのも当然です
|
61 |
+
したがって、田舎の学校の先生がオランダ人の世継ぎ娘に結婚を拒まれるということは、彼にとっては、世の中で栄進出世にいたるたしかな一歩だということになります
|
62 |
+
```
|
63 |
+
|
64 |
# License
|
65 |
CC BY 4.0
|