metadata
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
数据格式定义
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="标签")
加载数据集
from datasets import load_dataset
ds = load_dataset("ticoAg/cotinus-poem")