File size: 1,377 Bytes
5681aba da3bf45 a0f785c 5681aba a0f785c |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 |
---
license: apache-2.0
dataset_info:
features:
- name: title
dtype: string
- name: author
dtype: string
- name: dynasty
dtype: string
- name: theme
dtype: string
- name: section
dtype: string
- name: content
list:
- name: paragraphs
sequence: string
- name: subchapter
dtype: string
- name: appreciation
dtype: string
- name: rhythmic
dtype: string
- name: tags
sequence: string
splits:
- name: train
num_bytes: 100641630
num_examples: 346320
download_size: 66721235
dataset_size: 100641630
language:
- zh
tags:
- poem
size_categories:
- 100K<n<1M
---
# 数据格式定义
```python
from pydantic import BaseModel, Field
class PoemValidator(BaseModel):
title: str = Field(..., description="诗名")
author: str = Field(..., description="作者")
dynasty: str = Field(..., description="朝代")
theme: str = Field(..., description="主题")
section: str = Field(..., description="节名")
content: Union[list[dict[str, Union[str, list[str]]]]] = Field(..., description="诗内容")
appreciation: str = Field(..., description="赏析")
rhythmic: str = Field(..., description="韵律")
tags: list[str] = Field(..., description="标签")
```
# 加载数据集
```python
from datasets import load_dataset
ds = load_dataset("ticoAg/cotinus-poem")
``` |