基于《中国证券报》封面图片与文本的多模态数据集
- 来源媒体:《中国证券报》(新华社主管,证监会指定信息披露媒体)
- 时间范围:2015年1月 - 2025年12月
- 采集方式:从官网每日下载PDF格式封面
使用 DocLayout-YOLO 进行文档布局分析:
investor_sentiment/nodes/extraction/yolo_layout.py
核心功能:
- 将PDF页面转换为图像(PyMuPDF,150 DPI)
- 使用DocLayout-YOLO检测文档元素(标题、正文、图片、表格等)
- 计算边界框距离,关联图片与文本区域
- 基于YOLO检测区域提取文本内容
investor_sentiment/nodes/extraction/extract_core.py
investor_sentiment/nodes/extraction/extract.py
提取流程:
- PyMuPDF 提取图片内容
- PaddleOCR 提取文本内容
- 按日期组织存储
investor_sentiment/nodes/extraction/data_cleaner/
├── data_cleaner_core.py # 清洗流程主控制器
├── image_cleaner.py # 图片清洗器
├── text_cleaner.py # 文本清洗器
├── image_filter_rules.py # 规则筛选
├── image_llm_filter.py # 大模型筛选
└── run_data_cleaner.py # 独立运行入口
两阶段图片筛选:
| 阶段 | 方法 | 说明 |
|---|---|---|
| Stage 1 | 规则筛选 | 文件大小、尺寸、长宽比、格式验证 |
| Stage 2 | 大模型筛选 | 豆包MLLM智能识别财经相关图片 |
清洗规则:
- 文件存在性检查
- 文件大小 > 1KB
- 支持格式:PNG, JPEG, JPG, BMP, GIF
- 最小尺寸 > 10px
- 剔除二维码、标题栏、装饰元素等非新闻配图
CSJ-Multimodal-Dataset/
├── images/ # 图片数据
│ └── {year}/{month}/{day}/ # 按日期组织
│ └── {date}_{page}_img{n}.png
├── texts/ # OCR文本
│ └── {year}/{month}/{day}/ # 按日期组织
│ └── {date}_{page}_img{n}.txt
└── README.md
| 数据类型 | 时间范围 | 数量 |
|---|---|---|
| 图片 | 2015-2025 | 35,074 张 |
| 文本 | 2015-2025 | 35,074 条 |
{YYYY-MM-DD}_{版面}_p{页码}_img{序号}.{ext}
示例:
2015-01-05_A01_p1_img1.png # 2015年1月5日 A01版 第1页 第1张图
2015-01-05_A01_p1_img1.txt # 对应OCR文本
git clone https://github.com/你的用户名/CSJ-Multimodal-Dataset.gitfrom PIL import Image
import os
# 读取单张图片
img_path = 'images/2022/01/01/2022-01-01_A01_p1_img1.png'
img = Image.open(img_path)
# 读取对应文本
txt_path = img_path.replace('images', 'texts').replace('.png', '.txt')
with open(txt_path, 'r', encoding='utf-8') as f:
text = f.read()
print(f"图片尺寸: {img.size}")
print(f"文本内容: {text[:100]}...")本数据集仅供学术研究使用,请勿用于商业目的。
数据来源于《中国证券报》公开出版物,图片版权归原作者及相关机构所有。