Datasets:
|
Download README_zh.md from OpenMOSS-Team/LongLongTextBench: direct link, hf CLI and curl.
- Browser
- Download file 4.35 kB
-
https://huggingface.co/datasets/OpenMOSS-Team/LongLongTextBench/resolve/main/README_zh.md
- Command line
-
hf download hf://datasets/OpenMOSS-Team/LongLongTextBench/README_zh.md
-
curl -L -o README_zh.md https://huggingface.co/datasets/OpenMOSS-Team/LongLongTextBench/resolve/main/README_zh.md
4.35 kB
| # LongLongTextBench (LLTB) | |
| [English](README.md) | **简体中文** | |
| LLTB 是 [MOSS-Image](https://github.com/OpenMOSS/MOSS-Image) 项目用于评估生成图像中中英文长文本渲染能力的基准,包含 **240 条提示词**,英文和中文各 120 条。每条提示词要求生成包含标题、作者和文学节选的页面。 | |
| 我们遵循 [X-Omni 的 LongText-Bench](https://huggingface.co/datasets/X-Omni/LongText-Bench) 评测设置:每条提示词生成四张图像,通过 OCR 计算文本覆盖率。 | |
| ## 数据集 | |
| | 语言 | 长度组 | 提示词数量 | 目标文本长度 | 单位 | | |
| |---|---|---:|---:|---| | |
| | 英文 | short | 40 | 69–93 | 单词 | | |
| | 英文 | medium | 40 | 191–246 | 单词 | | |
| | 英文 | long | 40 | 470–570 | 单词 | | |
| | 中文 | short | 40 | 330–393 | 字符 | | |
| | 中文 | medium | 40 | 923–1,078 | 字符 | | |
| | 中文 | long | 40 | 1,284–1,601 | 字符 | | |
| 上表长度按计分归一化后的标题、作者和正文统计。每个语言与长度组合包含 20 条 `classical` 和 20 条 `modern` 节选。240 条提示词来自 80 段节选,每段对应三个长度版本。 | |
| ## 加载数据 | |
| ```bash | |
| pip install datasets | |
| ``` | |
| ```python | |
| from datasets import load_dataset | |
| ds = load_dataset("OpenMOSS-Team/LongLongTextBench", "default", split="test") | |
| prompt = ds[0]["prompt"] | |
| ground_truth = ds[0]["gt_text"] | |
| ``` | |
| `default`、`en` 和 `zh` 配置的 `test` 划分分别包含 240、120 和 120 条数据。 | |
| | 字段 | 含义 | | |
| |---|---| | |
| | `prompt_id`, `sample_id` | 数值与描述性任务标识 | | |
| | `language` | `en` 或 `zh` | | |
| | `style` | `classical` 或 `modern` | | |
| | `length` | `short`、`medium` 或 `long` | | |
| | `prompt` | 完整生成输入,包含指令与换行 | | |
| | `gt_text` | 用于计分的目标标题、作者和正文 | | |
| | `text` | 包含 `gt_text` 的单元素列表 | | |
| | `text_length`, `text_length_unit` | 归一化后的目标长度及单位(`word` 或 `character`) | | |
| | `title`, `author` | 标题和作者署名 | | |
| ## 生成图像 | |
| 使用 Python 3.10+ 和 Pillow,在仓库根目录运行: | |
| ```bash | |
| python evaluation/bench.py export --output jobs.jsonl --n-samples 4 --seed 42 | |
| python evaluation/local_inference.py --adapter my_adapter:generate \ | |
| --jobs jobs.jsonl --images images | |
| ``` | |
| 导出结果包含 960 个任务,每个任务提供完整提示词、图像尺寸、种子和输出文件名。在 `my_adapter.py` 中提供 `generate(*, prompt, seed, width, height)`,返回一张 PIL 图像。生成画布为 1024×1024,图像保存为 `images/<prompt_id>/samples/<sample_index>.png`,两个编号均补零至五位。 | |
| ## 评测 | |
| 使用兼容 CUDA 的 PyTorch/torchvision 环境,以及本地 [Qwen2.5-VL-7B-Instruct](https://huggingface.co/Qwen/Qwen2.5-VL-7B-Instruct) 模型: | |
| ```bash | |
| python -m pip install -r evaluation/requirements.txt | |
| python evaluation/bench.py check --images images --n-samples 4 | |
| python evaluation/bench.py score \ | |
| --images images --output score \ | |
| --ocr-model /path/to/Qwen2.5-VL-7B-Instruct \ | |
| --workers 1 --n-samples 4 | |
| ``` | |
| OCR 使用经 LANCZOS 缩放至 1024×1024 的 RGB 图像,输出上限为 4,096 tokens。覆盖率将归一化后的目标文本与 OCR 文本按多重集匹配:英文按单词计数,中文按字符计数,重复单位最多计入其在目标文本中出现的次数。 | |
| ```text | |
| matched = sum_u min(count_target(u), count_ocr(u)) | |
| group coverage = sum_image(matched) / sum_image(target_units) | |
| Mean-6 = mean(EN-short, EN-medium, EN-long, ZH-short, ZH-medium, ZH-long) | |
| ``` | |
| 主要结果为 `score/summary.json` 中的 `macro_overall_mean6`,即六个语言与长度组分数的平均值。分数范围为 0 到 1。逐图像 OCR 和分数保存在 `score/en/results.jsonl` 与 `score/zh/results.jsonl`。其他选项见[评测用法](evaluation/README.md)。 | |
| ## 引用 | |
| 使用 LLTB 时,请引用 [MOSS-Image 技术报告](https://arxiv.org/abs/2610.23374): | |
| ```bibtex | |
| @misc{ai2026mossimagetechnicalreport, | |
| title={MOSS-Image Technical Report}, | |
| author={MOSI. AI}, | |
| year={2026}, | |
| eprint={2610.23374}, | |
| archivePrefix={arXiv}, | |
| primaryClass={cs.CV}, | |
| url={https://arxiv.org/abs/2610.23374}, | |
| } | |
| ``` | |
| ## 许可证 | |
| 评测工具采用 [Apache-2.0](CODE_LICENSE),并保留所附 [X-Omni 许可证](evaluation/vendor/X-Omni-LICENSE)。文本署名及许可范围见 [LICENSE.md](LICENSE.md)。 | |