Explorar el Código

feat: rename the file generated by command line tools (#401)

* feat: rename the file generated by command line tools

* feat: add pdf filename as prefix to {span,layout,model}.pdf

---------

Co-authored-by: icecraft <tmortred@gmail.com>
Co-authored-by: icecraft <xurui1@pjlab.org.cn>
icecraft hace 1 año
padre
commit
c9a51491a4

+ 43 - 24
README.md

@@ -5,6 +5,7 @@
 </p>
 
 <!-- icon -->
+
 [![stars](https://img.shields.io/github/stars/opendatalab/MinerU.svg)](https://github.com/opendatalab/MinerU)
 [![forks](https://img.shields.io/github/forks/opendatalab/MinerU.svg)](https://github.com/opendatalab/MinerU)
 [![open issues](https://img.shields.io/github/issues-raw/opendatalab/MinerU)](https://github.com/opendatalab/MinerU/issues)
@@ -15,14 +16,17 @@
 <a href="https://trendshift.io/repositories/11174" target="_blank"><img src="https://trendshift.io/api/badge/repositories/11174" alt="opendatalab%2FMinerU | Trendshift" style="width: 250px; height: 55px;" width="250" height="55"/></a>
 
 <!-- language -->
+
 [English](README.md) | [简体中文](README_zh-CN.md)
 
 <!-- hot link -->
+
 <p align="center">
 <a href="https://github.com/opendatalab/PDF-Extract-Kit">PDF-Extract-Kit: High-Quality PDF Extraction Toolkit</a>🔥🔥🔥
 </p>
 
 <!-- join us -->
+
 <p align="center">
     👋 join us on <a href="https://discord.gg/Tdedn9GTXq" target="_blank">Discord</a> and <a href="https://cdn.vansin.top/internlm/mineru.jpg" target="_blank">WeChat</a>
 </p>
@@ -30,11 +34,13 @@
 </div>
 
 # Changelog
+
 - 2024/08/09: Version 0.7.0b1 released, simplified installation process, added table recognition functionality
 - 2024/08/01: Version 0.6.2b1 released, optimized dependency conflict issues and installation documentation
 - 2024/07/05: Initial open-source release
 
 <!-- TABLE OF CONTENT -->
+
 <details open="open">
   <summary><h2 style="display: inline-block">Table of Contents</h2></summary>
   <ol>
@@ -73,10 +79,10 @@
   </ol>
 </details>
 
-
-
 # MinerU
+
 ## Project Introduction
+
 MinerU is a tool that converts PDFs into machine-readable formats (e.g., markdown, JSON), allowing for easy extraction into any format.
 MinerU was born during the pre-training process of [InternLM](https://github.com/InternLM/InternLM). We focus on solving symbol conversion issues in scientific literature and hope to contribute to technological development in the era of large models.
 Compared to well-known commercial products, MinerU is still young. If you encounter any issues or if the results are not as expected, please submit an issue on [issue](https://github.com/opendatalab/MinerU/issues) and **attach the relevant PDF**.
@@ -100,6 +106,7 @@ https://github.com/user-attachments/assets/4bea02c9-6d54-4cd6-97ed-dff14340982c
 If you encounter any installation issues, please first consult the <a href="#faq">FAQ</a>. </br>
 If the parsing results are not as expected, refer to the <a href="#known-issues">Known Issues</a>. </br>
 There are three different ways to experience MinerU:
+
 - [Online Demo (No Installation Required)](#online-demo)
 - [Quick CPU Demo (Windows, Linux, Mac)](#quick-cpu-demo)
 - [Linux/Windows + CUDA](#Using-GPU)
@@ -168,33 +175,41 @@ In non-mainline environments, due to the diversity of hardware and software conf
 ### Quick CPU Demo
 
 #### 1. Install magic-pdf
+
 ```bash
 conda create -n MinerU python=3.10
 conda activate MinerU
 pip install magic-pdf[full]==0.7.0b1 --extra-index-url https://wheels.myhloli.com
 ```
+
 #### 2. Download model weight files
 
 Refer to [How to Download Model Files](docs/how_to_download_models_en.md) for detailed instructions.
+
 > ❗️After downloading the models, please make sure to verify the completeness of the model files.
-> 
+>
 > Check if the model file sizes match the description on the webpage. If possible, use sha256 to verify the integrity of the files.
 
 #### 3. Copy and configure the template file
+
 You can find the `magic-pdf.template.json` template configuration file in the root directory of the repository.
+
 > ❗️Make sure to execute the following command to copy the configuration file to your **user directory**; otherwise, the program will not run.
-> 
+>
 > The user directory for Windows is `C:\Users\YourUsername`, for Linux it is `/home/YourUsername`, and for macOS it is `/Users/YourUsername`.
+
 ```bash
 cp magic-pdf.template.json ~/magic-pdf.json
 ```
 
 Find the `magic-pdf.json` file in your user directory and configure the "models-dir" path to point to the directory where the model weight files were downloaded in [Step 2](#2-download-model-weight-files).
+
 > ❗️Make sure to correctly configure the **absolute path** to the model weight files directory, otherwise the program will not run because it can't find the model files.
 >
 > On Windows, this path should include the drive letter and all backslashes (`\`) in the path should be replaced with forward slashes (`/`) to avoid syntax errors in the JSON file due to escape sequences.
-> 
+>
 > For example: If the models are stored in the "models" directory at the root of the D drive, the "model-dir" value should be `D:/models`.
+
 ```json
 {
   // other config
@@ -206,14 +221,13 @@ Find the `magic-pdf.json` file in your user directory and configure the "models-
 }
 ```
 
-
 ### Using GPU
+
 If your device supports CUDA and meets the GPU requirements of the mainline environment, you can use GPU acceleration. Please select the appropriate guide based on your system:
 
 - [Ubuntu 22.04 LTS + GPU](docs/README_Ubuntu_CUDA_Acceleration_en_US.md)
 - [Windows 10/11 + GPU](docs/README_Windows_CUDA_Acceleration_en_US.md)
 
-
 ## Usage
 
 ### Command Line
@@ -226,12 +240,12 @@ Options:
   -v, --version                display the version and exit
   -p, --path PATH              local pdf filepath or directory  [required]
   -o, --output-dir TEXT        output local directory
-  -m, --method [ocr|txt|auto]  the method for parsing pdf.  
+  -m, --method [ocr|txt|auto]  the method for parsing pdf.
                                ocr: using ocr technique to extract information from pdf,
                                txt: suitable for the text-based pdf only and outperform ocr,
                                auto: automatically choose the best method for parsing pdf
                                   from ocr and txt.
-                               without method specified, auto will be used by default. 
+                               without method specified, auto will be used by default.
   --help                       Show this message and exit.
 
 
@@ -246,13 +260,13 @@ magic-pdf -p {some_pdf} -o {some_output_dir} -m auto
 The results will be saved in the `{some_output_dir}` directory. The output file list is as follows:
 
 ```text
-├── some_pdf.md                 # markdown file
-├── images                      # directory for storing images
-├── layout.pdf                  # layout diagram
-├── middle.json                 # MinerU intermediate processing result
-├── model.json                  # model inference result
-├── origin.pdf                  # original PDF file
-└── spans.pdf                   # smallest granularity bbox position information diagram
+├── some_pdf.md                          # markdown file
+├── images                               # directory for storing images
+├── some_pdf_layout.pdf                  # layout diagram
+├── some_pdf_middle.json                 # MinerU intermediate processing result
+├── some_pdf_model.json                  # model inference result
+├── some_pdf_origin.pdf                  # original PDF file
+└── some_pdf_spans.pdf                   # smallest granularity bbox position information diagram
 ```
 
 For more information about the output files, please refer to the [Output File Description](docs/output_file_en_us.md).
@@ -260,6 +274,7 @@ For more information about the output files, please refer to the [Output File De
 ### API
 
 Processing files from local disk
+
 ```python
 image_writer = DiskReaderWriter(local_image_dir)
 image_dir = str(os.path.basename(local_image_dir))
@@ -272,6 +287,7 @@ md_content = pipe.pipe_mk_markdown(image_dir, drop_mode="none")
 ```
 
 Processing files from object storage
+
 ```python
 s3pdf_cli = S3ReaderWriter(pdf_ak, pdf_sk, pdf_endpoint)
 image_dir = "s3://img_bucket/"
@@ -286,10 +302,10 @@ md_content = pipe.pipe_mk_markdown(image_dir, drop_mode="none")
 ```
 
 For detailed implementation, refer to:
+
 - [demo.py Simplest Processing Method](demo/demo.py)
 - [magic_pdf_parse_main.py More Detailed Processing Workflow](demo/magic_pdf_parse_main.py)
 
-
 ### Development Guide
 
 TODO
@@ -305,6 +321,7 @@ TODO
 - [ ] Geometric shape recognition
 
 # Known Issues
+
 - Reading order is segmented based on rules, which can cause disordered sequences in some cases
 - Vertical text is not supported
 - Lists, code blocks, and table of contents are not yet supported in the layout model
@@ -313,18 +330,18 @@ TODO
 - If you are processing PDFs with a large number of formulas, it is strongly recommended to enable the OCR function. When using PyMuPDF to extract text, overlapping text lines can occur, leading to inaccurate formula insertion positions.
 - **Table Recognition** is currently in the testing phase; recognition speed is slow, and accuracy needs improvement. Below are some performance test results in an Ubuntu 22.04 LTS + Intel(R) Xeon(R) Platinum 8352V CPU @ 2.10GHz + NVIDIA GeForce RTX 4090 environment for reference.
 
-| Table Size     | Parsing Time        | 
-|---------------|----------------------------| 
-| 6\*5 55kb     | 37s                   | 
-| 16\*12 284kb  | 3m18s                 | 
-| 44\*7 559kb   | 4m12s                 | 
+| Table Size   | Parsing Time |
+| ------------ | ------------ |
+| 6\*5 55kb    | 37s          |
+| 16\*12 284kb | 3m18s        |
+| 44\*7 559kb  | 4m12s        |
 
 # FAQ
+
 [FAQ in Chinese](docs/FAQ_zh_cn.md)
 
 [FAQ in English](docs/FAQ_en_us.md)
 
-
 # All Thanks To Our Contributors
 
 <a href="https://github.com/opendatalab/MinerU/graphs/contributors">
@@ -337,8 +354,8 @@ TODO
 
 This project currently uses PyMuPDF to achieve advanced functionality. However, since it adheres to the AGPL license, it may impose restrictions on certain usage scenarios. In future iterations, we plan to explore and replace it with a more permissive PDF processing library to enhance user-friendliness and flexibility.
 
-
 # Acknowledgments
+
 - [PDF-Extract-Kit](https://github.com/opendatalab/PDF-Extract-Kit)
 - [StructEqTable](https://github.com/UniModal4Reasoning/StructEqTable-Deploy)
 - [PaddleOCR](https://github.com/PaddlePaddle/PaddleOCR)
@@ -375,9 +392,11 @@ This project currently uses PyMuPDF to achieve advanced functionality. However,
 </a>
 
 # Magic-doc
+
 [Magic-Doc](https://github.com/InternLM/magic-doc) Fast speed ppt/pptx/doc/docx/pdf extraction tool
 
 # Magic-html
+
 [Magic-HTML](https://github.com/opendatalab/magic-html) Mixed web page extraction tool
 
 # Links

+ 47 - 37
README_zh-CN.md

@@ -4,8 +4,8 @@
   <img src="docs/images/MinerU-logo.png" width="300px" style="vertical-align:middle;">
 </p>
 
-
 <!-- icon -->
+
 [![stars](https://img.shields.io/github/stars/opendatalab/MinerU.svg)](https://github.com/opendatalab/MinerU)
 [![forks](https://img.shields.io/github/forks/opendatalab/MinerU.svg)](https://github.com/opendatalab/MinerU)
 [![open issues](https://img.shields.io/github/issues-raw/opendatalab/MinerU)](https://github.com/opendatalab/MinerU/issues)
@@ -16,29 +16,31 @@
 <a href="https://trendshift.io/repositories/11174" target="_blank"><img src="https://trendshift.io/api/badge/repositories/11174" alt="opendatalab%2FMinerU | Trendshift" style="width: 250px; height: 55px;" width="250" height="55"/></a>
 
 <!-- language -->
-[English](README.md) | [简体中文](README_zh-CN.md)
 
+[English](README.md) | [简体中文](README_zh-CN.md)
 
 <!-- hot link -->
+
 <p align="center">
 <a href="https://github.com/opendatalab/PDF-Extract-Kit">PDF-Extract-Kit: 高质量PDF解析工具箱</a>🔥🔥🔥
 </p>
 
 <!-- join us -->
+
 <p align="center">
     👋 join us on <a href="https://discord.gg/Tdedn9GTXq" target="_blank">Discord</a> and <a href="https://cdn.vansin.top/internlm/mineru.jpg" target="_blank">WeChat</a>
 </p>
 
 </div>
 
-
 # 更新记录
+
 - 2024/08/09 0.7.0b1发布,简化安装步骤提升易用性,加入表格识别功能
 - 2024/08/01 0.6.2b1发布,优化了依赖冲突问题和安装文档
 - 2024/07/05 首次开源
 
-
 <!-- TABLE OF CONTENT -->
+
 <details open="open">
   <summary><h2 style="display: inline-block">文档目录</h2></summary>
   <ol>
@@ -77,10 +79,10 @@
   </ol>
 </details>
 
-
-
 # MinerU
+
 ## 项目简介
+
 MinerU是一款将PDF转化为机器可读格式的工具(如markdown、json),可以很方便地抽取为任意格式。
 MinerU诞生于[书生-浦语](https://github.com/InternLM/InternLM)的预训练过程中,我们将会集中精力解决科技文献中的符号转化问题,希望在大模型时代为科技发展做出贡献。
 相比国内外知名商用产品MinerU还很年轻,如果遇到问题或者结果不及预期请到[issue](https://github.com/opendatalab/MinerU/issues)提交问题,同时**附上相关PDF**。
@@ -99,17 +101,16 @@ https://github.com/user-attachments/assets/4bea02c9-6d54-4cd6-97ed-dff14340982c
 - 支持CPU和GPU环境
 - 支持windows/linux/mac平台
 
-
 ## 快速开始
 
 如果遇到任何安装问题,请先查询 <a href="#faq">FAQ</a> </br>
 如果遇到解析效果不及预期,参考 <a href="#known-issues">Known Issues</a></br>
 有3种不同方式可以体验MinerU的效果:
+
 - [在线体验(无需任何安装)](#在线体验)
 - [使用CPU快速体验(Windows,Linux,Mac)](#使用cpu快速体验)
 - [Linux/Windows + CUDA](#使用gpu)
 
-
 **⚠️安装前必看——软硬件环境支持说明**
 
 为了确保项目的稳定性和可靠性,我们在开发过程中仅对特定的软硬件环境进行优化和测试。这样当用户在推荐的系统配置上部署和运行项目时,能够获得最佳的性能表现和最少的兼容性问题。
@@ -171,38 +172,46 @@ https://github.com/user-attachments/assets/4bea02c9-6d54-4cd6-97ed-dff14340982c
 
 [在线体验点击这里](https://opendatalab.com/OpenSourceTools/Extractor/PDF)
 
-
 ### 使用CPU快速体验
 
 #### 1. 安装magic-pdf
+
 最新版本国内镜像源同步可能会有延迟,请耐心等待
+
 ```bash
 conda create -n MinerU python=3.10
 conda activate MinerU
 pip install magic-pdf[full]==0.7.0b1 --extra-index-url https://wheels.myhloli.com -i https://pypi.tuna.tsinghua.edu.cn/simple
 ```
+
 #### 2. 下载模型权重文件
 
 详细参考 [如何下载模型文件](docs/how_to_download_models_zh_cn.md)
+
 > ❗️模型下载后请务必检查模型文件是否下载完整
-> 
+>
 > 请检查目录下的模型文件大小与网页上描述是否一致,如果可以的话,最好通过sha256校验模型是否下载完整
 
 #### 3. 拷贝配置文件并进行配置
+
 在仓库根目录可以获得 [magic-pdf.template.json](magic-pdf.template.json) 配置模版文件
+
 > ❗️务必执行以下命令将配置文件拷贝到【用户目录】下,否则程序将无法运行
-> 
->  windows的用户目录为 "C:\Users\用户名", linux用户目录为 "/home/用户名", macOS用户目录为 "/Users/用户名"
+>
+> windows的用户目录为 "C:\\Users\\用户名", linux用户目录为 "/home/用户名", macOS用户目录为 "/Users/用户名"
+
 ```bash
 cp magic-pdf.template.json ~/magic-pdf.json
 ```
 
 在用户目录中找到magic-pdf.json文件并配置"models-dir"为[2. 下载模型权重文件](#2-下载模型权重文件)中下载的模型权重文件所在目录
+
 > ❗️务必正确配置模型权重文件所在目录的【绝对路径】,否则会因为找不到模型文件而导致程序无法运行
 >
-> windows系统中此路径应包含盘符,且需把路径中所有的"\"替换为"/",否则会因为转义原因导致json文件语法错误。
-> 
+> windows系统中此路径应包含盘符,且需把路径中所有的""替换为"/",否则会因为转义原因导致json文件语法错误。
+>
 > 例如:模型放在D盘根目录的models目录,则model-dir的值应为"D:/models"
+
 ```json
 {
   // other config
@@ -214,14 +223,13 @@ cp magic-pdf.template.json ~/magic-pdf.json
 }
 ```
 
-
 ### 使用GPU
+
 如果您的设备支持CUDA,且满足主线环境中的显卡要求,则可以使用GPU加速,请根据自己的系统选择适合的教程:
 
 - [Ubuntu22.04LTS + GPU](docs/README_Ubuntu_CUDA_Acceleration_zh_CN.md)
 - [Windows10/11 + GPU](docs/README_Windows_CUDA_Acceleration_zh_CN.md)
 
-
 ## 使用
 
 ### 命令行
@@ -234,12 +242,12 @@ Options:
   -v, --version                display the version and exit
   -p, --path PATH              local pdf filepath or directory  [required]
   -o, --output-dir TEXT        output local directory
-  -m, --method [ocr|txt|auto]  the method for parsing pdf.  
+  -m, --method [ocr|txt|auto]  the method for parsing pdf.
                                ocr: using ocr technique to extract information from pdf,
                                txt: suitable for the text-based pdf only and outperform ocr,
                                auto: automatically choose the best method for parsing pdf
                                   from ocr and txt.
-                               without method specified, auto will be used by default. 
+                               without method specified, auto will be used by default.
   --help                       Show this message and exit.
 
 
@@ -254,21 +262,21 @@ magic-pdf -p {some_pdf} -o {some_output_dir} -m auto
 运行完命令后输出的结果会保存在`{some_output_dir}`目录下, 输出的文件列表如下
 
 ```text
-├── some_pdf.md                 # markdown 文件
-├── images                      # 存放图片目录
-├── layout.pdf                  # layout 绘图
-├── middle.json                 # minerU 中间处理结果
-├── model.json                  # 模型推理结果
-├── origin.pdf                  # 原 pdf 文件
-└── spans.pdf                   # 最小粒度的bbox位置信息绘图
+├── some_pdf.md                          # markdown 文件
+├── images                               # 存放图片目录
+├── some_pdf_layout.pdf                  # layout 绘图
+├── some_pdf_middle.json                 # minerU 中间处理结果
+├── some_pdf_model.json                  # 模型推理结果
+├── some_pdf_origin.pdf                  # 原 pdf 文件
+└── some_pdf_spans.pdf                   # 最小粒度的bbox位置信息绘图
 ```
 
 更多有关输出文件的信息,请参考[输出文件说明](docs/output_file_zh_cn.md)
 
-
 ### API
 
 处理本地磁盘上的文件
+
 ```python
 image_writer = DiskReaderWriter(local_image_dir)
 image_dir = str(os.path.basename(local_image_dir))
@@ -281,6 +289,7 @@ md_content = pipe.pipe_mk_markdown(image_dir, drop_mode="none")
 ```
 
 处理对象存储上的文件
+
 ```python
 s3pdf_cli = S3ReaderWriter(pdf_ak, pdf_sk, pdf_endpoint)
 image_dir = "s3://img_bucket/"
@@ -294,11 +303,11 @@ pipe.pipe_parse()
 md_content = pipe.pipe_mk_markdown(image_dir, drop_mode="none")
 ```
 
-详细实现可参考 
+详细实现可参考
+
 - [demo.py 最简单的处理方式](demo/demo.py)
 - [magic_pdf_parse_main.py 能够更清晰看到处理流程](demo/magic_pdf_parse_main.py)
 
-
 ### 二次开发
 
 TODO
@@ -313,8 +322,8 @@ TODO
 - [ ] 化学式识别
 - [ ] 几何图形识别
 
-
 # Known Issues
+
 - 阅读顺序基于规则的分割,在一些情况下会乱序
 - 不支持竖排文字
 - 列表、代码块、目录在layout模型里还没有支持
@@ -323,20 +332,18 @@ TODO
 - 如果您要处理包含大量公式的pdf,强烈建议开启OCR功能。使用pymuPDF提取文字的时候会出现文本行互相重叠的情况导致公式插入位置不准确。
 - **表格识别**目前处于测试阶段,识别速度较慢,识别准确度有待提升。以下是我们在Ubuntu 22.04 LTS + Intel(R) Xeon(R) Platinum 8352V CPU @ 2.10GHz + NVIDIA GeForce RTX 4090环境下的一些性能测试结果,可供参考。
 
-| 表格大小     | 解析耗时        | 
-|---------------|----------------------------| 
-| 6\*5 55kb     | 37s                   | 
-| 16\*12 284kb  | 3m18s                 | 
-| 44\*7 559kb   | 4m12s                 | 
- 
-
+| 表格大小     | 解析耗时 |
+| ------------ | -------- |
+| 6\*5 55kb    | 37s      |
+| 16\*12 284kb | 3m18s    |
+| 44\*7 559kb  | 4m12s    |
 
 # FAQ
+
 [常见问题](docs/FAQ_zh_cn.md)
 
 [FAQ](docs/FAQ_en_us.md)
 
-
 # All Thanks To Our Contributors
 
 <a href="https://github.com/opendatalab/MinerU/graphs/contributors">
@@ -350,6 +357,7 @@ TODO
 本项目目前采用PyMuPDF以实现高级功能,但因其遵循AGPL协议,可能对某些使用场景构成限制。未来版本迭代中,我们计划探索并替换为许可条款更为宽松的PDF处理库,以提升用户友好度及灵活性。
 
 # Acknowledgments
+
 - [PDF-Extract-Kit](https://github.com/opendatalab/PDF-Extract-Kit)
 - [StructEqTable](https://github.com/UniModal4Reasoning/StructEqTable-Deploy)
 - [PaddleOCR](https://github.com/PaddlePaddle/PaddleOCR)
@@ -386,9 +394,11 @@ TODO
 </a>
 
 # Magic-doc
+
 [Magic-Doc](https://github.com/InternLM/magic-doc) Fast speed ppt/pptx/doc/docx/pdf extraction tool
 
 # Magic-html
+
 [Magic-HTML](https://github.com/opendatalab/magic-html) Mixed web page extraction tool
 
 # Links

+ 61 - 68
docs/output_file_en_us.md

@@ -1,24 +1,23 @@
-
-
 ## Overview
+
 After executing the `magic-pdf` command, in addition to outputting files related to markdown, several other files unrelated to markdown will also be generated. These files will be introduced one by one.
 
+### some_pdf_layout.pdf
 
-### layout.pdf
 Each page layout consists of one or more boxes. The number at the top left of each box indicates its sequence number. Additionally, in `layout.pdf`, different content blocks are highlighted with different background colors.
 
 ![layout example](images/layout_example.png)
 
+### some_pdf_spans.pdf
 
-### spans.pdf
 All spans on the page are drawn with different colored line frames according to the span type. This file can be used for quality control, allowing for quick identification of issues such as missing text or unrecognized inline formulas.
 
 ![spans example](images/spans_example.png)
 
-
-### model.json
+### some_pdf_model.json
 
 #### Structure Definition
+
 ```python
 from pydantic import BaseModel, Field
 from enum import IntEnum
@@ -34,12 +33,12 @@ class CategoryType(IntEnum):
      table_footnote = 7      # Table footnote
      isolate_formula = 8     # Block formula
      formula_caption = 9     # Formula label
-     
+
      embedding = 13          # Inline formula
      isolated = 14           # Block formula
      text = 15               # OCR recognition result
-   
-     
+
+
 class PageInfo(BaseModel):
     page_no: int = Field(description="Page number, the first page is 0", ge=0)
     height: int = Field(description="Page height", gt=0)
@@ -51,22 +50,20 @@ class ObjectInferenceResult(BaseModel):
     score: float = Field(description="Confidence of the inference result")
     latex: str | None = Field(description="LaTeX parsing result", default=None)
     html: str | None = Field(description="HTML parsing result", default=None)
-  
+
 class PageInferenceResults(BaseModel):
      layout_dets: list[ObjectInferenceResult] = Field(description="Page recognition results", ge=0)
      page_info: PageInfo = Field(description="Page metadata")
-    
-    
+
+
 # The inference results of all pages, ordered by page number, are stored in a list as the inference results of MinerU
 inference_result: list[PageInferenceResults] = []
 
 ```
 
-The format of the poly coordinates is [x0, y0, x1, y1, x2, y2, x3, y3], representing the coordinates of the top-left, top-right, bottom-right, and bottom-left points respectively.
+The format of the poly coordinates is \[x0, y0, x1, y1, x2, y2, x3, y3\], representing the coordinates of the top-left, top-right, bottom-right, and bottom-left points respectively.
 ![Poly Coordinate Diagram](images/poly.png)
 
-
-
 #### example
 
 ```json
@@ -120,15 +117,13 @@ The format of the poly coordinates is [x0, y0, x1, y1, x2, y2, x3, y3], represen
 ]
 ```
 
+### some_pdf_middle.json
 
-### middle.json
-
-| Field Name | Description |
-| :-----|:------------------------------------------|
-|pdf_info | list, each element is a dict representing the parsing result of each PDF page, see the table below for details |
-|_parse_type | ocr \| txt, used to indicate the mode used in this intermediate parsing state |
-|_version_name | string, indicates the version of magic-pdf used in this parsing |
-
+| Field Name     | Description                                                                                                    |
+| :------------- | :------------------------------------------------------------------------------------------------------------- |
+| pdf_info       | list, each element is a dict representing the parsing result of each PDF page, see the table below for details |
+| \_parse_type   | ocr \| txt, used to indicate the mode used in this intermediate parsing state                                  |
+| \_version_name | string, indicates the version of magic-pdf used in this parsing                                                |
 
 <br>
 
@@ -136,18 +131,18 @@ The format of the poly coordinates is [x0, y0, x1, y1, x2, y2, x3, y3], represen
 
 Field structure description
 
-| Field Name | Description | 
-| :-----| :---- |
-| preproc_blocks | Intermediate result after PDF preprocessing, not yet segmented |
-| layout_bboxes | Layout segmentation results, containing layout direction (vertical, horizontal), and bbox, sorted by reading order |
-| page_idx | Page number, starting from 0 |
-| page_size | Page width and height | 
-| _layout_tree | Layout tree structure |
-| images | list, each element is a dict representing an img_block |
-| tables | list, each element is a dict representing a table_block |
-| interline_equations | list, each element is a dict representing an interline_equation_block |
-| discarded_blocks | List, block information returned by the model that needs to be dropped |
-| para_blocks | Result after segmenting preproc_blocks |
+| Field Name          | Description                                                                                                        |
+| :------------------ | :----------------------------------------------------------------------------------------------------------------- |
+| preproc_blocks      | Intermediate result after PDF preprocessing, not yet segmented                                                     |
+| layout_bboxes       | Layout segmentation results, containing layout direction (vertical, horizontal), and bbox, sorted by reading order |
+| page_idx            | Page number, starting from 0                                                                                       |
+| page_size           | Page width and height                                                                                              |
+| \_layout_tree       | Layout tree structure                                                                                              |
+| images              | list, each element is a dict representing an img_block                                                             |
+| tables              | list, each element is a dict representing a table_block                                                            |
+| interline_equations | list, each element is a dict representing an interline_equation_block                                              |
+| discarded_blocks    | List, block information returned by the model that needs to be dropped                                             |
+| para_blocks         | Result after segmenting preproc_blocks                                                                             |
 
 In the above table, `para_blocks` is an array of dicts, each dict representing a block structure. A block can support up to one level of nesting.
 
@@ -157,35 +152,35 @@ In the above table, `para_blocks` is an array of dicts, each dict representing a
 
 The outer block is referred to as a first-level block, and the fields in the first-level block include:
 
-| Field Name | Description |
-| :-----| :---- |
-| type | Block type (table\|image)|
-|bbox | Block bounding box coordinates |
-|blocks |list, each element is a dict representing a second-level block |
+| Field Name | Description                                                    |
+| :--------- | :------------------------------------------------------------- |
+| type       | Block type (table\|image)                                      |
+| bbox       | Block bounding box coordinates                                 |
+| blocks     | list, each element is a dict representing a second-level block |
 
 <br>
 There are only two types of first-level blocks: "table" and "image". All other blocks are second-level blocks.
 
 The fields in a second-level block include:
 
-| Field Name | Description |
-| :-----| :---- |
-| type | Block type |
-| bbox | Block bounding box coordinates |
-| lines | list, each element is a dict representing a line, used to describe the composition of a line of information| 
+| Field Name | Description                                                                                                 |
+| :--------- | :---------------------------------------------------------------------------------------------------------- |
+| type       | Block type                                                                                                  |
+| bbox       | Block bounding box coordinates                                                                              |
+| lines      | list, each element is a dict representing a line, used to describe the composition of a line of information |
 
 Detailed explanation of second-level block types
 
-| type               | Description | 
-|:-------------------| :---- |
+| type               | Description            |
+| :----------------- | :--------------------- |
 | image_body         | Main body of the image |
 | image_caption      | Image description text |
 | table_body         | Main body of the table |
 | table_caption      | Table description text |
-| table_footnote     | Table footnote |
-| text               | Text block |
-| title              | Title block |
-| interline_equation | Block formula| 
+| table_footnote     | Table footnote         |
+| text               | Text block             |
+| title              | Title block            |
+| interline_equation | Block formula          |
 
 <br>
 
@@ -193,31 +188,30 @@ Detailed explanation of second-level block types
 
 The field format of a line is as follows:
 
-| Field Name | Description | 
-| :-----| :---- |
-| bbox | Bounding box coordinates of the line |
-| spans | list, each element is a dict representing a span, used to describe the composition of the smallest unit |
-
+| Field Name | Description                                                                                             |
+| :--------- | :------------------------------------------------------------------------------------------------------ |
+| bbox       | Bounding box coordinates of the line                                                                    |
+| spans      | list, each element is a dict representing a span, used to describe the composition of the smallest unit |
 
 <br>
 
 **span**
 
-| Field Name | Description | 
-| :-----| :---- |
-| bbox | Bounding box coordinates of the span |
-| type | Type of the span |
+| Field Name          | Description                                                                                              |
+| :------------------ | :------------------------------------------------------------------------------------------------------- |
+| bbox                | Bounding box coordinates of the span                                                                     |
+| type                | Type of the span                                                                                         |
 | content \| img_path | Text spans use content, chart spans use img_path to store the actual text or screenshot path information |
 
 The types of spans are as follows:
 
-| type | Description | 
-| :-----| :---- |
-| image | Image | 
-| table | Table |
-| text | Text |
-| inline_equation | Inline formula |
-| interline_equation | Block formula |
+| type               | Description    |
+| :----------------- | :------------- |
+| image              | Image          |
+| table              | Table          |
+| text               | Text           |
+| inline_equation    | Inline formula |
+| interline_equation | Block formula  |
 
 **Summary**
 
@@ -229,7 +223,6 @@ The block structure is as follows:
 
 First-level block (if any) -> Second-level block -> Line -> Span
 
-
 #### example
 
 ```json

+ 64 - 70
docs/output_file_zh_cn.md

@@ -1,24 +1,23 @@
-
-
 ## 概览
+
 `magic-pdf` 命令执行后除了输出和 markdown 有关的文件以外,还会生成若干个和 markdown 无关的文件。现在将一一介绍这些文件
 
+### some_pdf_layout.pdf
 
-### layout.pdf 
 每一页的 layout 均由一个或多个框组成。 每个框左上脚的数字表明它们的序号。此外 layout.pdf 框内用不同的背景色块圈定不同的内容块。
 
 ![layout 页面示例](images/layout_example.png)
 
+### some_pdf_spans.pdf
 
-### spans.pdf 
 根据 span 类型的不同,采用不同颜色线框绘制页面上所有 span。该文件可以用于质检,可以快速排查出文本丢失、行间公式未识别等问题。
 
 ![span 页面示例](images/spans_example.png)
 
-
-### model.json
+### some_pdf_model.json
 
 #### 结构定义
+
 ```python
 from pydantic import BaseModel, Field
 from enum import IntEnum
@@ -33,13 +32,13 @@ class CategoryType(IntEnum):
      table_caption = 6       # 表格描述
      table_footnote = 7      # 表格注释
      isolate_formula = 8     # 行间公式
-     formula_caption = 9     # 行间公式的标号 
-     
+     formula_caption = 9     # 行间公式的标号
+
      embedding = 13          # 行内公式
      isolated = 14           # 行间公式
      text = 15               # ocr 识别结果
-   
-     
+
+
 class PageInfo(BaseModel):
     page_no: int = Field(description="页码序号,第一页的序号是 0", ge=0)
     height: int = Field(description="页面高度", gt=0)
@@ -51,21 +50,20 @@ class ObjectInferenceResult(BaseModel):
     score: float = Field(description="推理结果的置信度")
     latex: str | None = Field(description="latex 解析结果", default=None)
     html: str | None = Field(description="html 解析结果", default=None)
-  
+
 class PageInferenceResults(BaseModel):
      layout_dets: list[ObjectInferenceResult] = Field(description="页面识别结果", ge=0)
      page_info: PageInfo = Field(description="页面元信息")
-    
-    
+
+
 # 所有页面的推理结果按照页码顺序依次放到列表中即为 minerU 推理结果
 inference_result: list[PageInferenceResults] = []
 
 ```
 
-poly 坐标的格式 [x0, y0, x1, y1, x2, y2, x3, y3], 分别表示左上、右上、右下、左下四点的坐标
+poly 坐标的格式 \[x0, y0, x1, y1, x2, y2, x3, y3\], 分别表示左上、右上、右下、左下四点的坐标
 ![poly 坐标示意图](images/poly.png)
 
-
 #### 示例数据
 
 ```json
@@ -119,32 +117,31 @@ poly 坐标的格式 [x0, y0, x1, y1, x2, y2, x3, y3], 分别表示左上、右
 ]
 ```
 
+### some_pdf_middle.json
 
-### middle.json
-
-| 字段名 | 解释                                        | 
-| :-----|:------------------------------------------|
-|pdf_info | list,每个元素都是一个dict,这个dict是每一页pdf的解析结果,详见下表 |
-|_parse_type | ocr \| txt,用来标识本次解析的中间态使用的模式              |
-|_version_name | string, 表示本次解析使用的 magic-pdf 的版本号          |
+| 字段名         | 解释                                                               |
+| :------------- | :----------------------------------------------------------------- |
+| pdf_info       | list,每个元素都是一个dict,这个dict是每一页pdf的解析结果,详见下表 |
+| \_parse_type   | ocr \| txt,用来标识本次解析的中间态使用的模式                     |
+| \_version_name | string, 表示本次解析使用的 magic-pdf 的版本号                      |
 
 <br>
 
 **pdf_info**
 字段结构说明
 
-| 字段名 | 解释 | 
-| :-----| :---- |
-| preproc_blocks | pdf预处理后,未分段的中间结果 |
-| layout_bboxes | 布局分割的结果,含有布局的方向(垂直、水平),和bbox,按阅读顺序排序 |
-| page_idx | 页码,从0开始 |
-| page_size | 页面的宽度和高度 | 
-| _layout_tree | 布局树状结构 |
-| images | list,每个元素是一个dict,每个dict表示一个img_block |
-| tables | list,每个元素是一个dict,每个dict表示一个table_block |
-| interline_equations | list,每个元素是一个dict,每个dict表示一个interline_equation_block |
-| discarded_blocks | List, 模型返回的需要drop的block信息 |
-| para_blocks | 将preproc_blocks进行分段之后的结果 |
+| 字段名              | 解释                                                                 |
+| :------------------ | :------------------------------------------------------------------- |
+| preproc_blocks      | pdf预处理后,未分段的中间结果                                        |
+| layout_bboxes       | 布局分割的结果,含有布局的方向(垂直、水平),和bbox,按阅读顺序排序 |
+| page_idx            | 页码,从0开始                                                        |
+| page_size           | 页面的宽度和高度                                                     |
+| \_layout_tree       | 布局树状结构                                                         |
+| images              | list,每个元素是一个dict,每个dict表示一个img_block                  |
+| tables              | list,每个元素是一个dict,每个dict表示一个table_block                |
+| interline_equations | list,每个元素是一个dict,每个dict表示一个interline_equation_block   |
+| discarded_blocks    | List, 模型返回的需要drop的block信息                                  |
+| para_blocks         | 将preproc_blocks进行分段之后的结果                                   |
 
 上表中 `para_blocks` 是个dict的数组,每个dict是一个block结构,block最多支持一次嵌套
 
@@ -154,35 +151,35 @@ poly 坐标的格式 [x0, y0, x1, y1, x2, y2, x3, y3], 分别表示左上、右
 
 外层block被称为一级block,一级block中的字段包括
 
-| 字段名 | 解释 |
-| :-----| :---- |
-| type | block类型(table\|image)|
-|bbox | block矩形框坐标 |
-|blocks |list,里面的每个元素都是一个dict格式的二级block |
+| 字段名 | 解释                                            |
+| :----- | :---------------------------------------------- |
+| type   | block类型(table\|image)                       |
+| bbox   | block矩形框坐标                                 |
+| blocks | list,里面的每个元素都是一个dict格式的二级block |
 
 <br>
 一级block只有"table"和"image"两种类型,其余block均为二级block
 
 二级block中的字段包括
 
-| 字段名 | 解释 |
-| :-----| :---- |
-| type | block类型 |
-| bbox | block矩形框坐标 |
-| lines | list,每个元素都是一个dict表示的line,用来描述一行信息的构成| 
+| 字段名 | 解释                                                         |
+| :----- | :----------------------------------------------------------- |
+| type   | block类型                                                    |
+| bbox   | block矩形框坐标                                              |
+| lines  | list,每个元素都是一个dict表示的line,用来描述一行信息的构成 |
 
 二级block的类型详解
 
-| type               | desc | 
-|:-------------------| :---- |
-| image_body         | 图像的本体 |
+| type               | desc           |
+| :----------------- | :------------- |
+| image_body         | 图像的本体     |
 | image_caption      | 图像的描述文本 |
-| table_body         | 表格本体 |
+| table_body         | 表格本体       |
 | table_caption      | 表格的描述文本 |
-| table_footnote     | 表格的脚注 |
-| text               | 文本块 |
-| title              | 标题块 |
-| interline_equation | 行间公式块| 
+| table_footnote     | 表格的脚注     |
+| text               | 文本块         |
+| title              | 标题块         |
+| interline_equation | 行间公式块     |
 
 <br>
 
@@ -190,33 +187,31 @@ poly 坐标的格式 [x0, y0, x1, y1, x2, y2, x3, y3], 分别表示左上、右
 
 line 的 字段格式如下
 
-| 字段名 | 解释 | 
-| :-----| :---- |
-| bbox | line的矩形框坐标 |
-| spans | list,每个元素都是一个dict表示的span,用来描述一个最小组成单元的构成 |
-
+| 字段名 | 解释                                                                 |
+| :----- | :------------------------------------------------------------------- |
+| bbox   | line的矩形框坐标                                                     |
+| spans  | list,每个元素都是一个dict表示的span,用来描述一个最小组成单元的构成 |
 
 <br>
 
 **span**
 
-| 字段名 | 解释 | 
-| :-----| :---- |
-| bbox | span的矩形框坐标 |
-| type | span的类型 |
+| 字段名              | 解释                                                                             |
+| :------------------ | :------------------------------------------------------------------------------- |
+| bbox                | span的矩形框坐标                                                                 |
+| type                | span的类型                                                                       |
 | content \| img_path | 文本类型的span使用content,图表类使用img_path 用来存储实际的文本或者截图路径信息 |
 
 span 的类型有如下几种
 
-| type | desc | 
-| :-----| :---- |
-| image | 图片 | 
-| table | 表格 |
-| text | 文本 |
-| inline_equation | 行内公式 |
+| type               | desc     |
+| :----------------- | :------- |
+| image              | 图片     |
+| table              | 表格     |
+| text               | 文本     |
+| inline_equation    | 行内公式 |
 | interline_equation | 行间公式 |
 
-
 **总结**
 
 span是所有元素的最小存储单元
@@ -227,7 +222,6 @@ para_blocks内存储的元素为区块信息
 
 一级block(如有)->二级block->line->span
 
-
 #### 示例数据
 
 ```json
@@ -329,4 +323,4 @@ para_blocks内存储的元素为区块信息
     "_parse_type": "txt",
     "_version_name": "0.6.1"
 }
-```
+```

+ 99 - 84
magic_pdf/libs/draw_bbox.py

@@ -1,6 +1,6 @@
-from magic_pdf.libs.Constants import CROSS_PAGE
 from magic_pdf.libs.commons import fitz  # PyMuPDF
-from magic_pdf.libs.ocr_content_type import ContentType, BlockType, CategoryId
+from magic_pdf.libs.Constants import CROSS_PAGE
+from magic_pdf.libs.ocr_content_type import BlockType, CategoryId, ContentType
 from magic_pdf.model.magic_model import MagicModel
 
 
@@ -65,10 +65,11 @@ def draw_bbox_with_number(i, bbox_list, page, rgb_config, fill_config):
         )  # Insert the index in the top left corner of the rectangle
 
 
-def draw_layout_bbox(pdf_info, pdf_bytes, out_path):
+def draw_layout_bbox(pdf_info, pdf_bytes, out_path, filename):
     layout_bbox_list = []
     dropped_bbox_list = []
-    tables_list, tables_body_list, tables_caption_list, tables_footnote_list = [], [], [], []
+    tables_list, tables_body_list = [], []
+    tables_caption_list, tables_footnote_list = [], []
     imgs_list, imgs_body_list, imgs_caption_list = [], [], []
     titles_list = []
     texts_list = []
@@ -81,37 +82,37 @@ def draw_layout_bbox(pdf_info, pdf_bytes, out_path):
         titles = []
         texts = []
         interequations = []
-        for layout in page["layout_bboxes"]:
-            page_layout_list.append(layout["layout_bbox"])
+        for layout in page['layout_bboxes']:
+            page_layout_list.append(layout['layout_bbox'])
         layout_bbox_list.append(page_layout_list)
-        for dropped_bbox in page["discarded_blocks"]:
-            page_dropped_list.append(dropped_bbox["bbox"])
+        for dropped_bbox in page['discarded_blocks']:
+            page_dropped_list.append(dropped_bbox['bbox'])
         dropped_bbox_list.append(page_dropped_list)
-        for block in page["para_blocks"]:
-            bbox = block["bbox"]
-            if block["type"] == BlockType.Table:
+        for block in page['para_blocks']:
+            bbox = block['bbox']
+            if block['type'] == BlockType.Table:
                 tables.append(bbox)
-                for nested_block in block["blocks"]:
-                    bbox = nested_block["bbox"]
-                    if nested_block["type"] == BlockType.TableBody:
+                for nested_block in block['blocks']:
+                    bbox = nested_block['bbox']
+                    if nested_block['type'] == BlockType.TableBody:
                         tables_body.append(bbox)
-                    elif nested_block["type"] == BlockType.TableCaption:
+                    elif nested_block['type'] == BlockType.TableCaption:
                         tables_caption.append(bbox)
-                    elif nested_block["type"] == BlockType.TableFootnote:
+                    elif nested_block['type'] == BlockType.TableFootnote:
                         tables_footnote.append(bbox)
-            elif block["type"] == BlockType.Image:
+            elif block['type'] == BlockType.Image:
                 imgs.append(bbox)
-                for nested_block in block["blocks"]:
-                    bbox = nested_block["bbox"]
-                    if nested_block["type"] == BlockType.ImageBody:
+                for nested_block in block['blocks']:
+                    bbox = nested_block['bbox']
+                    if nested_block['type'] == BlockType.ImageBody:
                         imgs_body.append(bbox)
-                    elif nested_block["type"] == BlockType.ImageCaption:
+                    elif nested_block['type'] == BlockType.ImageCaption:
                         imgs_caption.append(bbox)
-            elif block["type"] == BlockType.Title:
+            elif block['type'] == BlockType.Title:
                 titles.append(bbox)
-            elif block["type"] == BlockType.Text:
+            elif block['type'] == BlockType.Text:
                 texts.append(bbox)
-            elif block["type"] == BlockType.InterlineEquation:
+            elif block['type'] == BlockType.InterlineEquation:
                 interequations.append(bbox)
         tables_list.append(tables)
         tables_body_list.append(tables_body)
@@ -124,26 +125,33 @@ def draw_layout_bbox(pdf_info, pdf_bytes, out_path):
         texts_list.append(texts)
         interequations_list.append(interequations)
 
-    pdf_docs = fitz.open("pdf", pdf_bytes)
+    pdf_docs = fitz.open('pdf', pdf_bytes)
     for i, page in enumerate(pdf_docs):
         draw_bbox_with_number(i, layout_bbox_list, page, [255, 0, 0], False)
-        draw_bbox_without_number(i, dropped_bbox_list, page, [158, 158, 158], True)
-        draw_bbox_without_number(i, tables_list, page, [153, 153, 0], True)  # color !
-        draw_bbox_without_number(i, tables_body_list, page, [204, 204, 0], True)
-        draw_bbox_without_number(i, tables_caption_list, page, [255, 255, 102], True)
-        draw_bbox_without_number(i, tables_footnote_list, page, [229, 255, 204], True)
+        draw_bbox_without_number(i, dropped_bbox_list, page, [158, 158, 158],
+                                 True)
+        draw_bbox_without_number(i, tables_list, page, [153, 153, 0],
+                                 True)  # color !
+        draw_bbox_without_number(i, tables_body_list, page, [204, 204, 0],
+                                 True)
+        draw_bbox_without_number(i, tables_caption_list, page, [255, 255, 102],
+                                 True)
+        draw_bbox_without_number(i, tables_footnote_list, page,
+                                 [229, 255, 204], True)
         draw_bbox_without_number(i, imgs_list, page, [51, 102, 0], True)
         draw_bbox_without_number(i, imgs_body_list, page, [153, 255, 51], True)
-        draw_bbox_without_number(i, imgs_caption_list, page, [102, 178, 255], True)
+        draw_bbox_without_number(i, imgs_caption_list, page, [102, 178, 255],
+                                 True)
         draw_bbox_without_number(i, titles_list, page, [102, 102, 255], True)
         draw_bbox_without_number(i, texts_list, page, [153, 0, 76], True)
-        draw_bbox_without_number(i, interequations_list, page, [0, 255, 0], True)
+        draw_bbox_without_number(i, interequations_list, page, [0, 255, 0],
+                                 True)
 
     # Save the PDF
-    pdf_docs.save(f"{out_path}/layout.pdf")
+    pdf_docs.save(f'{out_path}/{filename}_layout.pdf')
 
 
-def draw_span_bbox(pdf_info, pdf_bytes, out_path):
+def draw_span_bbox(pdf_info, pdf_bytes, out_path, filename):
     text_list = []
     inline_equation_list = []
     interline_equation_list = []
@@ -154,22 +162,22 @@ def draw_span_bbox(pdf_info, pdf_bytes, out_path):
     next_page_inline_equation_list = []
 
     def get_span_info(span):
-        if span["type"] == ContentType.Text:
+        if span['type'] == ContentType.Text:
             if span.get(CROSS_PAGE, False):
-                next_page_text_list.append(span["bbox"])
+                next_page_text_list.append(span['bbox'])
             else:
-                page_text_list.append(span["bbox"])
-        elif span["type"] == ContentType.InlineEquation:
+                page_text_list.append(span['bbox'])
+        elif span['type'] == ContentType.InlineEquation:
             if span.get(CROSS_PAGE, False):
-                next_page_inline_equation_list.append(span["bbox"])
+                next_page_inline_equation_list.append(span['bbox'])
             else:
-                page_inline_equation_list.append(span["bbox"])
-        elif span["type"] == ContentType.InterlineEquation:
-            page_interline_equation_list.append(span["bbox"])
-        elif span["type"] == ContentType.Image:
-            page_image_list.append(span["bbox"])
-        elif span["type"] == ContentType.Table:
-            page_table_list.append(span["bbox"])
+                page_inline_equation_list.append(span['bbox'])
+        elif span['type'] == ContentType.InterlineEquation:
+            page_interline_equation_list.append(span['bbox'])
+        elif span['type'] == ContentType.Image:
+            page_image_list.append(span['bbox'])
+        elif span['type'] == ContentType.Table:
+            page_table_list.append(span['bbox'])
 
     for page in pdf_info:
         page_text_list = []
@@ -188,54 +196,56 @@ def draw_span_bbox(pdf_info, pdf_bytes, out_path):
             next_page_inline_equation_list.clear()
 
         # 构造dropped_list
-        for block in page["discarded_blocks"]:
-            if block["type"] == BlockType.Discarded:
-                for line in block["lines"]:
-                    for span in line["spans"]:
-                        page_dropped_list.append(span["bbox"])
+        for block in page['discarded_blocks']:
+            if block['type'] == BlockType.Discarded:
+                for line in block['lines']:
+                    for span in line['spans']:
+                        page_dropped_list.append(span['bbox'])
         dropped_list.append(page_dropped_list)
         # 构造其余useful_list
-        for block in page["para_blocks"]:
-            if block["type"] in [
-                BlockType.Text,
-                BlockType.Title,
-                BlockType.InterlineEquation,
+        for block in page['para_blocks']:
+            if block['type'] in [
+                    BlockType.Text,
+                    BlockType.Title,
+                    BlockType.InterlineEquation,
             ]:
-                for line in block["lines"]:
-                    for span in line["spans"]:
+                for line in block['lines']:
+                    for span in line['spans']:
                         get_span_info(span)
-            elif block["type"] in [BlockType.Image, BlockType.Table]:
-                for sub_block in block["blocks"]:
-                    for line in sub_block["lines"]:
-                        for span in line["spans"]:
+            elif block['type'] in [BlockType.Image, BlockType.Table]:
+                for sub_block in block['blocks']:
+                    for line in sub_block['lines']:
+                        for span in line['spans']:
                             get_span_info(span)
         text_list.append(page_text_list)
         inline_equation_list.append(page_inline_equation_list)
         interline_equation_list.append(page_interline_equation_list)
         image_list.append(page_image_list)
         table_list.append(page_table_list)
-    pdf_docs = fitz.open("pdf", pdf_bytes)
+    pdf_docs = fitz.open('pdf', pdf_bytes)
     for i, page in enumerate(pdf_docs):
         # 获取当前页面的数据
         draw_bbox_without_number(i, text_list, page, [255, 0, 0], False)
-        draw_bbox_without_number(i, inline_equation_list, page, [0, 255, 0], False)
-        draw_bbox_without_number(i, interline_equation_list, page, [0, 0, 255], False)
+        draw_bbox_without_number(i, inline_equation_list, page, [0, 255, 0],
+                                 False)
+        draw_bbox_without_number(i, interline_equation_list, page, [0, 0, 255],
+                                 False)
         draw_bbox_without_number(i, image_list, page, [255, 204, 0], False)
         draw_bbox_without_number(i, table_list, page, [204, 0, 255], False)
         draw_bbox_without_number(i, dropped_list, page, [158, 158, 158], False)
 
     # Save the PDF
-    pdf_docs.save(f"{out_path}/spans.pdf")
+    pdf_docs.save(f'{out_path}/{filename}_spans.pdf')
 
 
-def drow_model_bbox(model_list: list, pdf_bytes, out_path):
+def drow_model_bbox(model_list: list, pdf_bytes, out_path, filename):
     dropped_bbox_list = []
     tables_body_list, tables_caption_list, tables_footnote_list = [], [], []
     imgs_body_list, imgs_caption_list = [], []
     titles_list = []
     texts_list = []
     interequations_list = []
-    pdf_docs = fitz.open("pdf", pdf_bytes)
+    pdf_docs = fitz.open('pdf', pdf_bytes)
     magic_model = MagicModel(model_list, pdf_docs)
     for i in range(len(model_list)):
         page_dropped_list = []
@@ -245,26 +255,27 @@ def drow_model_bbox(model_list: list, pdf_bytes, out_path):
         texts = []
         interequations = []
         page_info = magic_model.get_model_list(i)
-        layout_dets = page_info["layout_dets"]
+        layout_dets = page_info['layout_dets']
         for layout_det in layout_dets:
-            bbox = layout_det["bbox"]
-            if layout_det["category_id"] == CategoryId.Text:
+            bbox = layout_det['bbox']
+            if layout_det['category_id'] == CategoryId.Text:
                 texts.append(bbox)
-            elif layout_det["category_id"] == CategoryId.Title:
+            elif layout_det['category_id'] == CategoryId.Title:
                 titles.append(bbox)
-            elif layout_det["category_id"] == CategoryId.TableBody:
+            elif layout_det['category_id'] == CategoryId.TableBody:
                 tables_body.append(bbox)
-            elif layout_det["category_id"] == CategoryId.TableCaption:
+            elif layout_det['category_id'] == CategoryId.TableCaption:
                 tables_caption.append(bbox)
-            elif layout_det["category_id"] == CategoryId.TableFootnote:
+            elif layout_det['category_id'] == CategoryId.TableFootnote:
                 tables_footnote.append(bbox)
-            elif layout_det["category_id"] == CategoryId.ImageBody:
+            elif layout_det['category_id'] == CategoryId.ImageBody:
                 imgs_body.append(bbox)
-            elif layout_det["category_id"] == CategoryId.ImageCaption:
+            elif layout_det['category_id'] == CategoryId.ImageCaption:
                 imgs_caption.append(bbox)
-            elif layout_det["category_id"] == CategoryId.InterlineEquation_YOLO:
+            elif layout_det[
+                    'category_id'] == CategoryId.InterlineEquation_YOLO:
                 interequations.append(bbox)
-            elif layout_det["category_id"] == CategoryId.Abandon:
+            elif layout_det['category_id'] == CategoryId.Abandon:
                 page_dropped_list.append(bbox)
 
         tables_body_list.append(tables_body)
@@ -278,15 +289,19 @@ def drow_model_bbox(model_list: list, pdf_bytes, out_path):
         dropped_bbox_list.append(page_dropped_list)
 
     for i, page in enumerate(pdf_docs):
-        draw_bbox_with_number(i, dropped_bbox_list, page, [158, 158, 158], True) # color !
+        draw_bbox_with_number(i, dropped_bbox_list, page, [158, 158, 158],
+                              True)  # color !
         draw_bbox_with_number(i, tables_body_list, page, [204, 204, 0], True)
-        draw_bbox_with_number(i, tables_caption_list, page, [255, 255, 102], True)
-        draw_bbox_with_number(i, tables_footnote_list, page, [229, 255, 204], True)
+        draw_bbox_with_number(i, tables_caption_list, page, [255, 255, 102],
+                              True)
+        draw_bbox_with_number(i, tables_footnote_list, page, [229, 255, 204],
+                              True)
         draw_bbox_with_number(i, imgs_body_list, page, [153, 255, 51], True)
-        draw_bbox_with_number(i, imgs_caption_list, page, [102, 178, 255], True)
+        draw_bbox_with_number(i, imgs_caption_list, page, [102, 178, 255],
+                              True)
         draw_bbox_with_number(i, titles_list, page, [102, 102, 255], True)
         draw_bbox_with_number(i, texts_list, page, [153, 0, 76], True)
         draw_bbox_with_number(i, interequations_list, page, [0, 255, 0], True)
 
     # Save the PDF
-    pdf_docs.save(f"{out_path}/model.pdf")
+    pdf_docs.save(f'{out_path}/{filename}_model.pdf')

+ 29 - 28
magic_pdf/tools/cli.py

@@ -1,53 +1,54 @@
 import os
+from pathlib import Path
+
 import click
 from loguru import logger
-from pathlib import Path
 
-from magic_pdf.rw.DiskReaderWriter import DiskReaderWriter
-from magic_pdf.rw.AbsReaderWriter import AbsReaderWriter
 import magic_pdf.model as model_config
-from magic_pdf.tools.common import parse_pdf_methods, do_parse
 from magic_pdf.libs.version import __version__
+from magic_pdf.rw.AbsReaderWriter import AbsReaderWriter
+from magic_pdf.rw.DiskReaderWriter import DiskReaderWriter
+from magic_pdf.tools.common import do_parse, parse_pdf_methods
 
 
 @click.command()
-@click.version_option(__version__, "--version", "-v", help="display the version and exit")
+@click.version_option(__version__,
+                      '--version',
+                      '-v',
+                      help='display the version and exit')
 @click.option(
-    "-p",
-    "--path",
-    "path",
+    '-p',
+    '--path',
+    'path',
     type=click.Path(exists=True),
     required=True,
-    help="local pdf filepath or directory",
+    help='local pdf filepath or directory',
 )
 @click.option(
-    "-o",
-    "--output-dir",
-    "output_dir",
-    type=str,
-    help="output local directory",
-    default="",
+    '-o',
+    '--output-dir',
+    'output_dir',
+    type=click.Path(),
+    required=True,
+    help='output local directory',
+    default='',
 )
 @click.option(
-    "-m",
-    "--method",
-    "method",
+    '-m',
+    '--method',
+    'method',
     type=parse_pdf_methods,
-    help="""the method for parsing pdf. 
+    help="""the method for parsing pdf.
 ocr: using ocr technique to extract information from pdf.
 txt: suitable for the text-based pdf only and outperform ocr.
 auto: automatically choose the best method for parsing pdf from ocr and txt.
 without method specified, auto will be used by default.""",
-    default="auto",
+    default='auto',
 )
 def cli(path, output_dir, method):
     model_config.__use_inside_model__ = True
-    model_config.__model_mode__ = "full"
-    if output_dir == "":
-        if os.path.isdir(path):
-            output_dir = os.path.join(path, "output")
-        else:
-            output_dir = os.path.join(os.path.dirname(path), "output")
+    model_config.__model_mode__ = 'full'
+    os.makedirs(output_dir, exist_ok=True)
 
     def read_fn(path):
         disk_rw = DiskReaderWriter(os.path.dirname(path))
@@ -69,11 +70,11 @@ def cli(path, output_dir, method):
             logger.exception(e)
 
     if os.path.isdir(path):
-        for doc_path in Path(path).glob("*.pdf"):
+        for doc_path in Path(path).glob('*.pdf'):
             parse_doc(doc_path)
     else:
         parse_doc(path)
 
 
-if __name__ == "__main__":
+if __name__ == '__main__':
     cli()

+ 61 - 64
magic_pdf/tools/cli_dev.py

@@ -1,35 +1,32 @@
-import os
 import json as json_parse
-import click
+import os
 from pathlib import Path
-from magic_pdf.libs.path_utils import (
-    parse_s3path,
-    parse_s3_range_params,
-    remove_non_official_s3_args,
-)
-from magic_pdf.libs.config_reader import (
-    get_s3_config,
-)
-from magic_pdf.rw.S3ReaderWriter import S3ReaderWriter
-from magic_pdf.rw.DiskReaderWriter import DiskReaderWriter
-from magic_pdf.rw.AbsReaderWriter import AbsReaderWriter
+
+import click
+
 import magic_pdf.model as model_config
-from magic_pdf.tools.common import parse_pdf_methods, do_parse
+from magic_pdf.libs.config_reader import get_s3_config
+from magic_pdf.libs.path_utils import (parse_s3_range_params, parse_s3path,
+                                       remove_non_official_s3_args)
 from magic_pdf.libs.version import __version__
+from magic_pdf.rw.AbsReaderWriter import AbsReaderWriter
+from magic_pdf.rw.DiskReaderWriter import DiskReaderWriter
+from magic_pdf.rw.S3ReaderWriter import S3ReaderWriter
+from magic_pdf.tools.common import do_parse, parse_pdf_methods
 
 
 def read_s3_path(s3path):
     bucket, key = parse_s3path(s3path)
 
     s3_ak, s3_sk, s3_endpoint = get_s3_config(bucket)
-    s3_rw = S3ReaderWriter(
-        s3_ak, s3_sk, s3_endpoint, "auto", remove_non_official_s3_args(s3path)
-    )
+    s3_rw = S3ReaderWriter(s3_ak, s3_sk, s3_endpoint, 'auto',
+                           remove_non_official_s3_args(s3path))
     may_range_params = parse_s3_range_params(s3path)
     if may_range_params is None or 2 != len(may_range_params):
         byte_start, byte_end = 0, None
     else:
-        byte_start, byte_end = int(may_range_params[0]), int(may_range_params[1])
+        byte_start, byte_end = int(may_range_params[0]), int(
+            may_range_params[1])
     return s3_rw.read_offset(
         remove_non_official_s3_args(s3path),
         byte_start,
@@ -38,51 +35,48 @@ def read_s3_path(s3path):
 
 
 @click.group()
-@click.version_option(__version__, "--version", "-v", help="显示版本信息")
+@click.version_option(__version__, '--version', '-v', help='显示版本信息')
 def cli():
     pass
 
 
 @cli.command()
 @click.option(
-    "-j",
-    "--jsonl",
-    "jsonl",
+    '-j',
+    '--jsonl',
+    'jsonl',
     type=str,
-    help="输入 jsonl 路径,本地或者 s3 上的文件",
+    help='输入 jsonl 路径,本地或者 s3 上的文件',
     required=True,
 )
 @click.option(
-    "-m",
-    "--method",
-    "method",
+    '-m',
+    '--method',
+    'method',
     type=parse_pdf_methods,
-    help="指定解析方法。txt: 文本型 pdf 解析方法, ocr: 光学识别解析 pdf, auto: 程序智能选择解析方法",
-    default="auto",
+    help='指定解析方法。txt: 文本型 pdf 解析方法, ocr: 光学识别解析 pdf, auto: 程序智能选择解析方法',
+    default='auto',
 )
 @click.option(
-    "-o",
-    "--output-dir",
-    "output_dir",
-    type=str,
-    help="输出到本地目录",
-    default="",
+    '-o',
+    '--output-dir',
+    'output_dir',
+    type=click.Path(),
+    required=True,
+    help='输出到本地目录',
+    default='',
 )
 def jsonl(jsonl, method, output_dir):
     model_config.__use_inside_model__ = False
-    if jsonl.startswith("s3://"):
-        jso = json_parse.loads(read_s3_path(jsonl).decode("utf-8"))
-        full_jsonl_path = "."
+    if jsonl.startswith('s3://'):
+        jso = json_parse.loads(read_s3_path(jsonl).decode('utf-8'))
     else:
-        full_jsonl_path = os.path.realpath(jsonl)
         with open(jsonl) as f:
             jso = json_parse.loads(f.readline())
-
-    if output_dir == "":
-        output_dir = os.path.join(os.path.dirname(full_jsonl_path), "output")
-    s3_file_path = jso.get("file_location")
+    os.makedirs(output_dir, exist_ok=True)
+    s3_file_path = jso.get('file_location')
     if s3_file_path is None:
-        s3_file_path = jso.get("path")
+        s3_file_path = jso.get('path')
     pdf_file_name = Path(s3_file_path).stem
     pdf_data = read_s3_path(s3_file_path)
 
@@ -91,7 +85,7 @@ def jsonl(jsonl, method, output_dir):
         output_dir,
         pdf_file_name,
         pdf_data,
-        jso["doc_layout_result"],
+        jso['doc_layout_result'],
         method,
         f_dump_content_list=True,
         f_draw_model_bbox=True,
@@ -100,43 +94,46 @@ def jsonl(jsonl, method, output_dir):
 
 @cli.command()
 @click.option(
-    "-p",
-    "--pdf",
-    "pdf",
+    '-p',
+    '--pdf',
+    'pdf',
     type=click.Path(exists=True),
     required=True,
-    help="本地 PDF 文件",
+    help='本地 PDF 文件',
 )
 @click.option(
-    "-j",
-    "--json",
-    "json_data",
+    '-j',
+    '--json',
+    'json_data',
     type=click.Path(exists=True),
     required=True,
-    help="本地模型推理出的 json 数据",
-)
-@click.option(
-    "-o", "--output-dir", "output_dir", type=str, help="本地输出目录", default=""
+    help='本地模型推理出的 json 数据',
 )
+@click.option('-o',
+              '--output-dir',
+              'output_dir',
+              type=click.Path(),
+              required=True,
+              help='本地输出目录',
+              default='')
 @click.option(
-    "-m",
-    "--method",
-    "method",
+    '-m',
+    '--method',
+    'method',
     type=parse_pdf_methods,
-    help="指定解析方法。txt: 文本型 pdf 解析方法, ocr: 光学识别解析 pdf, auto: 程序智能选择解析方法",
-    default="auto",
+    help='指定解析方法。txt: 文本型 pdf 解析方法, ocr: 光学识别解析 pdf, auto: 程序智能选择解析方法',
+    default='auto',
 )
 def pdf(pdf, json_data, output_dir, method):
     model_config.__use_inside_model__ = False
     full_pdf_path = os.path.realpath(pdf)
-    if output_dir == "":
-        output_dir = os.path.join(os.path.dirname(full_pdf_path), "output")
+    os.makedirs(output_dir, exist_ok=True)
 
     def read_fn(path):
         disk_rw = DiskReaderWriter(os.path.dirname(path))
         return disk_rw.read(os.path.basename(path), AbsReaderWriter.MODE_BIN)
 
-    model_json_list = json_parse.loads(read_fn(json_data).decode("utf-8"))
+    model_json_list = json_parse.loads(read_fn(json_data).decode('utf-8'))
 
     file_name = str(Path(full_pdf_path).stem)
     pdf_data = read_fn(full_pdf_path)
@@ -151,5 +148,5 @@ def pdf(pdf, json_data, output_dir, method):
     )
 
 
-if __name__ == "__main__":
+if __name__ == '__main__':
     cli()

+ 44 - 34
magic_pdf/tools/common.py

@@ -1,22 +1,25 @@
-import os
-import json as json_parse
 import copy
+import json as json_parse
+import os
+
 import click
 from loguru import logger
+
+import magic_pdf.model as model_config
+from magic_pdf.libs.draw_bbox import (draw_layout_bbox, draw_span_bbox,
+                                      drow_model_bbox)
 from magic_pdf.libs.MakeContentConfig import DropMode, MakeMode
-from magic_pdf.libs.draw_bbox import draw_layout_bbox, draw_span_bbox, drow_model_bbox
-from magic_pdf.pipe.UNIPipe import UNIPipe
 from magic_pdf.pipe.OCRPipe import OCRPipe
 from magic_pdf.pipe.TXTPipe import TXTPipe
-from magic_pdf.rw.DiskReaderWriter import DiskReaderWriter
+from magic_pdf.pipe.UNIPipe import UNIPipe
 from magic_pdf.rw.AbsReaderWriter import AbsReaderWriter
-import magic_pdf.model as model_config
+from magic_pdf.rw.DiskReaderWriter import DiskReaderWriter
 
 
 def prepare_env(output_dir, pdf_file_name, method):
     local_parent_dir = os.path.join(output_dir, pdf_file_name, method)
 
-    local_image_dir = os.path.join(str(local_parent_dir), "images")
+    local_image_dir = os.path.join(str(local_parent_dir), 'images')
     local_md_dir = local_parent_dir
     os.makedirs(local_image_dir, exist_ok=True)
     os.makedirs(local_md_dir, exist_ok=True)
@@ -40,22 +43,22 @@ def do_parse(
     f_draw_model_bbox=False,
 ):
     orig_model_list = copy.deepcopy(model_list)
-    local_image_dir, local_md_dir = prepare_env(output_dir, pdf_file_name, parse_method)
+    local_image_dir, local_md_dir = prepare_env(output_dir, pdf_file_name,
+                                                parse_method)
 
-    image_writer, md_writer = DiskReaderWriter(local_image_dir), DiskReaderWriter(
-        local_md_dir
-    )
+    image_writer, md_writer = DiskReaderWriter(
+        local_image_dir), DiskReaderWriter(local_md_dir)
     image_dir = str(os.path.basename(local_image_dir))
 
-    if parse_method == "auto":
-        jso_useful_key = {"_pdf_type": "", "model_list": model_list}
+    if parse_method == 'auto':
+        jso_useful_key = {'_pdf_type': '', 'model_list': model_list}
         pipe = UNIPipe(pdf_bytes, jso_useful_key, image_writer, is_debug=True)
-    elif parse_method == "txt":
+    elif parse_method == 'txt':
         pipe = TXTPipe(pdf_bytes, model_list, image_writer, is_debug=True)
-    elif parse_method == "ocr":
+    elif parse_method == 'ocr':
         pipe = OCRPipe(pdf_bytes, model_list, image_writer, is_debug=True)
     else:
-        logger.error("unknown parse method")
+        logger.error('unknown parse method')
         exit(1)
 
     pipe.pipe_classify()
@@ -65,58 +68,65 @@ def do_parse(
             pipe.pipe_analyze()
             orig_model_list = copy.deepcopy(pipe.model_list)
         else:
-            logger.error("need model list input")
+            logger.error('need model list input')
             exit(2)
 
     pipe.pipe_parse()
-    pdf_info = pipe.pdf_mid_data["pdf_info"]
+    pdf_info = pipe.pdf_mid_data['pdf_info']
     if f_draw_layout_bbox:
-        draw_layout_bbox(pdf_info, pdf_bytes, local_md_dir)
+        draw_layout_bbox(pdf_info, pdf_bytes, local_md_dir, pdf_file_name)
     if f_draw_span_bbox:
-        draw_span_bbox(pdf_info, pdf_bytes, local_md_dir)
+        draw_span_bbox(pdf_info, pdf_bytes, local_md_dir, pdf_file_name)
     if f_draw_model_bbox:
-        drow_model_bbox(orig_model_list, pdf_bytes, local_md_dir)
+        drow_model_bbox(orig_model_list, pdf_bytes, local_md_dir,
+                        pdf_file_name)
 
-    md_content = pipe.pipe_mk_markdown(
-        image_dir, drop_mode=DropMode.NONE, md_make_mode=f_make_md_mode
-    )
+    md_content = pipe.pipe_mk_markdown(image_dir,
+                                       drop_mode=DropMode.NONE,
+                                       md_make_mode=f_make_md_mode)
     if f_dump_md:
         md_writer.write(
             content=md_content,
-            path=f"{pdf_file_name}.md",
+            path=f'{pdf_file_name}.md',
             mode=AbsReaderWriter.MODE_TXT,
         )
 
     if f_dump_middle_json:
         md_writer.write(
-            content=json_parse.dumps(pipe.pdf_mid_data, ensure_ascii=False, indent=4),
-            path="middle.json",
+            content=json_parse.dumps(pipe.pdf_mid_data,
+                                     ensure_ascii=False,
+                                     indent=4),
+            path=f'{pdf_file_name}_middle.json',
             mode=AbsReaderWriter.MODE_TXT,
         )
 
     if f_dump_model_json:
         md_writer.write(
-            content=json_parse.dumps(orig_model_list, ensure_ascii=False, indent=4),
-            path="model.json",
+            content=json_parse.dumps(orig_model_list,
+                                     ensure_ascii=False,
+                                     indent=4),
+            path=f'{pdf_file_name}_model.json',
             mode=AbsReaderWriter.MODE_TXT,
         )
 
     if f_dump_orig_pdf:
         md_writer.write(
             content=pdf_bytes,
-            path="origin.pdf",
+            path=f'{pdf_file_name}_origin.pdf',
             mode=AbsReaderWriter.MODE_BIN,
         )
 
     content_list = pipe.pipe_mk_uni_format(image_dir, drop_mode=DropMode.NONE)
     if f_dump_content_list:
         md_writer.write(
-            content=json_parse.dumps(content_list, ensure_ascii=False, indent=4),
-            path="content_list.json",
+            content=json_parse.dumps(content_list,
+                                     ensure_ascii=False,
+                                     indent=4),
+            path=f'{pdf_file_name}_content_list.json',
             mode=AbsReaderWriter.MODE_TXT,
         )
 
-    logger.info(f"local output dir is {local_md_dir}")
+    logger.info(f'local output dir is {local_md_dir}')
 
 
-parse_pdf_methods = click.Choice(["ocr", "txt", "auto"])
+parse_pdf_methods = click.Choice(['ocr', 'txt', 'auto'])

+ 29 - 0
tests/test_tools/assets/cli/pdf/output/cli_test_01/auto/cli_test_01.md

@@ -0,0 +1,29 @@
+dependent on the service headway and the reliability of the departure  time of the service to which passengers are incident.
+
+After briefly introducing the random incidence model, which is  often assumed to hold at short headways, the balance of this section  reviews six studies of passenger incidence behavior that are moti- vated by understanding the relationships between service headway,  service reliability, passenger incidence behavior, and passenger  waiting time in a more nuanced fashion than is embedded in the  random incidence assumption ( 2 ). Three of these studies depend on  manually collected data, two studies use data from AFC systems,  and one study analyzes the issue purely theoretically. These studies  reveal much about passenger incidence behavior, but all are found  to be limited in their general applicability by the methods with  which they collect information about passengers and the services  those passengers intend to use.
+
+# Random Passenger Incidence Behavior
+
+One characterization of passenger incidence behavior is that of ran- dom incidence ( 3 ). The key assumption underlying the random inci- dence model is that the process of passenger arrivals to the public  transport service is independent from the vehicle departure process  of the service. This implies that passengers become incident to the  service at a random time, and thus the instantaneous rate of passen- ger arrivals to the service is uniform over a given period of time. Let  $W$  and $H$  be random variables representing passenger waiting times  and service headways, respectively. Under the random incidence  assumption and the assumption that vehicle capacity is not a binding  constraint, a classic result of transportation science is that
+
+$$
+E!\\left(W\\right)!=!\\frac{E!\\left\[H^{2}\\right\]}{2E!\\left\[H\\right\]}!=!\\frac{E!\\left\[H\\right\]}{2}!!\\left(1!+!\\operatorname{CV}!\\left(H\\right)^{2}\\right)
+$$
+
+where $E\[X\]$  is the probabilistic expectation of some random variable  $X$  and $\\operatorname{CV}(H)$  is the coefficient of variation of $H$ ,  a unitless measure  of the variability of $H$  defined as
+
+$$
+\\mathbf{CV}\\big(H\\big)!=!\\frac{\\boldsymbol{\\upsigma}\_{H}}{E\\big\[H\\big\]}
+$$
+
+where  $\\upsigma\_{H}$  is the standard deviation of $H\\left(4\\right)$ . The second expression  in Equation 1 is particularly useful because it expresses the mean  passenger waiting time as the sum of two components: the waiting  time caused by the mean headway (i.e., the reciprocal of service fre- quency) and the waiting time caused by the variability of the head- ways (which is one measure of service reliability). When the service  is perfectly reliable with constant headways, the mean ­ waiting time  will be simply half the headway.
+
+# More Behaviorally Realistic Incidence Models
+
+Jolliffe and Hutchinson studied bus passenger incidence in South  London suburbs ( 5 ). They observed 10 bus stops for  $^{1\\mathrm{~h~}}$  per day  over 8 days, recording the times of passenger incidence and actual  and scheduled bus departures. They limited their stop selection to  those served by only a single bus route with a single service pat- tern so as to avoid ambiguity about which service a passenger was  waiting for. The authors found that the actual average passenger  waiting time was $30%$  less than predicted by the random incidence  model. They also found that the empirical distributions of passenger  incidence times (by time of day) had peaks just before the respec- tive average bus departure times. They hypothesized the existence  of three classes of passengers: with proportion $q$ ,  passengers whose  time of incidence is causally coincident with that of a bus departure  (e.g., because they saw the approaching bus from their home or a  shop window); with proportion $p(1-q)$ , passengers who time their  arrivals to minimize expected waiting time; and with proportion  $(1-p)(1-q)$ , passengers who are randomly incident. The authors  found that $p$  was positively correlated with the potential reduction  in waiting time (compared with arriving randomly) that resulted  from knowledge of the timetable and of service reliability. They also  found $p$  to be higher in the peak commuting periods rather than in  the off-peak periods, indicating more awareness of the timetable or  historical reliability, or both, by commuters.
+
+Bowman and Turnquist built on the concept of aware and unaware  passengers of proportions $p$  and $(1-p)$ , respectively. They proposed  a utility-based model to estimate $p$  and the distribution of incidence  times, and thus the mean waiting time, of aware passengers over  a given headway as a function of the headway and reliability of  bus departure times $(l)$ . They observed seven bus stops in Chicago,  Illinois, each served by a single (different) bus route, between 6:00  and $8{\\cdot}00;\\mathrm{a.m}$ . for 5 to 10 days each. The bus routes had headways  of 5 to  $20~\\mathrm{min}$  and a range of reliabilities. The authors found that  actual average waiting time was substantially less than predicted  by the random incidence model. They estimated that $p$  was not  statistically significantly different from 1.0, which they explain by  the fact that all observations were taken during peak commuting  times. Their model predicts that the longer the headway and the  more reliable the departures, the more peaked the distribution of  incidence times will be and the closer that peak will be to the next  scheduled departure time. This prediction demonstrates what they  refer to as a safety margin that passengers add to reduce the chance  of missing their bus when the service is known to be somewhat  unreliable. Such a safety margin can also result from unreliability in  passengers’ journeys to the public transport stop or station. Bowman  and ­ Turnquist conclude from their model that the random incidence  model underestimates the waiting time benefits of improving reli- ability and overestimates the waiting time benefits of increasing ser- vice frequency. This is because as reliability increases passengers  can better predict departure times and so can time their incidence to  decrease their waiting time.
+
+Furth and Muller study the issue in a theoretical context and gener- ally agree with the above findings ( 2 ). They are primarily concerned  with the use of data from automatic vehicle-tracking systems to assess  the impacts of reliability on passenger incidence behavior and wait- ing times. They propose that passengers will react to unreliability by  departing earlier than they would with reliable services. Randomly  incident unaware passengers will experience unreliability as a more  dispersed distribution of headways and simply allocate additional  time to their trip plan to improve the chance of arriving at their des- tination on time. Aware passengers, whose incidence is not entirely  random, will react by timing their incidence somewhat earlier than  the scheduled departure time to increase their chance of catching the  desired service. The authors characterize these ­ reactions as the costs  of unreliability.
+
+Luethi et al. continued with the analysis of manually collected  data on actual passenger behavior ( 6 ). They use the language  of probability to describe two classes of passengers. The first is  timetable-dependent passengers (i.e., the aware passengers), whose  incidence behavior is affected by awareness (possibly gained

BIN
tests/test_tools/assets/cli/pdf/output/cli_test_01/auto/layout.pdf


+ 6423 - 0
tests/test_tools/assets/cli/pdf/output/cli_test_01/auto/middle.json

@@ -0,0 +1,6423 @@
+{
+    "pdf_info": [
+        {
+            "preproc_blocks": [
+                {
+                    "type": "text",
+                    "bbox": [
+                        52,
+                        61.956024169921875,
+                        294,
+                        82.99800872802734
+                    ],
+                    "lines": [
+                        {
+                            "bbox": [
+                                52,
+                                61.956024169921875,
+                                294,
+                                72.0000228881836
+                            ],
+                            "spans": [
+                                {
+                                    "bbox": [
+                                        54.0,
+                                        61.956024169921875,
+                                        296.2261657714844,
+                                        72.0000228881836
+                                    ],
+                                    "content": "dependent on the service headway and the reliability of the departure ",
+                                    "type": "text",
+                                    "score": 1.0
+                                }
+                            ]
+                        },
+                        {
+                            "bbox": [
+                                52,
+                                72.95401000976562,
+                                234.2520751953125,
+                                82.99800872802734
+                            ],
+                            "spans": [
+                                {
+                                    "bbox": [
+                                        54.0,
+                                        72.95401000976562,
+                                        234.2520751953125,
+                                        82.99800872802734
+                                    ],
+                                    "content": "time of the service to which passengers are incident.",
+                                    "type": "text",
+                                    "score": 1.0
+                                }
+                            ]
+                        }
+                    ]
+                },
+                {
+                    "type": "text",
+                    "bbox": [
+                        52,
+                        83.85299682617188,
+                        294,
+                        224.68484497070312
+                    ],
+                    "lines": [
+                        {
+                            "bbox": [
+                                63.0,
+                                83.85299682617188,
+                                294,
+                                93.8969955444336
+                            ],
+                            "spans": [
+                                {
+                                    "bbox": [
+                                        63.0,
+                                        83.85299682617188,
+                                        296.24407958984375,
+                                        93.8969955444336
+                                    ],
+                                    "content": "After briefly introducing the random incidence model, which is ",
+                                    "type": "text",
+                                    "score": 1.0
+                                }
+                            ]
+                        },
+                        {
+                            "bbox": [
+                                52,
+                                94.75198364257812,
+                                294,
+                                104.79598236083984
+                            ],
+                            "spans": [
+                                {
+                                    "bbox": [
+                                        54.0,
+                                        94.75198364257812,
+                                        296.25311279296875,
+                                        104.79598236083984
+                                    ],
+                                    "content": "often assumed to hold at short headways, the balance of this section ",
+                                    "type": "text",
+                                    "score": 1.0
+                                }
+                            ]
+                        },
+                        {
+                            "bbox": [
+                                52,
+                                105.65097045898438,
+                                294,
+                                115.6949691772461
+                            ],
+                            "spans": [
+                                {
+                                    "bbox": [
+                                        54.0,
+                                        105.65097045898438,
+                                        294.00299072265625,
+                                        115.6949691772461
+                                    ],
+                                    "content": "reviews six studies of passenger incidence behavior that are moti-",
+                                    "type": "text",
+                                    "score": 1.0
+                                }
+                            ]
+                        },
+                        {
+                            "bbox": [
+                                52,
+                                116.54995727539062,
+                                294,
+                                126.59395599365234
+                            ],
+                            "spans": [
+                                {
+                                    "bbox": [
+                                        53.99998474121094,
+                                        116.54995727539062,
+                                        296.22601318359375,
+                                        126.59395599365234
+                                    ],
+                                    "content": "vated by understanding the relationships between service headway, ",
+                                    "type": "text",
+                                    "score": 1.0
+                                }
+                            ]
+                        },
+                        {
+                            "bbox": [
+                                52,
+                                127.44894409179688,
+                                294,
+                                137.49295043945312
+                            ],
+                            "spans": [
+                                {
+                                    "bbox": [
+                                        53.99998474121094,
+                                        127.44894409179688,
+                                        296.2709655761719,
+                                        137.49295043945312
+                                    ],
+                                    "content": "service reliability, passenger incidence behavior, and passenger ",
+                                    "type": "text",
+                                    "score": 1.0
+                                }
+                            ]
+                        },
+                        {
+                            "bbox": [
+                                52,
+                                138.34793090820312,
+                                294,
+                                148.39193725585938
+                            ],
+                            "spans": [
+                                {
+                                    "bbox": [
+                                        53.99998474121094,
+                                        138.34793090820312,
+                                        296.09100341796875,
+                                        148.39193725585938
+                                    ],
+                                    "content": "waiting time in a more nuanced fashion than is embedded in the ",
+                                    "type": "text",
+                                    "score": 1.0
+                                }
+                            ]
+                        },
+                        {
+                            "bbox": [
+                                52,
+                                149.24691772460938,
+                                294,
+                                159.29092407226562
+                            ],
+                            "spans": [
+                                {
+                                    "bbox": [
+                                        53.99998474121094,
+                                        149.24691772460938,
+                                        165.7889862060547,
+                                        159.29092407226562
+                                    ],
+                                    "content": "random incidence assumption (",
+                                    "type": "text",
+                                    "score": 1.0
+                                },
+                                {
+                                    "bbox": [
+                                        165.7889862060547,
+                                        149.3819122314453,
+                                        170.2889862060547,
+                                        159.28192138671875
+                                    ],
+                                    "content": "2",
+                                    "type": "text",
+                                    "score": 1.0
+                                },
+                                {
+                                    "bbox": [
+                                        170.2889862060547,
+                                        149.24691772460938,
+                                        296.2259826660156,
+                                        159.29092407226562
+                                    ],
+                                    "content": "). Three of these studies depend on ",
+                                    "type": "text",
+                                    "score": 1.0
+                                }
+                            ]
+                        },
+                        {
+                            "bbox": [
+                                52,
+                                160.14590454101562,
+                                294,
+                                170.18991088867188
+                            ],
+                            "spans": [
+                                {
+                                    "bbox": [
+                                        53.99998474121094,
+                                        160.14590454101562,
+                                        296.2080383300781,
+                                        170.18991088867188
+                                    ],
+                                    "content": "manually collected data, two studies use data from AFC systems, ",
+                                    "type": "text",
+                                    "score": 1.0
+                                }
+                            ]
+                        },
+                        {
+                            "bbox": [
+                                52,
+                                171.04489135742188,
+                                294,
+                                181.08889770507812
+                            ],
+                            "spans": [
+                                {
+                                    "bbox": [
+                                        53.99998474121094,
+                                        171.04489135742188,
+                                        296.2620544433594,
+                                        181.08889770507812
+                                    ],
+                                    "content": "and one study analyzes the issue purely theoretically. These studies ",
+                                    "type": "text",
+                                    "score": 1.0
+                                }
+                            ]
+                        },
+                        {
+                            "bbox": [
+                                52,
+                                181.94387817382812,
+                                294,
+                                191.98788452148438
+                            ],
+                            "spans": [
+                                {
+                                    "bbox": [
+                                        53.99998474121094,
+                                        181.94387817382812,
+                                        296.27105712890625,
+                                        191.98788452148438
+                                    ],
+                                    "content": "reveal much about passenger incidence behavior, but all are found ",
+                                    "type": "text",
+                                    "score": 1.0
+                                }
+                            ]
+                        },
+                        {
+                            "bbox": [
+                                52,
+                                192.84286499023438,
+                                294,
+                                202.88687133789062
+                            ],
+                            "spans": [
+                                {
+                                    "bbox": [
+                                        53.99998474121094,
+                                        192.84286499023438,
+                                        296.37005615234375,
+                                        202.88687133789062
+                                    ],
+                                    "content": "to be limited in their general applicability by the methods with ",
+                                    "type": "text",
+                                    "score": 1.0
+                                }
+                            ]
+                        },
+                        {
+                            "bbox": [
+                                52,
+                                203.74185180664062,
+                                294,
+                                213.78585815429688
+                            ],
+                            "spans": [
+                                {
+                                    "bbox": [
+                                        53.99998474121094,
+                                        203.74185180664062,
+                                        296.0097961425781,
+                                        213.78585815429688
+                                    ],
+                                    "content": "which they collect information about passengers and the services ",
+                                    "type": "text",
+                                    "score": 1.0
+                                }
+                            ]
+                        },
+                        {
+                            "bbox": [
+                                52,
+                                214.64083862304688,
+                                164.26797485351562,
+                                224.68484497070312
+                            ],
+                            "spans": [
+                                {
+                                    "bbox": [
+                                        53.99998474121094,
+                                        214.64083862304688,
+                                        164.26797485351562,
+                                        224.68484497070312
+                                    ],
+                                    "content": "those passengers intend to use.",
+                                    "type": "text",
+                                    "score": 1.0
+                                }
+                            ]
+                        }
+                    ]
+                },
+                {
+                    "type": "title",
+                    "bbox": [
+                        54,
+                        246,
+                        224,
+                        258
+                    ],
+                    "lines": [
+                        {
+                            "bbox": [
+                                53.99998474121094,
+                                246.78883361816406,
+                                224.9820098876953,
+                                257.82281494140625
+                            ],
+                            "spans": [
+                                {
+                                    "bbox": [
+                                        53.99998474121094,
+                                        246.78883361816406,
+                                        224.9820098876953,
+                                        257.82281494140625
+                                    ],
+                                    "content": "Random Passenger Incidence Behavior",
+                                    "type": "text",
+                                    "score": 1.0
+                                }
+                            ]
+                        }
+                    ]
+                },
+                {
+                    "type": "text",
+                    "bbox": [
+                        52,
+                        267.5428161621094,
+                        294,
+                        386.5766906738281
+                    ],
+                    "lines": [
+                        {
+                            "bbox": [
+                                52,
+                                267.5428161621094,
+                                294,
+                                277.5868225097656
+                            ],
+                            "spans": [
+                                {
+                                    "bbox": [
+                                        53.99998474121094,
+                                        267.5428161621094,
+                                        294.0120544433594,
+                                        277.5868225097656
+                                    ],
+                                    "content": "One characterization of passenger incidence behavior is that of ran-",
+                                    "type": "text",
+                                    "score": 1.0
+                                }
+                            ]
+                        },
+                        {
+                            "bbox": [
+                                52,
+                                278.4418029785156,
+                                294,
+                                288.4858093261719
+                            ],
+                            "spans": [
+                                {
+                                    "bbox": [
+                                        53.99998474121094,
+                                        278.4418029785156,
+                                        110.82598114013672,
+                                        288.4858093261719
+                                    ],
+                                    "content": "dom incidence (",
+                                    "type": "text",
+                                    "score": 1.0
+                                },
+                                {
+                                    "bbox": [
+                                        110.82598114013672,
+                                        278.5768127441406,
+                                        115.32598114013672,
+                                        288.476806640625
+                                    ],
+                                    "content": "3",
+                                    "type": "text",
+                                    "score": 1.0
+                                },
+                                {
+                                    "bbox": [
+                                        115.32598114013672,
+                                        278.4418029785156,
+                                        294.08404541015625,
+                                        288.4858093261719
+                                    ],
+                                    "content": "). The key assumption underlying the random inci-",
+                                    "type": "text",
+                                    "score": 1.0
+                                }
+                            ]
+                        },
+                        {
+                            "bbox": [
+                                52,
+                                289.3407897949219,
+                                294,
+                                299.3847961425781
+                            ],
+                            "spans": [
+                                {
+                                    "bbox": [
+                                        53.99998474121094,
+                                        289.3407897949219,
+                                        296.2170715332031,
+                                        299.3847961425781
+                                    ],
+                                    "content": "dence model is that the process of passenger arrivals to the public ",
+                                    "type": "text",
+                                    "score": 1.0
+                                }
+                            ]
+                        },
+                        {
+                            "bbox": [
+                                52,
+                                300.2397766113281,
+                                294,
+                                310.2837829589844
+                            ],
+                            "spans": [
+                                {
+                                    "bbox": [
+                                        53.99998474121094,
+                                        300.2397766113281,
+                                        296.2530212402344,
+                                        310.2837829589844
+                                    ],
+                                    "content": "transport service is independent from the vehicle departure process ",
+                                    "type": "text",
+                                    "score": 1.0
+                                }
+                            ]
+                        },
+                        {
+                            "bbox": [
+                                52,
+                                311.1387634277344,
+                                294,
+                                321.1827697753906
+                            ],
+                            "spans": [
+                                {
+                                    "bbox": [
+                                        53.99998474121094,
+                                        311.1387634277344,
+                                        296.24407958984375,
+                                        321.1827697753906
+                                    ],
+                                    "content": "of the service. This implies that passengers become incident to the ",
+                                    "type": "text",
+                                    "score": 1.0
+                                }
+                            ]
+                        },
+                        {
+                            "bbox": [
+                                52,
+                                322.0377502441406,
+                                294,
+                                332.0817565917969
+                            ],
+                            "spans": [
+                                {
+                                    "bbox": [
+                                        53.99998474121094,
+                                        322.0377502441406,
+                                        293.97601318359375,
+                                        332.0817565917969
+                                    ],
+                                    "content": "service at a random time, and thus the instantaneous rate of passen-",
+                                    "type": "text",
+                                    "score": 1.0
+                                }
+                            ]
+                        },
+                        {
+                            "bbox": [
+                                52,
+                                332.9367370605469,
+                                294,
+                                342.9807434082031
+                            ],
+                            "spans": [
+                                {
+                                    "bbox": [
+                                        53.99998474121094,
+                                        332.9367370605469,
+                                        296.27099609375,
+                                        342.9807434082031
+                                    ],
+                                    "content": "ger arrivals to the service is uniform over a given period of time. Let ",
+                                    "type": "text",
+                                    "score": 1.0
+                                }
+                            ]
+                        },
+                        {
+                            "bbox": [
+                                52,
+                                343.8357238769531,
+                                294,
+                                353.8797302246094
+                            ],
+                            "spans": [
+                                {
+                                    "bbox": [
+                                        53,
+                                        344,
+                                        62,
+                                        353
+                                    ],
+                                    "score": 0.63,
+                                    "content": "W",
+                                    "type": "inline_equation"
+                                },
+                                {
+                                    "bbox": [
+                                        61.496986389160156,
+                                        343.8357238769531,
+                                        76.49998474121094,
+                                        353.8797302246094
+                                    ],
+                                    "content": " and",
+                                    "type": "text",
+                                    "score": 1.0
+                                },
+                                {
+                                    "bbox": [
+                                        77,
+                                        344,
+                                        85,
+                                        353
+                                    ],
+                                    "score": 0.74,
+                                    "content": "H",
+                                    "type": "inline_equation"
+                                },
+                                {
+                                    "bbox": [
+                                        85.00498962402344,
+                                        343.8357238769531,
+                                        296.2621154785156,
+                                        353.8797302246094
+                                    ],
+                                    "content": " be random variables representing passenger waiting times ",
+                                    "type": "text",
+                                    "score": 1.0
+                                }
+                            ]
+                        },
+                        {
+                            "bbox": [
+                                52,
+                                354.7347106933594,
+                                294,
+                                364.7787170410156
+                            ],
+                            "spans": [
+                                {
+                                    "bbox": [
+                                        53.99998474121094,
+                                        354.7347106933594,
+                                        296.1269226074219,
+                                        364.7787170410156
+                                    ],
+                                    "content": "and service headways, respectively. Under the random incidence ",
+                                    "type": "text",
+                                    "score": 1.0
+                                }
+                            ]
+                        },
+                        {
+                            "bbox": [
+                                52,
+                                365.6336975097656,
+                                294,
+                                375.6777038574219
+                            ],
+                            "spans": [
+                                {
+                                    "bbox": [
+                                        53.99998474121094,
+                                        365.6336975097656,
+                                        296.36083984375,
+                                        375.6777038574219
+                                    ],
+                                    "content": "assumption and the assumption that vehicle capacity is not a binding ",
+                                    "type": "text",
+                                    "score": 1.0
+                                }
+                            ]
+                        },
+                        {
+                            "bbox": [
+                                52,
+                                376.5326843261719,
+                                260.27996826171875,
+                                386.5766906738281
+                            ],
+                            "spans": [
+                                {
+                                    "bbox": [
+                                        53.99998474121094,
+                                        376.5326843261719,
+                                        260.27996826171875,
+                                        386.5766906738281
+                                    ],
+                                    "content": "constraint, a classic result of transportation science is that",
+                                    "type": "text",
+                                    "score": 1.0
+                                }
+                            ]
+                        }
+                    ]
+                },
+                {
+                    "type": "interline_equation",
+                    "bbox": [
+                        52,
+                        397,
+                        195,
+                        426
+                    ],
+                    "lines": [
+                        {
+                            "bbox": [
+                                52,
+                                397,
+                                195,
+                                426
+                            ],
+                            "spans": [
+                                {
+                                    "bbox": [
+                                        52,
+                                        397,
+                                        195,
+                                        426
+                                    ],
+                                    "score": 0.94,
+                                    "content": "E\\!\\left(W\\right)\\!=\\!\\frac{E\\!\\left[H^{2}\\right]}{2E\\!\\left[H\\right]}\\!=\\!\\frac{E\\!\\left[H\\right]}{2}\\!\\!\\left(1\\!+\\!\\operatorname{CV}\\!\\left(H\\right)^{2}\\right)",
+                                    "type": "interline_equation"
+                                }
+                            ]
+                        }
+                    ]
+                },
+                {
+                    "type": "text",
+                    "bbox": [
+                        52,
+                        437.4519958496094,
+                        294,
+                        469.2939758300781
+                    ],
+                    "lines": [
+                        {
+                            "bbox": [
+                                52,
+                                437.4519958496094,
+                                294,
+                                447.4960021972656
+                            ],
+                            "spans": [
+                                {
+                                    "bbox": [
+                                        54.00300598144531,
+                                        437.4519958496094,
+                                        75.95401000976562,
+                                        447.4960021972656
+                                    ],
+                                    "content": "where",
+                                    "type": "text",
+                                    "score": 1.0
+                                },
+                                {
+                                    "bbox": [
+                                        76,
+                                        438,
+                                        94,
+                                        447
+                                    ],
+                                    "score": 0.88,
+                                    "content": "E[X]",
+                                    "type": "inline_equation"
+                                },
+                                {
+                                    "bbox": [
+                                        94.57499694824219,
+                                        437.4519958496094,
+                                        296.2559814453125,
+                                        447.4960021972656
+                                    ],
+                                    "content": " is the probabilistic expectation of some random variable ",
+                                    "type": "text",
+                                    "score": 1.0
+                                }
+                            ]
+                        },
+                        {
+                            "bbox": [
+                                52,
+                                448,
+                                294,
+                                458.3949890136719
+                            ],
+                            "spans": [
+                                {
+                                    "bbox": [
+                                        52,
+                                        448,
+                                        60,
+                                        457
+                                    ],
+                                    "score": 0.77,
+                                    "content": "X",
+                                    "type": "inline_equation"
+                                },
+                                {
+                                    "bbox": [
+                                        59.50199890136719,
+                                        448.3509826660156,
+                                        74.52300262451172,
+                                        458.3949890136719
+                                    ],
+                                    "content": " and",
+                                    "type": "text",
+                                    "score": 1.0
+                                },
+                                {
+                                    "bbox": [
+                                        75,
+                                        448,
+                                        101,
+                                        458
+                                    ],
+                                    "score": 0.77,
+                                    "content": "\\operatorname{CV}(H)",
+                                    "type": "inline_equation"
+                                },
+                                {
+                                    "bbox": [
+                                        101.54100799560547,
+                                        448.3509826660156,
+                                        215.6699676513672,
+                                        458.3949890136719
+                                    ],
+                                    "content": " is the coefficient of variation of",
+                                    "type": "text",
+                                    "score": 1.0
+                                },
+                                {
+                                    "bbox": [
+                                        216,
+                                        448,
+                                        224,
+                                        457
+                                    ],
+                                    "score": 0.78,
+                                    "content": "H",
+                                    "type": "inline_equation"
+                                },
+                                {
+                                    "bbox": [
+                                        224.19296264648438,
+                                        448.4859924316406,
+                                        226.44296264648438,
+                                        458.385986328125
+                                    ],
+                                    "content": ",",
+                                    "type": "text",
+                                    "score": 1.0
+                                },
+                                {
+                                    "bbox": [
+                                        226.44296264648438,
+                                        448.3509826660156,
+                                        296.2559814453125,
+                                        458.3949890136719
+                                    ],
+                                    "content": " a unitless measure ",
+                                    "type": "text",
+                                    "score": 1.0
+                                }
+                            ]
+                        },
+                        {
+                            "bbox": [
+                                52,
+                                459,
+                                170,
+                                469.2939758300781
+                            ],
+                            "spans": [
+                                {
+                                    "bbox": [
+                                        54.00299835205078,
+                                        459.2499694824219,
+                                        123.39299774169922,
+                                        469.2939758300781
+                                    ],
+                                    "content": "of the variability of",
+                                    "type": "text",
+                                    "score": 1.0
+                                },
+                                {
+                                    "bbox": [
+                                        124,
+                                        459,
+                                        132,
+                                        468
+                                    ],
+                                    "score": 0.81,
+                                    "content": "H",
+                                    "type": "inline_equation"
+                                },
+                                {
+                                    "bbox": [
+                                        132.0419921875,
+                                        459.2499694824219,
+                                        170.30099487304688,
+                                        469.2939758300781
+                                    ],
+                                    "content": " defined as",
+                                    "type": "text",
+                                    "score": 1.0
+                                }
+                            ]
+                        }
+                    ]
+                },
+                {
+                    "type": "interline_equation",
+                    "bbox": [
+                        52,
+                        479,
+                        114,
+                        504
+                    ],
+                    "lines": [
+                        {
+                            "bbox": [
+                                52,
+                                479,
+                                114,
+                                504
+                            ],
+                            "spans": [
+                                {
+                                    "bbox": [
+                                        52,
+                                        479,
+                                        114,
+                                        504
+                                    ],
+                                    "score": 0.91,
+                                    "content": "\\mathbf{CV}\\big(H\\big)\\!=\\!\\frac{\\boldsymbol{\\upsigma}_{H}}{E\\big[H\\big]}",
+                                    "type": "interline_equation"
+                                }
+                            ]
+                        }
+                    ]
+                },
+                {
+                    "type": "text",
+                    "bbox": [
+                        52,
+                        515,
+                        294,
+                        601.5659790039062
+                    ],
+                    "lines": [
+                        {
+                            "bbox": [
+                                52,
+                                515,
+                                294,
+                                525.2139892578125
+                            ],
+                            "spans": [
+                                {
+                                    "bbox": [
+                                        54.00199890136719,
+                                        515.1700439453125,
+                                        78.01400756835938,
+                                        525.2139892578125
+                                    ],
+                                    "content": "where ",
+                                    "type": "text",
+                                    "score": 1.0
+                                },
+                                {
+                                    "bbox": [
+                                        77,
+                                        516,
+                                        88,
+                                        525
+                                    ],
+                                    "score": 0.87,
+                                    "content": "\\upsigma_{H}",
+                                    "type": "inline_equation"
+                                },
+                                {
+                                    "bbox": [
+                                        87.38349914550781,
+                                        515.166015625,
+                                        186.6715545654297,
+                                        525.2099609375
+                                    ],
+                                    "content": " is the standard deviation of",
+                                    "type": "text",
+                                    "score": 1.0
+                                },
+                                {
+                                    "bbox": [
+                                        187,
+                                        515,
+                                        208,
+                                        525
+                                    ],
+                                    "score": 0.81,
+                                    "content": "H\\left(4\\right)",
+                                    "type": "inline_equation"
+                                },
+                                {
+                                    "bbox": [
+                                        208.18150329589844,
+                                        515.166015625,
+                                        296.2464599609375,
+                                        525.2099609375
+                                    ],
+                                    "content": ". The second expression ",
+                                    "type": "text",
+                                    "score": 1.0
+                                }
+                            ]
+                        },
+                        {
+                            "bbox": [
+                                52,
+                                526.0740356445312,
+                                294,
+                                536.1179809570312
+                            ],
+                            "spans": [
+                                {
+                                    "bbox": [
+                                        54.00251770019531,
+                                        526.0740356445312,
+                                        296.2464904785156,
+                                        536.1179809570312
+                                    ],
+                                    "content": "in Equation 1 is particularly useful because it expresses the mean ",
+                                    "type": "text",
+                                    "score": 1.0
+                                }
+                            ]
+                        },
+                        {
+                            "bbox": [
+                                52,
+                                536.9819946289062,
+                                294,
+                                547.0259399414062
+                            ],
+                            "spans": [
+                                {
+                                    "bbox": [
+                                        54.00251770019531,
+                                        536.9819946289062,
+                                        296.2284851074219,
+                                        547.0259399414062
+                                    ],
+                                    "content": "passenger waiting time as the sum of two components: the waiting ",
+                                    "type": "text",
+                                    "score": 1.0
+                                }
+                            ]
+                        },
+                        {
+                            "bbox": [
+                                52,
+                                547.8900146484375,
+                                294,
+                                557.9339599609375
+                            ],
+                            "spans": [
+                                {
+                                    "bbox": [
+                                        54.00251770019531,
+                                        547.8900146484375,
+                                        293.987548828125,
+                                        557.9339599609375
+                                    ],
+                                    "content": "time caused by the mean headway (i.e., the reciprocal of service fre-",
+                                    "type": "text",
+                                    "score": 1.0
+                                }
+                            ]
+                        },
+                        {
+                            "bbox": [
+                                52,
+                                558.7980346679688,
+                                294,
+                                568.8419799804688
+                            ],
+                            "spans": [
+                                {
+                                    "bbox": [
+                                        54.00251770019531,
+                                        558.7980346679688,
+                                        294.0145263671875,
+                                        568.8419799804688
+                                    ],
+                                    "content": "quency) and the waiting time caused by the variability of the head-",
+                                    "type": "text",
+                                    "score": 1.0
+                                }
+                            ]
+                        },
+                        {
+                            "bbox": [
+                                52,
+                                569.7059936523438,
+                                294,
+                                579.7499389648438
+                            ],
+                            "spans": [
+                                {
+                                    "bbox": [
+                                        54.00251770019531,
+                                        569.7059936523438,
+                                        296.2915344238281,
+                                        579.7499389648438
+                                    ],
+                                    "content": "ways (which is one measure of service reliability). When the service ",
+                                    "type": "text",
+                                    "score": 1.0
+                                }
+                            ]
+                        },
+                        {
+                            "bbox": [
+                                52,
+                                580.614013671875,
+                                294,
+                                590.657958984375
+                            ],
+                            "spans": [
+                                {
+                                    "bbox": [
+                                        54.00251770019531,
+                                        580.614013671875,
+                                        251.41763305664062,
+                                        590.657958984375
+                                    ],
+                                    "content": "is perfectly reliable with constant headways, the mean ­",
+                                    "type": "text",
+                                    "score": 1.0
+                                },
+                                {
+                                    "bbox": [
+                                        249.18551635742188,
+                                        580.614013671875,
+                                        296.2464599609375,
+                                        590.657958984375
+                                    ],
+                                    "content": "waiting time ",
+                                    "type": "text",
+                                    "score": 1.0
+                                }
+                            ]
+                        },
+                        {
+                            "bbox": [
+                                52,
+                                591.5220336914062,
+                                170,
+                                601.5659790039062
+                            ],
+                            "spans": [
+                                {
+                                    "bbox": [
+                                        54.00251770019531,
+                                        591.5220336914062,
+                                        168.9235382080078,
+                                        601.5659790039062
+                                    ],
+                                    "content": "will be simply half the headway.",
+                                    "type": "text",
+                                    "score": 1.0
+                                }
+                            ]
+                        }
+                    ]
+                },
+                {
+                    "type": "title",
+                    "bbox": [
+                        53,
+                        623,
+                        252,
+                        634
+                    ],
+                    "lines": [
+                        {
+                            "bbox": [
+                                54.00251770019531,
+                                623.6699829101562,
+                                252.425537109375,
+                                634.7039794921875
+                            ],
+                            "spans": [
+                                {
+                                    "bbox": [
+                                        54.00251770019531,
+                                        623.6699829101562,
+                                        252.425537109375,
+                                        634.7039794921875
+                                    ],
+                                    "content": "More Behaviorally Realistic Incidence Models",
+                                    "type": "text",
+                                    "score": 1.0
+                                }
+                            ]
+                        }
+                    ]
+                },
+                {
+                    "type": "text",
+                    "bbox": [
+                        52,
+                        644.4240112304688,
+                        294,
+                        730.760986328125
+                    ],
+                    "lines": [
+                        {
+                            "bbox": [
+                                52,
+                                644.4240112304688,
+                                294,
+                                654.4679565429688
+                            ],
+                            "spans": [
+                                {
+                                    "bbox": [
+                                        54.00251770019531,
+                                        644.4240112304688,
+                                        296.0845947265625,
+                                        654.4679565429688
+                                    ],
+                                    "content": "Jolliffe and Hutchinson studied bus passenger incidence in South ",
+                                    "type": "text",
+                                    "score": 1.0
+                                }
+                            ]
+                        },
+                        {
+                            "bbox": [
+                                52,
+                                655,
+                                294,
+                                665.3670043945312
+                            ],
+                            "spans": [
+                                {
+                                    "bbox": [
+                                        54.00251770019531,
+                                        655.3230590820312,
+                                        119.24354553222656,
+                                        665.3670043945312
+                                    ],
+                                    "content": "London suburbs (",
+                                    "type": "text",
+                                    "score": 1.0
+                                },
+                                {
+                                    "bbox": [
+                                        119.279541015625,
+                                        655.4580078125,
+                                        123.779541015625,
+                                        665.3580322265625
+                                    ],
+                                    "content": "5",
+                                    "type": "text",
+                                    "score": 1.0
+                                },
+                                {
+                                    "bbox": [
+                                        123.81552124023438,
+                                        655.3230590820312,
+                                        250.9404296875,
+                                        665.3670043945312
+                                    ],
+                                    "content": "). They observed 10 bus stops for ",
+                                    "type": "text",
+                                    "score": 1.0
+                                },
+                                {
+                                    "bbox": [
+                                        250,
+                                        655,
+                                        264,
+                                        664
+                                    ],
+                                    "score": 0.3,
+                                    "content": "^{1\\mathrm{~h~}}",
+                                    "type": "inline_equation"
+                                },
+                                {
+                                    "bbox": [
+                                        263.5404357910156,
+                                        655.3230590820312,
+                                        296.23748779296875,
+                                        665.3670043945312
+                                    ],
+                                    "content": " per day ",
+                                    "type": "text",
+                                    "score": 1.0
+                                }
+                            ]
+                        },
+                        {
+                            "bbox": [
+                                52,
+                                666.2220458984375,
+                                294,
+                                676.2659912109375
+                            ],
+                            "spans": [
+                                {
+                                    "bbox": [
+                                        54.00251770019531,
+                                        666.2220458984375,
+                                        296.2645568847656,
+                                        676.2659912109375
+                                    ],
+                                    "content": "over 8 days, recording the times of passenger incidence and actual ",
+                                    "type": "text",
+                                    "score": 1.0
+                                }
+                            ]
+                        },
+                        {
+                            "bbox": [
+                                52,
+                                677.1210327148438,
+                                294,
+                                687.1649780273438
+                            ],
+                            "spans": [
+                                {
+                                    "bbox": [
+                                        54.00251770019531,
+                                        677.1210327148438,
+                                        296.2375793457031,
+                                        687.1649780273438
+                                    ],
+                                    "content": "and scheduled bus departures. They limited their stop selection to ",
+                                    "type": "text",
+                                    "score": 1.0
+                                }
+                            ]
+                        },
+                        {
+                            "bbox": [
+                                52,
+                                688.0200805664062,
+                                294,
+                                698.0640258789062
+                            ],
+                            "spans": [
+                                {
+                                    "bbox": [
+                                        54.00251770019531,
+                                        688.0200805664062,
+                                        293.7715148925781,
+                                        698.0640258789062
+                                    ],
+                                    "content": "those served by only a single bus route with a single service pat-",
+                                    "type": "text",
+                                    "score": 1.0
+                                }
+                            ]
+                        },
+                        {
+                            "bbox": [
+                                52,
+                                698.9190673828125,
+                                294,
+                                708.9630126953125
+                            ],
+                            "spans": [
+                                {
+                                    "bbox": [
+                                        54.00251770019531,
+                                        698.9190673828125,
+                                        296.2465515136719,
+                                        708.9630126953125
+                                    ],
+                                    "content": "tern so as to avoid ambiguity about which service a passenger was ",
+                                    "type": "text",
+                                    "score": 1.0
+                                }
+                            ]
+                        },
+                        {
+                            "bbox": [
+                                52,
+                                709.8180541992188,
+                                294,
+                                719.8619995117188
+                            ],
+                            "spans": [
+                                {
+                                    "bbox": [
+                                        54.00251770019531,
+                                        709.8180541992188,
+                                        296.2825012207031,
+                                        719.8619995117188
+                                    ],
+                                    "content": "waiting for. The authors found that the actual average passenger ",
+                                    "type": "text",
+                                    "score": 1.0
+                                }
+                            ]
+                        },
+                        {
+                            "bbox": [
+                                52,
+                                720,
+                                294,
+                                730.760986328125
+                            ],
+                            "spans": [
+                                {
+                                    "bbox": [
+                                        54.00251770019531,
+                                        720.717041015625,
+                                        115.4095230102539,
+                                        730.760986328125
+                                    ],
+                                    "content": "waiting time was",
+                                    "type": "text",
+                                    "score": 1.0
+                                },
+                                {
+                                    "bbox": [
+                                        116,
+                                        720,
+                                        134,
+                                        730
+                                    ],
+                                    "score": 0.84,
+                                    "content": "30\\%",
+                                    "type": "inline_equation"
+                                },
+                                {
+                                    "bbox": [
+                                        134.1115264892578,
+                                        720.717041015625,
+                                        296.26458740234375,
+                                        730.760986328125
+                                    ],
+                                    "content": " less than predicted by the random incidence ",
+                                    "type": "text",
+                                    "score": 1.0
+                                }
+                            ]
+                        },
+                        {
+                            "bbox": [
+                                317,
+                                61.935028076171875,
+                                558,
+                                71.9790267944336
+                            ],
+                            "spans": [
+                                {
+                                    "bbox": [
+                                        317.99951171875,
+                                        61.935028076171875,
+                                        560.3607788085938,
+                                        71.9790267944336
+                                    ],
+                                    "content": "model. They also found that the empirical distributions of passenger ",
+                                    "type": "text",
+                                    "score": 1.0
+                                }
+                            ]
+                        },
+                        {
+                            "bbox": [
+                                317,
+                                72.83401489257812,
+                                558,
+                                82.87801361083984
+                            ],
+                            "spans": [
+                                {
+                                    "bbox": [
+                                        317.99951171875,
+                                        72.83401489257812,
+                                        557.9577026367188,
+                                        82.87801361083984
+                                    ],
+                                    "content": "incidence times (by time of day) had peaks just before the respec-",
+                                    "type": "text",
+                                    "score": 1.0
+                                }
+                            ]
+                        },
+                        {
+                            "bbox": [
+                                317,
+                                83.73300170898438,
+                                558,
+                                93.7770004272461
+                            ],
+                            "spans": [
+                                {
+                                    "bbox": [
+                                        317.99951171875,
+                                        83.73300170898438,
+                                        560.2256469726562,
+                                        93.7770004272461
+                                    ],
+                                    "content": "tive average bus departure times. They hypothesized the existence ",
+                                    "type": "text",
+                                    "score": 1.0
+                                }
+                            ]
+                        },
+                        {
+                            "bbox": [
+                                317,
+                                94.63198852539062,
+                                558,
+                                105
+                            ],
+                            "spans": [
+                                {
+                                    "bbox": [
+                                        317.99951171875,
+                                        94.63198852539062,
+                                        483.3477783203125,
+                                        104.67598724365234
+                                    ],
+                                    "content": "of three classes of passengers: with proportion",
+                                    "type": "text",
+                                    "score": 1.0
+                                },
+                                {
+                                    "bbox": [
+                                        484,
+                                        96,
+                                        489,
+                                        105
+                                    ],
+                                    "score": 0.76,
+                                    "content": "q",
+                                    "type": "inline_equation"
+                                },
+                                {
+                                    "bbox": [
+                                        489.8277893066406,
+                                        94.7669906616211,
+                                        492.0777893066406,
+                                        104.6669921875
+                                    ],
+                                    "content": ",",
+                                    "type": "text",
+                                    "score": 1.0
+                                },
+                                {
+                                    "bbox": [
+                                        492.0777893066406,
+                                        94.63198852539062,
+                                        560.2706909179688,
+                                        104.67598724365234
+                                    ],
+                                    "content": " passengers whose ",
+                                    "type": "text",
+                                    "score": 1.0
+                                }
+                            ]
+                        },
+                        {
+                            "bbox": [
+                                317,
+                                105.53097534179688,
+                                558,
+                                115.5749740600586
+                            ],
+                            "spans": [
+                                {
+                                    "bbox": [
+                                        317.99951171875,
+                                        105.53097534179688,
+                                        560.2797241210938,
+                                        115.5749740600586
+                                    ],
+                                    "content": "time of incidence is causally coincident with that of a bus departure ",
+                                    "type": "text",
+                                    "score": 1.0
+                                }
+                            ]
+                        },
+                        {
+                            "bbox": [
+                                317,
+                                116.42996215820312,
+                                558,
+                                126.47396087646484
+                            ],
+                            "spans": [
+                                {
+                                    "bbox": [
+                                        317.99951171875,
+                                        116.42996215820312,
+                                        560.3876953125,
+                                        126.47396087646484
+                                    ],
+                                    "content": "(e.g., because they saw the approaching bus from their home or a ",
+                                    "type": "text",
+                                    "score": 1.0
+                                }
+                            ]
+                        },
+                        {
+                            "bbox": [
+                                317,
+                                127,
+                                558,
+                                138
+                            ],
+                            "spans": [
+                                {
+                                    "bbox": [
+                                        317.99951171875,
+                                        127.32894897460938,
+                                        429.734619140625,
+                                        137.37295532226562
+                                    ],
+                                    "content": "shop window); with proportion",
+                                    "type": "text",
+                                    "score": 1.0
+                                },
+                                {
+                                    "bbox": [
+                                        430,
+                                        127,
+                                        460,
+                                        138
+                                    ],
+                                    "score": 0.91,
+                                    "content": "p(1-q)",
+                                    "type": "inline_equation"
+                                },
+                                {
+                                    "bbox": [
+                                        460.42449951171875,
+                                        127.32894897460938,
+                                        560.2256469726562,
+                                        137.37295532226562
+                                    ],
+                                    "content": ", passengers who time their ",
+                                    "type": "text",
+                                    "score": 1.0
+                                }
+                            ]
+                        },
+                        {
+                            "bbox": [
+                                317,
+                                138.22793579101562,
+                                558,
+                                148.27194213867188
+                            ],
+                            "spans": [
+                                {
+                                    "bbox": [
+                                        317.990478515625,
+                                        138.22793579101562,
+                                        560.135498046875,
+                                        148.27194213867188
+                                    ],
+                                    "content": "arrivals to minimize expected waiting time; and with proportion ",
+                                    "type": "text",
+                                    "score": 1.0
+                                }
+                            ]
+                        },
+                        {
+                            "bbox": [
+                                317,
+                                149,
+                                558,
+                                159.17092895507812
+                            ],
+                            "spans": [
+                                {
+                                    "bbox": [
+                                        317,
+                                        149,
+                                        367,
+                                        159
+                                    ],
+                                    "score": 0.91,
+                                    "content": "(1-p)(1-q)",
+                                    "type": "inline_equation"
+                                },
+                                {
+                                    "bbox": [
+                                        367.43646240234375,
+                                        149.12692260742188,
+                                        560.2435913085938,
+                                        159.17092895507812
+                                    ],
+                                    "content": ", passengers who are randomly incident. The authors ",
+                                    "type": "text",
+                                    "score": 1.0
+                                }
+                            ]
+                        },
+                        {
+                            "bbox": [
+                                317,
+                                160.02590942382812,
+                                558,
+                                170.06991577148438
+                            ],
+                            "spans": [
+                                {
+                                    "bbox": [
+                                        317.9904479980469,
+                                        160.02590942382812,
+                                        355.0434875488281,
+                                        170.06991577148438
+                                    ],
+                                    "content": "found that",
+                                    "type": "text",
+                                    "score": 1.0
+                                },
+                                {
+                                    "bbox": [
+                                        356,
+                                        161,
+                                        362,
+                                        170
+                                    ],
+                                    "score": 0.81,
+                                    "content": "p",
+                                    "type": "inline_equation"
+                                },
+                                {
+                                    "bbox": [
+                                        362.0994873046875,
+                                        160.02590942382812,
+                                        560.2166748046875,
+                                        170.06991577148438
+                                    ],
+                                    "content": " was positively correlated with the potential reduction ",
+                                    "type": "text",
+                                    "score": 1.0
+                                }
+                            ]
+                        },
+                        {
+                            "bbox": [
+                                317,
+                                170.92489624023438,
+                                558,
+                                180.96890258789062
+                            ],
+                            "spans": [
+                                {
+                                    "bbox": [
+                                        317.9904479980469,
+                                        170.92489624023438,
+                                        560.1266479492188,
+                                        180.96890258789062
+                                    ],
+                                    "content": "in waiting time (compared with arriving randomly) that resulted ",
+                                    "type": "text",
+                                    "score": 1.0
+                                }
+                            ]
+                        },
+                        {
+                            "bbox": [
+                                317,
+                                181.82388305664062,
+                                558,
+                                191.86788940429688
+                            ],
+                            "spans": [
+                                {
+                                    "bbox": [
+                                        317.9904479980469,
+                                        181.82388305664062,
+                                        560.3065185546875,
+                                        191.86788940429688
+                                    ],
+                                    "content": "from knowledge of the timetable and of service reliability. They also ",
+                                    "type": "text",
+                                    "score": 1.0
+                                }
+                            ]
+                        },
+                        {
+                            "bbox": [
+                                317,
+                                192.72286987304688,
+                                558,
+                                203
+                            ],
+                            "spans": [
+                                {
+                                    "bbox": [
+                                        317.9904479980469,
+                                        192.72286987304688,
+                                        338.9874572753906,
+                                        202.76687622070312
+                                    ],
+                                    "content": "found",
+                                    "type": "text",
+                                    "score": 1.0
+                                },
+                                {
+                                    "bbox": [
+                                        339,
+                                        194,
+                                        346,
+                                        203
+                                    ],
+                                    "score": 0.8,
+                                    "content": "p",
+                                    "type": "inline_equation"
+                                },
+                                {
+                                    "bbox": [
+                                        345.98944091796875,
+                                        192.72286987304688,
+                                        560.2347412109375,
+                                        202.76687622070312
+                                    ],
+                                    "content": " to be higher in the peak commuting periods rather than in ",
+                                    "type": "text",
+                                    "score": 1.0
+                                }
+                            ]
+                        },
+                        {
+                            "bbox": [
+                                317,
+                                203.62185668945312,
+                                558,
+                                213.66586303710938
+                            ],
+                            "spans": [
+                                {
+                                    "bbox": [
+                                        317.9904479980469,
+                                        203.62185668945312,
+                                        560.2255859375,
+                                        213.66586303710938
+                                    ],
+                                    "content": "the off-peak periods, indicating more awareness of the timetable or ",
+                                    "type": "text",
+                                    "score": 1.0
+                                }
+                            ]
+                        },
+                        {
+                            "bbox": [
+                                317,
+                                214.52084350585938,
+                                475.814697265625,
+                                224.56484985351562
+                            ],
+                            "spans": [
+                                {
+                                    "bbox": [
+                                        317.9904479980469,
+                                        214.52084350585938,
+                                        475.814697265625,
+                                        224.56484985351562
+                                    ],
+                                    "content": "historical reliability, or both, by commuters.",
+                                    "type": "text",
+                                    "score": 1.0
+                                }
+                            ]
+                        }
+                    ]
+                },
+                {
+                    "type": "text",
+                    "bbox": [
+                        317,
+                        61.935028076171875,
+                        558,
+                        224.56484985351562
+                    ],
+                    "lines": [],
+                    "lines_deleted": true
+                },
+                {
+                    "type": "text",
+                    "bbox": [
+                        317,
+                        225.51882934570312,
+                        558,
+                        521.5104370117188
+                    ],
+                    "lines": [
+                        {
+                            "bbox": [
+                                326,
+                                225.51882934570312,
+                                558,
+                                235.56283569335938
+                            ],
+                            "spans": [
+                                {
+                                    "bbox": [
+                                        326.9904479980469,
+                                        225.51882934570312,
+                                        560.3154296875,
+                                        235.56283569335938
+                                    ],
+                                    "content": "Bowman and Turnquist built on the concept of aware and unaware ",
+                                    "type": "text",
+                                    "score": 1.0
+                                }
+                            ]
+                        },
+                        {
+                            "bbox": [
+                                317,
+                                236,
+                                558,
+                                246.56082153320312
+                            ],
+                            "spans": [
+                                {
+                                    "bbox": [
+                                        317.9904479980469,
+                                        236.51681518554688,
+                                        408.9263916015625,
+                                        246.56082153320312
+                                    ],
+                                    "content": "passengers of proportions",
+                                    "type": "text",
+                                    "score": 1.0
+                                },
+                                {
+                                    "bbox": [
+                                        409,
+                                        237,
+                                        415,
+                                        246
+                                    ],
+                                    "score": 0.81,
+                                    "content": "p",
+                                    "type": "inline_equation"
+                                },
+                                {
+                                    "bbox": [
+                                        415.12744140625,
+                                        236.51681518554688,
+                                        429.76141357421875,
+                                        246.56082153320312
+                                    ],
+                                    "content": " and",
+                                    "type": "text",
+                                    "score": 1.0
+                                },
+                                {
+                                    "bbox": [
+                                        430,
+                                        236,
+                                        454,
+                                        246
+                                    ],
+                                    "score": 0.9,
+                                    "content": "(1-p)",
+                                    "type": "inline_equation"
+                                },
+                                {
+                                    "bbox": [
+                                        454.61944580078125,
+                                        236.51681518554688,
+                                        560.1714477539062,
+                                        246.56082153320312
+                                    ],
+                                    "content": ", respectively. They proposed ",
+                                    "type": "text",
+                                    "score": 1.0
+                                }
+                            ]
+                        },
+                        {
+                            "bbox": [
+                                317,
+                                247.51480102539062,
+                                558,
+                                258
+                            ],
+                            "spans": [
+                                {
+                                    "bbox": [
+                                        317.99041748046875,
+                                        247.51480102539062,
+                                        434.2976379394531,
+                                        257.5588073730469
+                                    ],
+                                    "content": "a utility-based model to estimate",
+                                    "type": "text",
+                                    "score": 1.0
+                                },
+                                {
+                                    "bbox": [
+                                        435,
+                                        249,
+                                        441,
+                                        258
+                                    ],
+                                    "score": 0.83,
+                                    "content": "p",
+                                    "type": "inline_equation"
+                                },
+                                {
+                                    "bbox": [
+                                        440.7506408691406,
+                                        247.51480102539062,
+                                        560.252685546875,
+                                        257.5588073730469
+                                    ],
+                                    "content": " and the distribution of incidence ",
+                                    "type": "text",
+                                    "score": 1.0
+                                }
+                            ]
+                        },
+                        {
+                            "bbox": [
+                                317,
+                                258.5127868652344,
+                                558,
+                                268.5567932128906
+                            ],
+                            "spans": [
+                                {
+                                    "bbox": [
+                                        317.99041748046875,
+                                        258.5127868652344,
+                                        560.2796020507812,
+                                        268.5567932128906
+                                    ],
+                                    "content": "times, and thus the mean waiting time, of aware passengers over ",
+                                    "type": "text",
+                                    "score": 1.0
+                                }
+                            ]
+                        },
+                        {
+                            "bbox": [
+                                317,
+                                269.5107727050781,
+                                558,
+                                279.5547790527344
+                            ],
+                            "spans": [
+                                {
+                                    "bbox": [
+                                        317.99041748046875,
+                                        269.5107727050781,
+                                        560.1358032226562,
+                                        279.5547790527344
+                                    ],
+                                    "content": "a given headway as a function of the headway and reliability of ",
+                                    "type": "text",
+                                    "score": 1.0
+                                }
+                            ]
+                        },
+                        {
+                            "bbox": [
+                                317,
+                                280.5087585449219,
+                                558,
+                                290.5527648925781
+                            ],
+                            "spans": [
+                                {
+                                    "bbox": [
+                                        317.99041748046875,
+                                        280.5087585449219,
+                                        387.9205322265625,
+                                        290.5527648925781
+                                    ],
+                                    "content": "bus departure times",
+                                    "type": "text",
+                                    "score": 1.0
+                                },
+                                {
+                                    "bbox": [
+                                        389,
+                                        281,
+                                        400,
+                                        290
+                                    ],
+                                    "score": 0.41,
+                                    "content": "(l)",
+                                    "type": "inline_equation"
+                                },
+                                {
+                                    "bbox": [
+                                        400.38555908203125,
+                                        280.5087585449219,
+                                        560.2526245117188,
+                                        290.5527648925781
+                                    ],
+                                    "content": ". They observed seven bus stops in Chicago, ",
+                                    "type": "text",
+                                    "score": 1.0
+                                }
+                            ]
+                        },
+                        {
+                            "bbox": [
+                                317,
+                                291.5067443847656,
+                                558,
+                                301.5507507324219
+                            ],
+                            "spans": [
+                                {
+                                    "bbox": [
+                                        317.99041748046875,
+                                        291.5067443847656,
+                                        560.2166748046875,
+                                        301.5507507324219
+                                    ],
+                                    "content": "Illinois, each served by a single (different) bus route, between 6:00 ",
+                                    "type": "text",
+                                    "score": 1.0
+                                }
+                            ]
+                        },
+                        {
+                            "bbox": [
+                                317,
+                                302,
+                                558,
+                                312.5487365722656
+                            ],
+                            "spans": [
+                                {
+                                    "bbox": [
+                                        317.99041748046875,
+                                        302.5047302246094,
+                                        330.9864196777344,
+                                        312.5487365722656
+                                    ],
+                                    "content": "and",
+                                    "type": "text",
+                                    "score": 1.0
+                                },
+                                {
+                                    "bbox": [
+                                        332,
+                                        302,
+                                        365,
+                                        312
+                                    ],
+                                    "score": 0.56,
+                                    "content": "8{\\cdot}00\\;\\mathrm{a.m}",
+                                    "type": "inline_equation"
+                                },
+                                {
+                                    "bbox": [
+                                        365.22247314453125,
+                                        302.5047302246094,
+                                        560.198486328125,
+                                        312.5487365722656
+                                    ],
+                                    "content": ". for 5 to 10 days each. The bus routes had headways ",
+                                    "type": "text",
+                                    "score": 1.0
+                                }
+                            ]
+                        },
+                        {
+                            "bbox": [
+                                317,
+                                313,
+                                558,
+                                323.5467224121094
+                            ],
+                            "spans": [
+                                {
+                                    "bbox": [
+                                        317.99041748046875,
+                                        313.5027160644531,
+                                        344.7024230957031,
+                                        323.5467224121094
+                                    ],
+                                    "content": "of 5 to ",
+                                    "type": "text",
+                                    "score": 1.0
+                                },
+                                {
+                                    "bbox": [
+                                        344,
+                                        313,
+                                        371,
+                                        323
+                                    ],
+                                    "score": 0.43,
+                                    "content": "20~\\mathrm{min}",
+                                    "type": "inline_equation"
+                                },
+                                {
+                                    "bbox": [
+                                        370.91943359375,
+                                        313.5027160644531,
+                                        560.3604736328125,
+                                        323.5467224121094
+                                    ],
+                                    "content": " and a range of reliabilities. The authors found that ",
+                                    "type": "text",
+                                    "score": 1.0
+                                }
+                            ]
+                        },
+                        {
+                            "bbox": [
+                                317,
+                                324.5007019042969,
+                                558,
+                                334.5447082519531
+                            ],
+                            "spans": [
+                                {
+                                    "bbox": [
+                                        317.99041748046875,
+                                        324.5007019042969,
+                                        560.11767578125,
+                                        334.5447082519531
+                                    ],
+                                    "content": "actual average waiting time was substantially less than predicted ",
+                                    "type": "text",
+                                    "score": 1.0
+                                }
+                            ]
+                        },
+                        {
+                            "bbox": [
+                                317,
+                                335.4986877441406,
+                                558,
+                                345.5426940917969
+                            ],
+                            "spans": [
+                                {
+                                    "bbox": [
+                                        317.99041748046875,
+                                        335.4986877441406,
+                                        518.0780029296875,
+                                        345.5426940917969
+                                    ],
+                                    "content": "by the random incidence model. They estimated that",
+                                    "type": "text",
+                                    "score": 1.0
+                                },
+                                {
+                                    "bbox": [
+                                        519,
+                                        336,
+                                        525,
+                                        345
+                                    ],
+                                    "score": 0.79,
+                                    "content": "p",
+                                    "type": "inline_equation"
+                                },
+                                {
+                                    "bbox": [
+                                        525.8904418945312,
+                                        335.4986877441406,
+                                        560.2254028320312,
+                                        345.5426940917969
+                                    ],
+                                    "content": " was not ",
+                                    "type": "text",
+                                    "score": 1.0
+                                }
+                            ]
+                        },
+                        {
+                            "bbox": [
+                                317,
+                                346.4966735839844,
+                                558,
+                                356.5406799316406
+                            ],
+                            "spans": [
+                                {
+                                    "bbox": [
+                                        317.99041748046875,
+                                        346.4966735839844,
+                                        560.2166137695312,
+                                        356.5406799316406
+                                    ],
+                                    "content": "statistically significantly different from 1.0, which they explain by ",
+                                    "type": "text",
+                                    "score": 1.0
+                                }
+                            ]
+                        },
+                        {
+                            "bbox": [
+                                317,
+                                357.4946594238281,
+                                558,
+                                367.5386657714844
+                            ],
+                            "spans": [
+                                {
+                                    "bbox": [
+                                        317.99041748046875,
+                                        357.4946594238281,
+                                        560.0095825195312,
+                                        367.5386657714844
+                                    ],
+                                    "content": "the fact that all observations were taken during peak commuting ",
+                                    "type": "text",
+                                    "score": 1.0
+                                }
+                            ]
+                        },
+                        {
+                            "bbox": [
+                                317,
+                                368.4926452636719,
+                                558,
+                                378.5366516113281
+                            ],
+                            "spans": [
+                                {
+                                    "bbox": [
+                                        317.99041748046875,
+                                        368.4926452636719,
+                                        560.1806640625,
+                                        378.5366516113281
+                                    ],
+                                    "content": "times. Their model predicts that the longer the headway and the ",
+                                    "type": "text",
+                                    "score": 1.0
+                                }
+                            ]
+                        },
+                        {
+                            "bbox": [
+                                317,
+                                379.4906311035156,
+                                558,
+                                389.5346374511719
+                            ],
+                            "spans": [
+                                {
+                                    "bbox": [
+                                        317.99041748046875,
+                                        379.4906311035156,
+                                        560.0728149414062,
+                                        389.5346374511719
+                                    ],
+                                    "content": "more reliable the departures, the more peaked the distribution of ",
+                                    "type": "text",
+                                    "score": 1.0
+                                }
+                            ]
+                        },
+                        {
+                            "bbox": [
+                                317,
+                                390.4886169433594,
+                                558,
+                                400.5326232910156
+                            ],
+                            "spans": [
+                                {
+                                    "bbox": [
+                                        317.99041748046875,
+                                        390.4886169433594,
+                                        560.1895751953125,
+                                        400.5326232910156
+                                    ],
+                                    "content": "incidence times will be and the closer that peak will be to the next ",
+                                    "type": "text",
+                                    "score": 1.0
+                                }
+                            ]
+                        },
+                        {
+                            "bbox": [
+                                317,
+                                401.4866027832031,
+                                558,
+                                411.5306091308594
+                            ],
+                            "spans": [
+                                {
+                                    "bbox": [
+                                        317.99041748046875,
+                                        401.4866027832031,
+                                        560.000732421875,
+                                        411.5306091308594
+                                    ],
+                                    "content": "scheduled departure time. This prediction demonstrates what they ",
+                                    "type": "text",
+                                    "score": 1.0
+                                }
+                            ]
+                        },
+                        {
+                            "bbox": [
+                                317,
+                                412.4845886230469,
+                                558,
+                                422.5285949707031
+                            ],
+                            "spans": [
+                                {
+                                    "bbox": [
+                                        317.99041748046875,
+                                        412.4845886230469,
+                                        560.2703857421875,
+                                        422.5285949707031
+                                    ],
+                                    "content": "refer to as a safety margin that passengers add to reduce the chance ",
+                                    "type": "text",
+                                    "score": 1.0
+                                }
+                            ]
+                        },
+                        {
+                            "bbox": [
+                                317,
+                                423.4825744628906,
+                                558,
+                                433.5265808105469
+                            ],
+                            "spans": [
+                                {
+                                    "bbox": [
+                                        317.99041748046875,
+                                        423.4825744628906,
+                                        560.0728149414062,
+                                        433.5265808105469
+                                    ],
+                                    "content": "of missing their bus when the service is known to be somewhat ",
+                                    "type": "text",
+                                    "score": 1.0
+                                }
+                            ]
+                        },
+                        {
+                            "bbox": [
+                                317,
+                                434.4805603027344,
+                                558,
+                                444.5245666503906
+                            ],
+                            "spans": [
+                                {
+                                    "bbox": [
+                                        317.99041748046875,
+                                        434.4805603027344,
+                                        560.252685546875,
+                                        444.5245666503906
+                                    ],
+                                    "content": "unreliable. Such a safety margin can also result from unreliability in ",
+                                    "type": "text",
+                                    "score": 1.0
+                                }
+                            ]
+                        },
+                        {
+                            "bbox": [
+                                317,
+                                445.4785461425781,
+                                558,
+                                455.5225524902344
+                            ],
+                            "spans": [
+                                {
+                                    "bbox": [
+                                        317.99041748046875,
+                                        445.4785461425781,
+                                        560.2434692382812,
+                                        455.5225524902344
+                                    ],
+                                    "content": "passengers’ journeys to the public transport stop or station. Bowman ",
+                                    "type": "text",
+                                    "score": 1.0
+                                }
+                            ]
+                        },
+                        {
+                            "bbox": [
+                                317,
+                                456.4765319824219,
+                                558,
+                                466.5205383300781
+                            ],
+                            "spans": [
+                                {
+                                    "bbox": [
+                                        317.99041748046875,
+                                        456.4765319824219,
+                                        334.96441650390625,
+                                        466.5205383300781
+                                    ],
+                                    "content": "and ­",
+                                    "type": "text",
+                                    "score": 1.0
+                                },
+                                {
+                                    "bbox": [
+                                        332.71441650390625,
+                                        456.4765319824219,
+                                        560.2346801757812,
+                                        466.5205383300781
+                                    ],
+                                    "content": "Turnquist conclude from their model that the random incidence ",
+                                    "type": "text",
+                                    "score": 1.0
+                                }
+                            ]
+                        },
+                        {
+                            "bbox": [
+                                317,
+                                467.4745178222656,
+                                558,
+                                477.5185241699219
+                            ],
+                            "spans": [
+                                {
+                                    "bbox": [
+                                        317.99041748046875,
+                                        467.4745178222656,
+                                        557.7771606445312,
+                                        477.5185241699219
+                                    ],
+                                    "content": "model underestimates the waiting time benefits of improving reli-",
+                                    "type": "text",
+                                    "score": 1.0
+                                }
+                            ]
+                        },
+                        {
+                            "bbox": [
+                                317,
+                                478.4725036621094,
+                                558,
+                                488.5165100097656
+                            ],
+                            "spans": [
+                                {
+                                    "bbox": [
+                                        317.99041748046875,
+                                        478.4725036621094,
+                                        557.993408203125,
+                                        488.5165100097656
+                                    ],
+                                    "content": "ability and overestimates the waiting time benefits of increasing ser-",
+                                    "type": "text",
+                                    "score": 1.0
+                                }
+                            ]
+                        },
+                        {
+                            "bbox": [
+                                317,
+                                489.4704895019531,
+                                558,
+                                499.5144958496094
+                            ],
+                            "spans": [
+                                {
+                                    "bbox": [
+                                        317.99041748046875,
+                                        489.4704895019531,
+                                        560.4146118164062,
+                                        499.5144958496094
+                                    ],
+                                    "content": "vice frequency. This is because as reliability increases passengers ",
+                                    "type": "text",
+                                    "score": 1.0
+                                }
+                            ]
+                        },
+                        {
+                            "bbox": [
+                                317,
+                                500.4684753417969,
+                                558,
+                                510.5124816894531
+                            ],
+                            "spans": [
+                                {
+                                    "bbox": [
+                                        317.99041748046875,
+                                        500.4684753417969,
+                                        560.2705078125,
+                                        510.5124816894531
+                                    ],
+                                    "content": "can better predict departure times and so can time their incidence to ",
+                                    "type": "text",
+                                    "score": 1.0
+                                }
+                            ]
+                        },
+                        {
+                            "bbox": [
+                                317,
+                                511.4664611816406,
+                                417.1165466308594,
+                                521.5104370117188
+                            ],
+                            "spans": [
+                                {
+                                    "bbox": [
+                                        317.99041748046875,
+                                        511.4664611816406,
+                                        417.1165466308594,
+                                        521.5104370117188
+                                    ],
+                                    "content": "decrease their waiting time.",
+                                    "type": "text",
+                                    "score": 1.0
+                                }
+                            ]
+                        }
+                    ]
+                },
+                {
+                    "type": "text",
+                    "bbox": [
+                        317,
+                        522.4734497070312,
+                        558,
+                        675.6084594726562
+                    ],
+                    "lines": [
+                        {
+                            "bbox": [
+                                326,
+                                522.4734497070312,
+                                558,
+                                532.5173950195312
+                            ],
+                            "spans": [
+                                {
+                                    "bbox": [
+                                        326.99041748046875,
+                                        522.4734497070312,
+                                        557.993408203125,
+                                        532.5173950195312
+                                    ],
+                                    "content": "Furth and Muller study the issue in a theoretical context and gener-",
+                                    "type": "text",
+                                    "score": 1.0
+                                }
+                            ]
+                        },
+                        {
+                            "bbox": [
+                                317,
+                                533.48046875,
+                                558,
+                                543.5244140625
+                            ],
+                            "spans": [
+                                {
+                                    "bbox": [
+                                        317.99041748046875,
+                                        533.48046875,
+                                        442.154541015625,
+                                        543.5244140625
+                                    ],
+                                    "content": "ally agree with the above findings (",
+                                    "type": "text",
+                                    "score": 1.0
+                                },
+                                {
+                                    "bbox": [
+                                        442.0645446777344,
+                                        533.6154174804688,
+                                        446.5645446777344,
+                                        543.5154418945312
+                                    ],
+                                    "content": "2",
+                                    "type": "text",
+                                    "score": 1.0
+                                },
+                                {
+                                    "bbox": [
+                                        446.47442626953125,
+                                        533.48046875,
+                                        560.2523803710938,
+                                        543.5244140625
+                                    ],
+                                    "content": "). They are primarily concerned ",
+                                    "type": "text",
+                                    "score": 1.0
+                                }
+                            ]
+                        },
+                        {
+                            "bbox": [
+                                317,
+                                544.4874877929688,
+                                558,
+                                554.5314331054688
+                            ],
+                            "spans": [
+                                {
+                                    "bbox": [
+                                        317.99041748046875,
+                                        544.4874877929688,
+                                        560.1715698242188,
+                                        554.5314331054688
+                                    ],
+                                    "content": "with the use of data from automatic vehicle-tracking systems to assess ",
+                                    "type": "text",
+                                    "score": 1.0
+                                }
+                            ]
+                        },
+                        {
+                            "bbox": [
+                                317,
+                                555.4945068359375,
+                                558,
+                                565.5384521484375
+                            ],
+                            "spans": [
+                                {
+                                    "bbox": [
+                                        317.99041748046875,
+                                        555.4945068359375,
+                                        558.01123046875,
+                                        565.5384521484375
+                                    ],
+                                    "content": "the impacts of reliability on passenger incidence behavior and wait-",
+                                    "type": "text",
+                                    "score": 1.0
+                                }
+                            ]
+                        },
+                        {
+                            "bbox": [
+                                317,
+                                566.5015258789062,
+                                558,
+                                576.5454711914062
+                            ],
+                            "spans": [
+                                {
+                                    "bbox": [
+                                        317.99041748046875,
+                                        566.5015258789062,
+                                        560.2341918945312,
+                                        576.5454711914062
+                                    ],
+                                    "content": "ing times. They propose that passengers will react to unreliability by ",
+                                    "type": "text",
+                                    "score": 1.0
+                                }
+                            ]
+                        },
+                        {
+                            "bbox": [
+                                317,
+                                577.5084838867188,
+                                558,
+                                587.5524291992188
+                            ],
+                            "spans": [
+                                {
+                                    "bbox": [
+                                        317.99041748046875,
+                                        577.5084838867188,
+                                        560.0997314453125,
+                                        587.5524291992188
+                                    ],
+                                    "content": "departing earlier than they would with reliable services. Randomly ",
+                                    "type": "text",
+                                    "score": 1.0
+                                }
+                            ]
+                        },
+                        {
+                            "bbox": [
+                                317,
+                                588.5155029296875,
+                                558,
+                                598.5594482421875
+                            ],
+                            "spans": [
+                                {
+                                    "bbox": [
+                                        317.99041748046875,
+                                        588.5155029296875,
+                                        560.2614135742188,
+                                        598.5594482421875
+                                    ],
+                                    "content": "incident unaware passengers will experience unreliability as a more ",
+                                    "type": "text",
+                                    "score": 1.0
+                                }
+                            ]
+                        },
+                        {
+                            "bbox": [
+                                317,
+                                599.5225219726562,
+                                558,
+                                609.5664672851562
+                            ],
+                            "spans": [
+                                {
+                                    "bbox": [
+                                        317.99041748046875,
+                                        599.5225219726562,
+                                        560.2792358398438,
+                                        609.5664672851562
+                                    ],
+                                    "content": "dispersed distribution of headways and simply allocate additional ",
+                                    "type": "text",
+                                    "score": 1.0
+                                }
+                            ]
+                        },
+                        {
+                            "bbox": [
+                                317,
+                                610.5294799804688,
+                                558,
+                                620.5734252929688
+                            ],
+                            "spans": [
+                                {
+                                    "bbox": [
+                                        317.99041748046875,
+                                        610.5294799804688,
+                                        557.9752807617188,
+                                        620.5734252929688
+                                    ],
+                                    "content": "time to their trip plan to improve the chance of arriving at their des-",
+                                    "type": "text",
+                                    "score": 1.0
+                                }
+                            ]
+                        },
+                        {
+                            "bbox": [
+                                317,
+                                621.5364990234375,
+                                558,
+                                631.5804443359375
+                            ],
+                            "spans": [
+                                {
+                                    "bbox": [
+                                        317.99041748046875,
+                                        621.5364990234375,
+                                        560.0191040039062,
+                                        631.5804443359375
+                                    ],
+                                    "content": "tination on time. Aware passengers, whose incidence is not entirely ",
+                                    "type": "text",
+                                    "score": 1.0
+                                }
+                            ]
+                        },
+                        {
+                            "bbox": [
+                                317,
+                                632.5435180664062,
+                                558,
+                                642.5874633789062
+                            ],
+                            "spans": [
+                                {
+                                    "bbox": [
+                                        317.99041748046875,
+                                        632.5435180664062,
+                                        560.1539306640625,
+                                        642.5874633789062
+                                    ],
+                                    "content": "random, will react by timing their incidence somewhat earlier than ",
+                                    "type": "text",
+                                    "score": 1.0
+                                }
+                            ]
+                        },
+                        {
+                            "bbox": [
+                                317,
+                                643.550537109375,
+                                558,
+                                653.594482421875
+                            ],
+                            "spans": [
+                                {
+                                    "bbox": [
+                                        317.99041748046875,
+                                        643.550537109375,
+                                        560.2793579101562,
+                                        653.594482421875
+                                    ],
+                                    "content": "the scheduled departure time to increase their chance of catching the ",
+                                    "type": "text",
+                                    "score": 1.0
+                                }
+                            ]
+                        },
+                        {
+                            "bbox": [
+                                317,
+                                654.5575561523438,
+                                558,
+                                664.6015014648438
+                            ],
+                            "spans": [
+                                {
+                                    "bbox": [
+                                        317.99041748046875,
+                                        654.5575561523438,
+                                        486.0926208496094,
+                                        664.6015014648438
+                                    ],
+                                    "content": "desired service. The authors characterize these ­",
+                                    "type": "text",
+                                    "score": 1.0
+                                },
+                                {
+                                    "bbox": [
+                                        483.82440185546875,
+                                        654.5575561523438,
+                                        560.2432250976562,
+                                        664.6015014648438
+                                    ],
+                                    "content": "reactions as the costs ",
+                                    "type": "text",
+                                    "score": 1.0
+                                }
+                            ]
+                        },
+                        {
+                            "bbox": [
+                                317,
+                                665.5645141601562,
+                                371.8464050292969,
+                                675.6084594726562
+                            ],
+                            "spans": [
+                                {
+                                    "bbox": [
+                                        317.99041748046875,
+                                        665.5645141601562,
+                                        371.8464050292969,
+                                        675.6084594726562
+                                    ],
+                                    "content": "of unreliability.",
+                                    "type": "text",
+                                    "score": 1.0
+                                }
+                            ]
+                        }
+                    ]
+                },
+                {
+                    "type": "text",
+                    "bbox": [
+                        317,
+                        676.5625610351562,
+                        558,
+                        730.5984497070312
+                    ],
+                    "lines": [
+                        {
+                            "bbox": [
+                                326,
+                                676.5625610351562,
+                                558,
+                                686.6065063476562
+                            ],
+                            "spans": [
+                                {
+                                    "bbox": [
+                                        326.99041748046875,
+                                        676.5625610351562,
+                                        560.261474609375,
+                                        686.6065063476562
+                                    ],
+                                    "content": "Luethi et al. continued with the analysis of manually collected ",
+                                    "type": "text",
+                                    "score": 1.0
+                                }
+                            ]
+                        },
+                        {
+                            "bbox": [
+                                317,
+                                687.560546875,
+                                558,
+                                697.6044921875
+                            ],
+                            "spans": [
+                                {
+                                    "bbox": [
+                                        317.99041748046875,
+                                        687.560546875,
+                                        456.347412109375,
+                                        697.6044921875
+                                    ],
+                                    "content": "data on actual passenger behavior (",
+                                    "type": "text",
+                                    "score": 1.0
+                                },
+                                {
+                                    "bbox": [
+                                        456.5364074707031,
+                                        687.6954956054688,
+                                        461.0364074707031,
+                                        697.5955200195312
+                                    ],
+                                    "content": "6",
+                                    "type": "text",
+                                    "score": 1.0
+                                },
+                                {
+                                    "bbox": [
+                                        461.33343505859375,
+                                        687.560546875,
+                                        560.1715087890625,
+                                        697.6044921875
+                                    ],
+                                    "content": "). They use the language ",
+                                    "type": "text",
+                                    "score": 1.0
+                                }
+                            ]
+                        },
+                        {
+                            "bbox": [
+                                317,
+                                698.5585327148438,
+                                558,
+                                708.6024780273438
+                            ],
+                            "spans": [
+                                {
+                                    "bbox": [
+                                        317.99041748046875,
+                                        698.5585327148438,
+                                        560.3427734375,
+                                        708.6024780273438
+                                    ],
+                                    "content": "of probability to describe two classes of passengers. The first is ",
+                                    "type": "text",
+                                    "score": 1.0
+                                }
+                            ]
+                        },
+                        {
+                            "bbox": [
+                                317,
+                                709.5565185546875,
+                                558,
+                                719.6004638671875
+                            ],
+                            "spans": [
+                                {
+                                    "bbox": [
+                                        317.99041748046875,
+                                        709.5565185546875,
+                                        560.2250366210938,
+                                        719.6004638671875
+                                    ],
+                                    "content": "timetable-dependent passengers (i.e., the aware passengers), whose ",
+                                    "type": "text",
+                                    "score": 1.0
+                                }
+                            ]
+                        },
+                        {
+                            "bbox": [
+                                317,
+                                720.5545043945312,
+                                558,
+                                730.5984497070312
+                            ],
+                            "spans": [
+                                {
+                                    "bbox": [
+                                        317.99041748046875,
+                                        720.5545043945312,
+                                        560.027587890625,
+                                        730.5984497070312
+                                    ],
+                                    "content": "incidence behavior is affected by awareness (possibly gained ",
+                                    "type": "text",
+                                    "score": 1.0
+                                }
+                            ]
+                        }
+                    ]
+                }
+            ],
+            "layout_bboxes": [
+                {
+                    "layout_bbox": [
+                        52,
+                        61,
+                        294,
+                        731
+                    ],
+                    "layout_label": "V",
+                    "sub_layout": []
+                },
+                {
+                    "layout_bbox": [
+                        317,
+                        61,
+                        558,
+                        731
+                    ],
+                    "layout_label": "V",
+                    "sub_layout": []
+                }
+            ],
+            "page_idx": 0,
+            "page_size": [
+                612.0,
+                792.0
+            ],
+            "_layout_tree": [
+                {
+                    "layout_bbox": [
+                        0,
+                        61,
+                        612.0,
+                        731
+                    ],
+                    "layout_label": "V",
+                    "sub_layout": [
+                        {
+                            "layout_bbox": [
+                                52,
+                                61,
+                                558,
+                                731
+                            ],
+                            "layout_label": "H",
+                            "sub_layout": [
+                                {
+                                    "layout_bbox": [
+                                        52,
+                                        61,
+                                        294,
+                                        731
+                                    ],
+                                    "layout_label": "V",
+                                    "sub_layout": []
+                                },
+                                {
+                                    "layout_bbox": [
+                                        317,
+                                        61,
+                                        558,
+                                        731
+                                    ],
+                                    "layout_label": "V",
+                                    "sub_layout": []
+                                }
+                            ]
+                        }
+                    ]
+                }
+            ],
+            "images": [],
+            "tables": [],
+            "interline_equations": [
+                {
+                    "type": "interline_equation",
+                    "bbox": [
+                        52,
+                        397,
+                        195,
+                        426
+                    ],
+                    "lines": [
+                        {
+                            "bbox": [
+                                52,
+                                397,
+                                195,
+                                426
+                            ],
+                            "spans": [
+                                {
+                                    "bbox": [
+                                        52,
+                                        397,
+                                        195,
+                                        426
+                                    ],
+                                    "score": 0.94,
+                                    "content": "E\\!\\left(W\\right)\\!=\\!\\frac{E\\!\\left[H^{2}\\right]}{2E\\!\\left[H\\right]}\\!=\\!\\frac{E\\!\\left[H\\right]}{2}\\!\\!\\left(1\\!+\\!\\operatorname{CV}\\!\\left(H\\right)^{2}\\right)",
+                                    "type": "interline_equation"
+                                }
+                            ]
+                        }
+                    ]
+                },
+                {
+                    "type": "interline_equation",
+                    "bbox": [
+                        52,
+                        479,
+                        114,
+                        504
+                    ],
+                    "lines": [
+                        {
+                            "bbox": [
+                                52,
+                                479,
+                                114,
+                                504
+                            ],
+                            "spans": [
+                                {
+                                    "bbox": [
+                                        52,
+                                        479,
+                                        114,
+                                        504
+                                    ],
+                                    "score": 0.91,
+                                    "content": "\\mathbf{CV}\\big(H\\big)\\!=\\!\\frac{\\boldsymbol{\\upsigma}_{H}}{E\\big[H\\big]}",
+                                    "type": "interline_equation"
+                                }
+                            ]
+                        }
+                    ]
+                }
+            ],
+            "discarded_blocks": [
+                {
+                    "type": "discarded",
+                    "bbox": [
+                        547,
+                        35,
+                        558,
+                        43
+                    ],
+                    "lines": [
+                        {
+                            "bbox": [
+                                547.6500244140625,
+                                34.8650016784668,
+                                558.0,
+                                43.872501373291016
+                            ],
+                            "spans": [
+                                {
+                                    "bbox": [
+                                        547.6500244140625,
+                                        34.8650016784668,
+                                        558.0,
+                                        43.872501373291016
+                                    ],
+                                    "content": "53",
+                                    "type": "text",
+                                    "score": 1.0
+                                }
+                            ]
+                        }
+                    ]
+                },
+                {
+                    "type": "discarded",
+                    "bbox": [
+                        53,
+                        35,
+                        114,
+                        43
+                    ],
+                    "lines": [
+                        {
+                            "bbox": [
+                                54.0,
+                                34.8650016784668,
+                                116.67750549316406,
+                                43.872501373291016
+                            ],
+                            "spans": [
+                                {
+                                    "bbox": [
+                                        54.0,
+                                        34.8650016784668,
+                                        116.67750549316406,
+                                        43.872501373291016
+                                    ],
+                                    "content": "Frumin and Zhao\b",
+                                    "type": "text",
+                                    "score": 1.0
+                                }
+                            ]
+                        }
+                    ]
+                }
+            ],
+            "need_drop": false,
+            "drop_reason": [],
+            "para_blocks": [
+                {
+                    "type": "text",
+                    "bbox": [
+                        52,
+                        61.956024169921875,
+                        294,
+                        82.99800872802734
+                    ],
+                    "lines": [
+                        {
+                            "bbox": [
+                                52,
+                                61.956024169921875,
+                                294,
+                                72.0000228881836
+                            ],
+                            "spans": [
+                                {
+                                    "bbox": [
+                                        54.0,
+                                        61.956024169921875,
+                                        296.2261657714844,
+                                        72.0000228881836
+                                    ],
+                                    "content": "dependent on the service headway and the reliability of the departure ",
+                                    "type": "text",
+                                    "score": 1.0
+                                }
+                            ]
+                        },
+                        {
+                            "bbox": [
+                                52,
+                                72.95401000976562,
+                                234.2520751953125,
+                                82.99800872802734
+                            ],
+                            "spans": [
+                                {
+                                    "bbox": [
+                                        54.0,
+                                        72.95401000976562,
+                                        234.2520751953125,
+                                        82.99800872802734
+                                    ],
+                                    "content": "time of the service to which passengers are incident.",
+                                    "type": "text",
+                                    "score": 1.0
+                                }
+                            ]
+                        }
+                    ]
+                },
+                {
+                    "type": "text",
+                    "bbox": [
+                        52,
+                        83.85299682617188,
+                        294,
+                        224.68484497070312
+                    ],
+                    "lines": [
+                        {
+                            "bbox": [
+                                63.0,
+                                83.85299682617188,
+                                294,
+                                93.8969955444336
+                            ],
+                            "spans": [
+                                {
+                                    "bbox": [
+                                        63.0,
+                                        83.85299682617188,
+                                        296.24407958984375,
+                                        93.8969955444336
+                                    ],
+                                    "content": "After briefly introducing the random incidence model, which is ",
+                                    "type": "text",
+                                    "score": 1.0
+                                }
+                            ]
+                        },
+                        {
+                            "bbox": [
+                                52,
+                                94.75198364257812,
+                                294,
+                                104.79598236083984
+                            ],
+                            "spans": [
+                                {
+                                    "bbox": [
+                                        54.0,
+                                        94.75198364257812,
+                                        296.25311279296875,
+                                        104.79598236083984
+                                    ],
+                                    "content": "often assumed to hold at short headways, the balance of this section ",
+                                    "type": "text",
+                                    "score": 1.0
+                                }
+                            ]
+                        },
+                        {
+                            "bbox": [
+                                52,
+                                105.65097045898438,
+                                294,
+                                115.6949691772461
+                            ],
+                            "spans": [
+                                {
+                                    "bbox": [
+                                        54.0,
+                                        105.65097045898438,
+                                        294.00299072265625,
+                                        115.6949691772461
+                                    ],
+                                    "content": "reviews six studies of passenger incidence behavior that are moti-",
+                                    "type": "text",
+                                    "score": 1.0
+                                }
+                            ]
+                        },
+                        {
+                            "bbox": [
+                                52,
+                                116.54995727539062,
+                                294,
+                                126.59395599365234
+                            ],
+                            "spans": [
+                                {
+                                    "bbox": [
+                                        53.99998474121094,
+                                        116.54995727539062,
+                                        296.22601318359375,
+                                        126.59395599365234
+                                    ],
+                                    "content": "vated by understanding the relationships between service headway, ",
+                                    "type": "text",
+                                    "score": 1.0
+                                }
+                            ]
+                        },
+                        {
+                            "bbox": [
+                                52,
+                                127.44894409179688,
+                                294,
+                                137.49295043945312
+                            ],
+                            "spans": [
+                                {
+                                    "bbox": [
+                                        53.99998474121094,
+                                        127.44894409179688,
+                                        296.2709655761719,
+                                        137.49295043945312
+                                    ],
+                                    "content": "service reliability, passenger incidence behavior, and passenger ",
+                                    "type": "text",
+                                    "score": 1.0
+                                }
+                            ]
+                        },
+                        {
+                            "bbox": [
+                                52,
+                                138.34793090820312,
+                                294,
+                                148.39193725585938
+                            ],
+                            "spans": [
+                                {
+                                    "bbox": [
+                                        53.99998474121094,
+                                        138.34793090820312,
+                                        296.09100341796875,
+                                        148.39193725585938
+                                    ],
+                                    "content": "waiting time in a more nuanced fashion than is embedded in the ",
+                                    "type": "text",
+                                    "score": 1.0
+                                }
+                            ]
+                        },
+                        {
+                            "bbox": [
+                                52,
+                                149.24691772460938,
+                                294,
+                                159.29092407226562
+                            ],
+                            "spans": [
+                                {
+                                    "bbox": [
+                                        53.99998474121094,
+                                        149.24691772460938,
+                                        165.7889862060547,
+                                        159.29092407226562
+                                    ],
+                                    "content": "random incidence assumption (",
+                                    "type": "text",
+                                    "score": 1.0
+                                },
+                                {
+                                    "bbox": [
+                                        165.7889862060547,
+                                        149.3819122314453,
+                                        170.2889862060547,
+                                        159.28192138671875
+                                    ],
+                                    "content": "2",
+                                    "type": "text",
+                                    "score": 1.0
+                                },
+                                {
+                                    "bbox": [
+                                        170.2889862060547,
+                                        149.24691772460938,
+                                        296.2259826660156,
+                                        159.29092407226562
+                                    ],
+                                    "content": "). Three of these studies depend on ",
+                                    "type": "text",
+                                    "score": 1.0
+                                }
+                            ]
+                        },
+                        {
+                            "bbox": [
+                                52,
+                                160.14590454101562,
+                                294,
+                                170.18991088867188
+                            ],
+                            "spans": [
+                                {
+                                    "bbox": [
+                                        53.99998474121094,
+                                        160.14590454101562,
+                                        296.2080383300781,
+                                        170.18991088867188
+                                    ],
+                                    "content": "manually collected data, two studies use data from AFC systems, ",
+                                    "type": "text",
+                                    "score": 1.0
+                                }
+                            ]
+                        },
+                        {
+                            "bbox": [
+                                52,
+                                171.04489135742188,
+                                294,
+                                181.08889770507812
+                            ],
+                            "spans": [
+                                {
+                                    "bbox": [
+                                        53.99998474121094,
+                                        171.04489135742188,
+                                        296.2620544433594,
+                                        181.08889770507812
+                                    ],
+                                    "content": "and one study analyzes the issue purely theoretically. These studies ",
+                                    "type": "text",
+                                    "score": 1.0
+                                }
+                            ]
+                        },
+                        {
+                            "bbox": [
+                                52,
+                                181.94387817382812,
+                                294,
+                                191.98788452148438
+                            ],
+                            "spans": [
+                                {
+                                    "bbox": [
+                                        53.99998474121094,
+                                        181.94387817382812,
+                                        296.27105712890625,
+                                        191.98788452148438
+                                    ],
+                                    "content": "reveal much about passenger incidence behavior, but all are found ",
+                                    "type": "text",
+                                    "score": 1.0
+                                }
+                            ]
+                        },
+                        {
+                            "bbox": [
+                                52,
+                                192.84286499023438,
+                                294,
+                                202.88687133789062
+                            ],
+                            "spans": [
+                                {
+                                    "bbox": [
+                                        53.99998474121094,
+                                        192.84286499023438,
+                                        296.37005615234375,
+                                        202.88687133789062
+                                    ],
+                                    "content": "to be limited in their general applicability by the methods with ",
+                                    "type": "text",
+                                    "score": 1.0
+                                }
+                            ]
+                        },
+                        {
+                            "bbox": [
+                                52,
+                                203.74185180664062,
+                                294,
+                                213.78585815429688
+                            ],
+                            "spans": [
+                                {
+                                    "bbox": [
+                                        53.99998474121094,
+                                        203.74185180664062,
+                                        296.0097961425781,
+                                        213.78585815429688
+                                    ],
+                                    "content": "which they collect information about passengers and the services ",
+                                    "type": "text",
+                                    "score": 1.0
+                                }
+                            ]
+                        },
+                        {
+                            "bbox": [
+                                52,
+                                214.64083862304688,
+                                164.26797485351562,
+                                224.68484497070312
+                            ],
+                            "spans": [
+                                {
+                                    "bbox": [
+                                        53.99998474121094,
+                                        214.64083862304688,
+                                        164.26797485351562,
+                                        224.68484497070312
+                                    ],
+                                    "content": "those passengers intend to use.",
+                                    "type": "text",
+                                    "score": 1.0
+                                }
+                            ]
+                        }
+                    ]
+                },
+                {
+                    "type": "title",
+                    "bbox": [
+                        54,
+                        246,
+                        224,
+                        258
+                    ],
+                    "lines": [
+                        {
+                            "bbox": [
+                                53.99998474121094,
+                                246.78883361816406,
+                                224.9820098876953,
+                                257.82281494140625
+                            ],
+                            "spans": [
+                                {
+                                    "bbox": [
+                                        53.99998474121094,
+                                        246.78883361816406,
+                                        224.9820098876953,
+                                        257.82281494140625
+                                    ],
+                                    "content": "Random Passenger Incidence Behavior",
+                                    "type": "text",
+                                    "score": 1.0
+                                }
+                            ]
+                        }
+                    ]
+                },
+                {
+                    "type": "text",
+                    "bbox": [
+                        52,
+                        267.5428161621094,
+                        294,
+                        386.5766906738281
+                    ],
+                    "lines": [
+                        {
+                            "bbox": [
+                                52,
+                                267.5428161621094,
+                                294,
+                                277.5868225097656
+                            ],
+                            "spans": [
+                                {
+                                    "bbox": [
+                                        53.99998474121094,
+                                        267.5428161621094,
+                                        294.0120544433594,
+                                        277.5868225097656
+                                    ],
+                                    "content": "One characterization of passenger incidence behavior is that of ran-",
+                                    "type": "text",
+                                    "score": 1.0
+                                }
+                            ]
+                        },
+                        {
+                            "bbox": [
+                                52,
+                                278.4418029785156,
+                                294,
+                                288.4858093261719
+                            ],
+                            "spans": [
+                                {
+                                    "bbox": [
+                                        53.99998474121094,
+                                        278.4418029785156,
+                                        110.82598114013672,
+                                        288.4858093261719
+                                    ],
+                                    "content": "dom incidence (",
+                                    "type": "text",
+                                    "score": 1.0
+                                },
+                                {
+                                    "bbox": [
+                                        110.82598114013672,
+                                        278.5768127441406,
+                                        115.32598114013672,
+                                        288.476806640625
+                                    ],
+                                    "content": "3",
+                                    "type": "text",
+                                    "score": 1.0
+                                },
+                                {
+                                    "bbox": [
+                                        115.32598114013672,
+                                        278.4418029785156,
+                                        294.08404541015625,
+                                        288.4858093261719
+                                    ],
+                                    "content": "). The key assumption underlying the random inci-",
+                                    "type": "text",
+                                    "score": 1.0
+                                }
+                            ]
+                        },
+                        {
+                            "bbox": [
+                                52,
+                                289.3407897949219,
+                                294,
+                                299.3847961425781
+                            ],
+                            "spans": [
+                                {
+                                    "bbox": [
+                                        53.99998474121094,
+                                        289.3407897949219,
+                                        296.2170715332031,
+                                        299.3847961425781
+                                    ],
+                                    "content": "dence model is that the process of passenger arrivals to the public ",
+                                    "type": "text",
+                                    "score": 1.0
+                                }
+                            ]
+                        },
+                        {
+                            "bbox": [
+                                52,
+                                300.2397766113281,
+                                294,
+                                310.2837829589844
+                            ],
+                            "spans": [
+                                {
+                                    "bbox": [
+                                        53.99998474121094,
+                                        300.2397766113281,
+                                        296.2530212402344,
+                                        310.2837829589844
+                                    ],
+                                    "content": "transport service is independent from the vehicle departure process ",
+                                    "type": "text",
+                                    "score": 1.0
+                                }
+                            ]
+                        },
+                        {
+                            "bbox": [
+                                52,
+                                311.1387634277344,
+                                294,
+                                321.1827697753906
+                            ],
+                            "spans": [
+                                {
+                                    "bbox": [
+                                        53.99998474121094,
+                                        311.1387634277344,
+                                        296.24407958984375,
+                                        321.1827697753906
+                                    ],
+                                    "content": "of the service. This implies that passengers become incident to the ",
+                                    "type": "text",
+                                    "score": 1.0
+                                }
+                            ]
+                        },
+                        {
+                            "bbox": [
+                                52,
+                                322.0377502441406,
+                                294,
+                                332.0817565917969
+                            ],
+                            "spans": [
+                                {
+                                    "bbox": [
+                                        53.99998474121094,
+                                        322.0377502441406,
+                                        293.97601318359375,
+                                        332.0817565917969
+                                    ],
+                                    "content": "service at a random time, and thus the instantaneous rate of passen-",
+                                    "type": "text",
+                                    "score": 1.0
+                                }
+                            ]
+                        },
+                        {
+                            "bbox": [
+                                52,
+                                332.9367370605469,
+                                294,
+                                342.9807434082031
+                            ],
+                            "spans": [
+                                {
+                                    "bbox": [
+                                        53.99998474121094,
+                                        332.9367370605469,
+                                        296.27099609375,
+                                        342.9807434082031
+                                    ],
+                                    "content": "ger arrivals to the service is uniform over a given period of time. Let ",
+                                    "type": "text",
+                                    "score": 1.0
+                                }
+                            ]
+                        },
+                        {
+                            "bbox": [
+                                52,
+                                343.8357238769531,
+                                294,
+                                353.8797302246094
+                            ],
+                            "spans": [
+                                {
+                                    "bbox": [
+                                        53,
+                                        344,
+                                        62,
+                                        353
+                                    ],
+                                    "score": 0.63,
+                                    "content": "W",
+                                    "type": "inline_equation"
+                                },
+                                {
+                                    "bbox": [
+                                        61.496986389160156,
+                                        343.8357238769531,
+                                        76.49998474121094,
+                                        353.8797302246094
+                                    ],
+                                    "content": " and",
+                                    "type": "text",
+                                    "score": 1.0
+                                },
+                                {
+                                    "bbox": [
+                                        77,
+                                        344,
+                                        85,
+                                        353
+                                    ],
+                                    "score": 0.74,
+                                    "content": "H",
+                                    "type": "inline_equation"
+                                },
+                                {
+                                    "bbox": [
+                                        85.00498962402344,
+                                        343.8357238769531,
+                                        296.2621154785156,
+                                        353.8797302246094
+                                    ],
+                                    "content": " be random variables representing passenger waiting times ",
+                                    "type": "text",
+                                    "score": 1.0
+                                }
+                            ]
+                        },
+                        {
+                            "bbox": [
+                                52,
+                                354.7347106933594,
+                                294,
+                                364.7787170410156
+                            ],
+                            "spans": [
+                                {
+                                    "bbox": [
+                                        53.99998474121094,
+                                        354.7347106933594,
+                                        296.1269226074219,
+                                        364.7787170410156
+                                    ],
+                                    "content": "and service headways, respectively. Under the random incidence ",
+                                    "type": "text",
+                                    "score": 1.0
+                                }
+                            ]
+                        },
+                        {
+                            "bbox": [
+                                52,
+                                365.6336975097656,
+                                294,
+                                375.6777038574219
+                            ],
+                            "spans": [
+                                {
+                                    "bbox": [
+                                        53.99998474121094,
+                                        365.6336975097656,
+                                        296.36083984375,
+                                        375.6777038574219
+                                    ],
+                                    "content": "assumption and the assumption that vehicle capacity is not a binding ",
+                                    "type": "text",
+                                    "score": 1.0
+                                }
+                            ]
+                        },
+                        {
+                            "bbox": [
+                                52,
+                                376.5326843261719,
+                                260.27996826171875,
+                                386.5766906738281
+                            ],
+                            "spans": [
+                                {
+                                    "bbox": [
+                                        53.99998474121094,
+                                        376.5326843261719,
+                                        260.27996826171875,
+                                        386.5766906738281
+                                    ],
+                                    "content": "constraint, a classic result of transportation science is that",
+                                    "type": "text",
+                                    "score": 1.0
+                                }
+                            ]
+                        }
+                    ]
+                },
+                {
+                    "type": "interline_equation",
+                    "bbox": [
+                        52,
+                        397,
+                        195,
+                        426
+                    ],
+                    "lines": [
+                        {
+                            "bbox": [
+                                52,
+                                397,
+                                195,
+                                426
+                            ],
+                            "spans": [
+                                {
+                                    "bbox": [
+                                        52,
+                                        397,
+                                        195,
+                                        426
+                                    ],
+                                    "score": 0.94,
+                                    "content": "E\\!\\left(W\\right)\\!=\\!\\frac{E\\!\\left[H^{2}\\right]}{2E\\!\\left[H\\right]}\\!=\\!\\frac{E\\!\\left[H\\right]}{2}\\!\\!\\left(1\\!+\\!\\operatorname{CV}\\!\\left(H\\right)^{2}\\right)",
+                                    "type": "interline_equation"
+                                }
+                            ]
+                        }
+                    ]
+                },
+                {
+                    "type": "text",
+                    "bbox": [
+                        52,
+                        437.4519958496094,
+                        294,
+                        469.2939758300781
+                    ],
+                    "lines": [
+                        {
+                            "bbox": [
+                                52,
+                                437.4519958496094,
+                                294,
+                                447.4960021972656
+                            ],
+                            "spans": [
+                                {
+                                    "bbox": [
+                                        54.00300598144531,
+                                        437.4519958496094,
+                                        75.95401000976562,
+                                        447.4960021972656
+                                    ],
+                                    "content": "where",
+                                    "type": "text",
+                                    "score": 1.0
+                                },
+                                {
+                                    "bbox": [
+                                        76,
+                                        438,
+                                        94,
+                                        447
+                                    ],
+                                    "score": 0.88,
+                                    "content": "E[X]",
+                                    "type": "inline_equation"
+                                },
+                                {
+                                    "bbox": [
+                                        94.57499694824219,
+                                        437.4519958496094,
+                                        296.2559814453125,
+                                        447.4960021972656
+                                    ],
+                                    "content": " is the probabilistic expectation of some random variable ",
+                                    "type": "text",
+                                    "score": 1.0
+                                }
+                            ]
+                        },
+                        {
+                            "bbox": [
+                                52,
+                                448,
+                                294,
+                                458.3949890136719
+                            ],
+                            "spans": [
+                                {
+                                    "bbox": [
+                                        52,
+                                        448,
+                                        60,
+                                        457
+                                    ],
+                                    "score": 0.77,
+                                    "content": "X",
+                                    "type": "inline_equation"
+                                },
+                                {
+                                    "bbox": [
+                                        59.50199890136719,
+                                        448.3509826660156,
+                                        74.52300262451172,
+                                        458.3949890136719
+                                    ],
+                                    "content": " and",
+                                    "type": "text",
+                                    "score": 1.0
+                                },
+                                {
+                                    "bbox": [
+                                        75,
+                                        448,
+                                        101,
+                                        458
+                                    ],
+                                    "score": 0.77,
+                                    "content": "\\operatorname{CV}(H)",
+                                    "type": "inline_equation"
+                                },
+                                {
+                                    "bbox": [
+                                        101.54100799560547,
+                                        448.3509826660156,
+                                        215.6699676513672,
+                                        458.3949890136719
+                                    ],
+                                    "content": " is the coefficient of variation of",
+                                    "type": "text",
+                                    "score": 1.0
+                                },
+                                {
+                                    "bbox": [
+                                        216,
+                                        448,
+                                        224,
+                                        457
+                                    ],
+                                    "score": 0.78,
+                                    "content": "H",
+                                    "type": "inline_equation"
+                                },
+                                {
+                                    "bbox": [
+                                        224.19296264648438,
+                                        448.4859924316406,
+                                        226.44296264648438,
+                                        458.385986328125
+                                    ],
+                                    "content": ",",
+                                    "type": "text",
+                                    "score": 1.0
+                                },
+                                {
+                                    "bbox": [
+                                        226.44296264648438,
+                                        448.3509826660156,
+                                        296.2559814453125,
+                                        458.3949890136719
+                                    ],
+                                    "content": " a unitless measure ",
+                                    "type": "text",
+                                    "score": 1.0
+                                }
+                            ]
+                        },
+                        {
+                            "bbox": [
+                                52,
+                                459,
+                                170,
+                                469.2939758300781
+                            ],
+                            "spans": [
+                                {
+                                    "bbox": [
+                                        54.00299835205078,
+                                        459.2499694824219,
+                                        123.39299774169922,
+                                        469.2939758300781
+                                    ],
+                                    "content": "of the variability of",
+                                    "type": "text",
+                                    "score": 1.0
+                                },
+                                {
+                                    "bbox": [
+                                        124,
+                                        459,
+                                        132,
+                                        468
+                                    ],
+                                    "score": 0.81,
+                                    "content": "H",
+                                    "type": "inline_equation"
+                                },
+                                {
+                                    "bbox": [
+                                        132.0419921875,
+                                        459.2499694824219,
+                                        170.30099487304688,
+                                        469.2939758300781
+                                    ],
+                                    "content": " defined as",
+                                    "type": "text",
+                                    "score": 1.0
+                                }
+                            ]
+                        }
+                    ]
+                },
+                {
+                    "type": "interline_equation",
+                    "bbox": [
+                        52,
+                        479,
+                        114,
+                        504
+                    ],
+                    "lines": [
+                        {
+                            "bbox": [
+                                52,
+                                479,
+                                114,
+                                504
+                            ],
+                            "spans": [
+                                {
+                                    "bbox": [
+                                        52,
+                                        479,
+                                        114,
+                                        504
+                                    ],
+                                    "score": 0.91,
+                                    "content": "\\mathbf{CV}\\big(H\\big)\\!=\\!\\frac{\\boldsymbol{\\upsigma}_{H}}{E\\big[H\\big]}",
+                                    "type": "interline_equation"
+                                }
+                            ]
+                        }
+                    ]
+                },
+                {
+                    "type": "text",
+                    "bbox": [
+                        52,
+                        515,
+                        294,
+                        601.5659790039062
+                    ],
+                    "lines": [
+                        {
+                            "bbox": [
+                                52,
+                                515,
+                                294,
+                                525.2139892578125
+                            ],
+                            "spans": [
+                                {
+                                    "bbox": [
+                                        54.00199890136719,
+                                        515.1700439453125,
+                                        78.01400756835938,
+                                        525.2139892578125
+                                    ],
+                                    "content": "where ",
+                                    "type": "text",
+                                    "score": 1.0
+                                },
+                                {
+                                    "bbox": [
+                                        77,
+                                        516,
+                                        88,
+                                        525
+                                    ],
+                                    "score": 0.87,
+                                    "content": "\\upsigma_{H}",
+                                    "type": "inline_equation"
+                                },
+                                {
+                                    "bbox": [
+                                        87.38349914550781,
+                                        515.166015625,
+                                        186.6715545654297,
+                                        525.2099609375
+                                    ],
+                                    "content": " is the standard deviation of",
+                                    "type": "text",
+                                    "score": 1.0
+                                },
+                                {
+                                    "bbox": [
+                                        187,
+                                        515,
+                                        208,
+                                        525
+                                    ],
+                                    "score": 0.81,
+                                    "content": "H\\left(4\\right)",
+                                    "type": "inline_equation"
+                                },
+                                {
+                                    "bbox": [
+                                        208.18150329589844,
+                                        515.166015625,
+                                        296.2464599609375,
+                                        525.2099609375
+                                    ],
+                                    "content": ". The second expression ",
+                                    "type": "text",
+                                    "score": 1.0
+                                }
+                            ]
+                        },
+                        {
+                            "bbox": [
+                                52,
+                                526.0740356445312,
+                                294,
+                                536.1179809570312
+                            ],
+                            "spans": [
+                                {
+                                    "bbox": [
+                                        54.00251770019531,
+                                        526.0740356445312,
+                                        296.2464904785156,
+                                        536.1179809570312
+                                    ],
+                                    "content": "in Equation 1 is particularly useful because it expresses the mean ",
+                                    "type": "text",
+                                    "score": 1.0
+                                }
+                            ]
+                        },
+                        {
+                            "bbox": [
+                                52,
+                                536.9819946289062,
+                                294,
+                                547.0259399414062
+                            ],
+                            "spans": [
+                                {
+                                    "bbox": [
+                                        54.00251770019531,
+                                        536.9819946289062,
+                                        296.2284851074219,
+                                        547.0259399414062
+                                    ],
+                                    "content": "passenger waiting time as the sum of two components: the waiting ",
+                                    "type": "text",
+                                    "score": 1.0
+                                }
+                            ]
+                        },
+                        {
+                            "bbox": [
+                                52,
+                                547.8900146484375,
+                                294,
+                                557.9339599609375
+                            ],
+                            "spans": [
+                                {
+                                    "bbox": [
+                                        54.00251770019531,
+                                        547.8900146484375,
+                                        293.987548828125,
+                                        557.9339599609375
+                                    ],
+                                    "content": "time caused by the mean headway (i.e., the reciprocal of service fre-",
+                                    "type": "text",
+                                    "score": 1.0
+                                }
+                            ]
+                        },
+                        {
+                            "bbox": [
+                                52,
+                                558.7980346679688,
+                                294,
+                                568.8419799804688
+                            ],
+                            "spans": [
+                                {
+                                    "bbox": [
+                                        54.00251770019531,
+                                        558.7980346679688,
+                                        294.0145263671875,
+                                        568.8419799804688
+                                    ],
+                                    "content": "quency) and the waiting time caused by the variability of the head-",
+                                    "type": "text",
+                                    "score": 1.0
+                                }
+                            ]
+                        },
+                        {
+                            "bbox": [
+                                52,
+                                569.7059936523438,
+                                294,
+                                579.7499389648438
+                            ],
+                            "spans": [
+                                {
+                                    "bbox": [
+                                        54.00251770019531,
+                                        569.7059936523438,
+                                        296.2915344238281,
+                                        579.7499389648438
+                                    ],
+                                    "content": "ways (which is one measure of service reliability). When the service ",
+                                    "type": "text",
+                                    "score": 1.0
+                                }
+                            ]
+                        },
+                        {
+                            "bbox": [
+                                52,
+                                580.614013671875,
+                                294,
+                                590.657958984375
+                            ],
+                            "spans": [
+                                {
+                                    "bbox": [
+                                        54.00251770019531,
+                                        580.614013671875,
+                                        251.41763305664062,
+                                        590.657958984375
+                                    ],
+                                    "content": "is perfectly reliable with constant headways, the mean ­",
+                                    "type": "text",
+                                    "score": 1.0
+                                },
+                                {
+                                    "bbox": [
+                                        249.18551635742188,
+                                        580.614013671875,
+                                        296.2464599609375,
+                                        590.657958984375
+                                    ],
+                                    "content": "waiting time ",
+                                    "type": "text",
+                                    "score": 1.0
+                                }
+                            ]
+                        },
+                        {
+                            "bbox": [
+                                52,
+                                591.5220336914062,
+                                170,
+                                601.5659790039062
+                            ],
+                            "spans": [
+                                {
+                                    "bbox": [
+                                        54.00251770019531,
+                                        591.5220336914062,
+                                        168.9235382080078,
+                                        601.5659790039062
+                                    ],
+                                    "content": "will be simply half the headway.",
+                                    "type": "text",
+                                    "score": 1.0
+                                }
+                            ]
+                        }
+                    ]
+                },
+                {
+                    "type": "title",
+                    "bbox": [
+                        53,
+                        623,
+                        252,
+                        634
+                    ],
+                    "lines": [
+                        {
+                            "bbox": [
+                                54.00251770019531,
+                                623.6699829101562,
+                                252.425537109375,
+                                634.7039794921875
+                            ],
+                            "spans": [
+                                {
+                                    "bbox": [
+                                        54.00251770019531,
+                                        623.6699829101562,
+                                        252.425537109375,
+                                        634.7039794921875
+                                    ],
+                                    "content": "More Behaviorally Realistic Incidence Models",
+                                    "type": "text",
+                                    "score": 1.0
+                                }
+                            ]
+                        }
+                    ]
+                },
+                {
+                    "type": "text",
+                    "bbox": [
+                        52,
+                        644.4240112304688,
+                        294,
+                        730.760986328125
+                    ],
+                    "lines": [
+                        {
+                            "bbox": [
+                                52,
+                                644.4240112304688,
+                                294,
+                                654.4679565429688
+                            ],
+                            "spans": [
+                                {
+                                    "bbox": [
+                                        54.00251770019531,
+                                        644.4240112304688,
+                                        296.0845947265625,
+                                        654.4679565429688
+                                    ],
+                                    "content": "Jolliffe and Hutchinson studied bus passenger incidence in South ",
+                                    "type": "text",
+                                    "score": 1.0
+                                }
+                            ]
+                        },
+                        {
+                            "bbox": [
+                                52,
+                                655,
+                                294,
+                                665.3670043945312
+                            ],
+                            "spans": [
+                                {
+                                    "bbox": [
+                                        54.00251770019531,
+                                        655.3230590820312,
+                                        119.24354553222656,
+                                        665.3670043945312
+                                    ],
+                                    "content": "London suburbs (",
+                                    "type": "text",
+                                    "score": 1.0
+                                },
+                                {
+                                    "bbox": [
+                                        119.279541015625,
+                                        655.4580078125,
+                                        123.779541015625,
+                                        665.3580322265625
+                                    ],
+                                    "content": "5",
+                                    "type": "text",
+                                    "score": 1.0
+                                },
+                                {
+                                    "bbox": [
+                                        123.81552124023438,
+                                        655.3230590820312,
+                                        250.9404296875,
+                                        665.3670043945312
+                                    ],
+                                    "content": "). They observed 10 bus stops for ",
+                                    "type": "text",
+                                    "score": 1.0
+                                },
+                                {
+                                    "bbox": [
+                                        250,
+                                        655,
+                                        264,
+                                        664
+                                    ],
+                                    "score": 0.3,
+                                    "content": "^{1\\mathrm{~h~}}",
+                                    "type": "inline_equation"
+                                },
+                                {
+                                    "bbox": [
+                                        263.5404357910156,
+                                        655.3230590820312,
+                                        296.23748779296875,
+                                        665.3670043945312
+                                    ],
+                                    "content": " per day ",
+                                    "type": "text",
+                                    "score": 1.0
+                                }
+                            ]
+                        },
+                        {
+                            "bbox": [
+                                52,
+                                666.2220458984375,
+                                294,
+                                676.2659912109375
+                            ],
+                            "spans": [
+                                {
+                                    "bbox": [
+                                        54.00251770019531,
+                                        666.2220458984375,
+                                        296.2645568847656,
+                                        676.2659912109375
+                                    ],
+                                    "content": "over 8 days, recording the times of passenger incidence and actual ",
+                                    "type": "text",
+                                    "score": 1.0
+                                }
+                            ]
+                        },
+                        {
+                            "bbox": [
+                                52,
+                                677.1210327148438,
+                                294,
+                                687.1649780273438
+                            ],
+                            "spans": [
+                                {
+                                    "bbox": [
+                                        54.00251770019531,
+                                        677.1210327148438,
+                                        296.2375793457031,
+                                        687.1649780273438
+                                    ],
+                                    "content": "and scheduled bus departures. They limited their stop selection to ",
+                                    "type": "text",
+                                    "score": 1.0
+                                }
+                            ]
+                        },
+                        {
+                            "bbox": [
+                                52,
+                                688.0200805664062,
+                                294,
+                                698.0640258789062
+                            ],
+                            "spans": [
+                                {
+                                    "bbox": [
+                                        54.00251770019531,
+                                        688.0200805664062,
+                                        293.7715148925781,
+                                        698.0640258789062
+                                    ],
+                                    "content": "those served by only a single bus route with a single service pat-",
+                                    "type": "text",
+                                    "score": 1.0
+                                }
+                            ]
+                        },
+                        {
+                            "bbox": [
+                                52,
+                                698.9190673828125,
+                                294,
+                                708.9630126953125
+                            ],
+                            "spans": [
+                                {
+                                    "bbox": [
+                                        54.00251770019531,
+                                        698.9190673828125,
+                                        296.2465515136719,
+                                        708.9630126953125
+                                    ],
+                                    "content": "tern so as to avoid ambiguity about which service a passenger was ",
+                                    "type": "text",
+                                    "score": 1.0
+                                }
+                            ]
+                        },
+                        {
+                            "bbox": [
+                                52,
+                                709.8180541992188,
+                                294,
+                                719.8619995117188
+                            ],
+                            "spans": [
+                                {
+                                    "bbox": [
+                                        54.00251770019531,
+                                        709.8180541992188,
+                                        296.2825012207031,
+                                        719.8619995117188
+                                    ],
+                                    "content": "waiting for. The authors found that the actual average passenger ",
+                                    "type": "text",
+                                    "score": 1.0
+                                }
+                            ]
+                        },
+                        {
+                            "bbox": [
+                                52,
+                                720,
+                                294,
+                                730.760986328125
+                            ],
+                            "spans": [
+                                {
+                                    "bbox": [
+                                        54.00251770019531,
+                                        720.717041015625,
+                                        115.4095230102539,
+                                        730.760986328125
+                                    ],
+                                    "content": "waiting time was",
+                                    "type": "text",
+                                    "score": 1.0
+                                },
+                                {
+                                    "bbox": [
+                                        116,
+                                        720,
+                                        134,
+                                        730
+                                    ],
+                                    "score": 0.84,
+                                    "content": "30\\%",
+                                    "type": "inline_equation"
+                                },
+                                {
+                                    "bbox": [
+                                        134.1115264892578,
+                                        720.717041015625,
+                                        296.26458740234375,
+                                        730.760986328125
+                                    ],
+                                    "content": " less than predicted by the random incidence ",
+                                    "type": "text",
+                                    "score": 1.0
+                                }
+                            ]
+                        },
+                        {
+                            "bbox": [
+                                317,
+                                61.935028076171875,
+                                558,
+                                71.9790267944336
+                            ],
+                            "spans": [
+                                {
+                                    "bbox": [
+                                        317.99951171875,
+                                        61.935028076171875,
+                                        560.3607788085938,
+                                        71.9790267944336
+                                    ],
+                                    "content": "model. They also found that the empirical distributions of passenger ",
+                                    "type": "text",
+                                    "score": 1.0
+                                }
+                            ]
+                        },
+                        {
+                            "bbox": [
+                                317,
+                                72.83401489257812,
+                                558,
+                                82.87801361083984
+                            ],
+                            "spans": [
+                                {
+                                    "bbox": [
+                                        317.99951171875,
+                                        72.83401489257812,
+                                        557.9577026367188,
+                                        82.87801361083984
+                                    ],
+                                    "content": "incidence times (by time of day) had peaks just before the respec-",
+                                    "type": "text",
+                                    "score": 1.0
+                                }
+                            ]
+                        },
+                        {
+                            "bbox": [
+                                317,
+                                83.73300170898438,
+                                558,
+                                93.7770004272461
+                            ],
+                            "spans": [
+                                {
+                                    "bbox": [
+                                        317.99951171875,
+                                        83.73300170898438,
+                                        560.2256469726562,
+                                        93.7770004272461
+                                    ],
+                                    "content": "tive average bus departure times. They hypothesized the existence ",
+                                    "type": "text",
+                                    "score": 1.0
+                                }
+                            ]
+                        },
+                        {
+                            "bbox": [
+                                317,
+                                94.63198852539062,
+                                558,
+                                105
+                            ],
+                            "spans": [
+                                {
+                                    "bbox": [
+                                        317.99951171875,
+                                        94.63198852539062,
+                                        483.3477783203125,
+                                        104.67598724365234
+                                    ],
+                                    "content": "of three classes of passengers: with proportion",
+                                    "type": "text",
+                                    "score": 1.0
+                                },
+                                {
+                                    "bbox": [
+                                        484,
+                                        96,
+                                        489,
+                                        105
+                                    ],
+                                    "score": 0.76,
+                                    "content": "q",
+                                    "type": "inline_equation"
+                                },
+                                {
+                                    "bbox": [
+                                        489.8277893066406,
+                                        94.7669906616211,
+                                        492.0777893066406,
+                                        104.6669921875
+                                    ],
+                                    "content": ",",
+                                    "type": "text",
+                                    "score": 1.0
+                                },
+                                {
+                                    "bbox": [
+                                        492.0777893066406,
+                                        94.63198852539062,
+                                        560.2706909179688,
+                                        104.67598724365234
+                                    ],
+                                    "content": " passengers whose ",
+                                    "type": "text",
+                                    "score": 1.0
+                                }
+                            ]
+                        },
+                        {
+                            "bbox": [
+                                317,
+                                105.53097534179688,
+                                558,
+                                115.5749740600586
+                            ],
+                            "spans": [
+                                {
+                                    "bbox": [
+                                        317.99951171875,
+                                        105.53097534179688,
+                                        560.2797241210938,
+                                        115.5749740600586
+                                    ],
+                                    "content": "time of incidence is causally coincident with that of a bus departure ",
+                                    "type": "text",
+                                    "score": 1.0
+                                }
+                            ]
+                        },
+                        {
+                            "bbox": [
+                                317,
+                                116.42996215820312,
+                                558,
+                                126.47396087646484
+                            ],
+                            "spans": [
+                                {
+                                    "bbox": [
+                                        317.99951171875,
+                                        116.42996215820312,
+                                        560.3876953125,
+                                        126.47396087646484
+                                    ],
+                                    "content": "(e.g., because they saw the approaching bus from their home or a ",
+                                    "type": "text",
+                                    "score": 1.0
+                                }
+                            ]
+                        },
+                        {
+                            "bbox": [
+                                317,
+                                127,
+                                558,
+                                138
+                            ],
+                            "spans": [
+                                {
+                                    "bbox": [
+                                        317.99951171875,
+                                        127.32894897460938,
+                                        429.734619140625,
+                                        137.37295532226562
+                                    ],
+                                    "content": "shop window); with proportion",
+                                    "type": "text",
+                                    "score": 1.0
+                                },
+                                {
+                                    "bbox": [
+                                        430,
+                                        127,
+                                        460,
+                                        138
+                                    ],
+                                    "score": 0.91,
+                                    "content": "p(1-q)",
+                                    "type": "inline_equation"
+                                },
+                                {
+                                    "bbox": [
+                                        460.42449951171875,
+                                        127.32894897460938,
+                                        560.2256469726562,
+                                        137.37295532226562
+                                    ],
+                                    "content": ", passengers who time their ",
+                                    "type": "text",
+                                    "score": 1.0
+                                }
+                            ]
+                        },
+                        {
+                            "bbox": [
+                                317,
+                                138.22793579101562,
+                                558,
+                                148.27194213867188
+                            ],
+                            "spans": [
+                                {
+                                    "bbox": [
+                                        317.990478515625,
+                                        138.22793579101562,
+                                        560.135498046875,
+                                        148.27194213867188
+                                    ],
+                                    "content": "arrivals to minimize expected waiting time; and with proportion ",
+                                    "type": "text",
+                                    "score": 1.0
+                                }
+                            ]
+                        },
+                        {
+                            "bbox": [
+                                317,
+                                149,
+                                558,
+                                159.17092895507812
+                            ],
+                            "spans": [
+                                {
+                                    "bbox": [
+                                        317,
+                                        149,
+                                        367,
+                                        159
+                                    ],
+                                    "score": 0.91,
+                                    "content": "(1-p)(1-q)",
+                                    "type": "inline_equation"
+                                },
+                                {
+                                    "bbox": [
+                                        367.43646240234375,
+                                        149.12692260742188,
+                                        560.2435913085938,
+                                        159.17092895507812
+                                    ],
+                                    "content": ", passengers who are randomly incident. The authors ",
+                                    "type": "text",
+                                    "score": 1.0
+                                }
+                            ]
+                        },
+                        {
+                            "bbox": [
+                                317,
+                                160.02590942382812,
+                                558,
+                                170.06991577148438
+                            ],
+                            "spans": [
+                                {
+                                    "bbox": [
+                                        317.9904479980469,
+                                        160.02590942382812,
+                                        355.0434875488281,
+                                        170.06991577148438
+                                    ],
+                                    "content": "found that",
+                                    "type": "text",
+                                    "score": 1.0
+                                },
+                                {
+                                    "bbox": [
+                                        356,
+                                        161,
+                                        362,
+                                        170
+                                    ],
+                                    "score": 0.81,
+                                    "content": "p",
+                                    "type": "inline_equation"
+                                },
+                                {
+                                    "bbox": [
+                                        362.0994873046875,
+                                        160.02590942382812,
+                                        560.2166748046875,
+                                        170.06991577148438
+                                    ],
+                                    "content": " was positively correlated with the potential reduction ",
+                                    "type": "text",
+                                    "score": 1.0
+                                }
+                            ]
+                        },
+                        {
+                            "bbox": [
+                                317,
+                                170.92489624023438,
+                                558,
+                                180.96890258789062
+                            ],
+                            "spans": [
+                                {
+                                    "bbox": [
+                                        317.9904479980469,
+                                        170.92489624023438,
+                                        560.1266479492188,
+                                        180.96890258789062
+                                    ],
+                                    "content": "in waiting time (compared with arriving randomly) that resulted ",
+                                    "type": "text",
+                                    "score": 1.0
+                                }
+                            ]
+                        },
+                        {
+                            "bbox": [
+                                317,
+                                181.82388305664062,
+                                558,
+                                191.86788940429688
+                            ],
+                            "spans": [
+                                {
+                                    "bbox": [
+                                        317.9904479980469,
+                                        181.82388305664062,
+                                        560.3065185546875,
+                                        191.86788940429688
+                                    ],
+                                    "content": "from knowledge of the timetable and of service reliability. They also ",
+                                    "type": "text",
+                                    "score": 1.0
+                                }
+                            ]
+                        },
+                        {
+                            "bbox": [
+                                317,
+                                192.72286987304688,
+                                558,
+                                203
+                            ],
+                            "spans": [
+                                {
+                                    "bbox": [
+                                        317.9904479980469,
+                                        192.72286987304688,
+                                        338.9874572753906,
+                                        202.76687622070312
+                                    ],
+                                    "content": "found",
+                                    "type": "text",
+                                    "score": 1.0
+                                },
+                                {
+                                    "bbox": [
+                                        339,
+                                        194,
+                                        346,
+                                        203
+                                    ],
+                                    "score": 0.8,
+                                    "content": "p",
+                                    "type": "inline_equation"
+                                },
+                                {
+                                    "bbox": [
+                                        345.98944091796875,
+                                        192.72286987304688,
+                                        560.2347412109375,
+                                        202.76687622070312
+                                    ],
+                                    "content": " to be higher in the peak commuting periods rather than in ",
+                                    "type": "text",
+                                    "score": 1.0
+                                }
+                            ]
+                        },
+                        {
+                            "bbox": [
+                                317,
+                                203.62185668945312,
+                                558,
+                                213.66586303710938
+                            ],
+                            "spans": [
+                                {
+                                    "bbox": [
+                                        317.9904479980469,
+                                        203.62185668945312,
+                                        560.2255859375,
+                                        213.66586303710938
+                                    ],
+                                    "content": "the off-peak periods, indicating more awareness of the timetable or ",
+                                    "type": "text",
+                                    "score": 1.0
+                                }
+                            ]
+                        },
+                        {
+                            "bbox": [
+                                317,
+                                214.52084350585938,
+                                475.814697265625,
+                                224.56484985351562
+                            ],
+                            "spans": [
+                                {
+                                    "bbox": [
+                                        317.9904479980469,
+                                        214.52084350585938,
+                                        475.814697265625,
+                                        224.56484985351562
+                                    ],
+                                    "content": "historical reliability, or both, by commuters.",
+                                    "type": "text",
+                                    "score": 1.0
+                                }
+                            ]
+                        }
+                    ]
+                },
+                {
+                    "type": "text",
+                    "bbox": [
+                        317,
+                        61.935028076171875,
+                        558,
+                        224.56484985351562
+                    ],
+                    "lines": [],
+                    "lines_deleted": true
+                },
+                {
+                    "type": "text",
+                    "bbox": [
+                        317,
+                        225.51882934570312,
+                        558,
+                        521.5104370117188
+                    ],
+                    "lines": [
+                        {
+                            "bbox": [
+                                326,
+                                225.51882934570312,
+                                558,
+                                235.56283569335938
+                            ],
+                            "spans": [
+                                {
+                                    "bbox": [
+                                        326.9904479980469,
+                                        225.51882934570312,
+                                        560.3154296875,
+                                        235.56283569335938
+                                    ],
+                                    "content": "Bowman and Turnquist built on the concept of aware and unaware ",
+                                    "type": "text",
+                                    "score": 1.0
+                                }
+                            ]
+                        },
+                        {
+                            "bbox": [
+                                317,
+                                236,
+                                558,
+                                246.56082153320312
+                            ],
+                            "spans": [
+                                {
+                                    "bbox": [
+                                        317.9904479980469,
+                                        236.51681518554688,
+                                        408.9263916015625,
+                                        246.56082153320312
+                                    ],
+                                    "content": "passengers of proportions",
+                                    "type": "text",
+                                    "score": 1.0
+                                },
+                                {
+                                    "bbox": [
+                                        409,
+                                        237,
+                                        415,
+                                        246
+                                    ],
+                                    "score": 0.81,
+                                    "content": "p",
+                                    "type": "inline_equation"
+                                },
+                                {
+                                    "bbox": [
+                                        415.12744140625,
+                                        236.51681518554688,
+                                        429.76141357421875,
+                                        246.56082153320312
+                                    ],
+                                    "content": " and",
+                                    "type": "text",
+                                    "score": 1.0
+                                },
+                                {
+                                    "bbox": [
+                                        430,
+                                        236,
+                                        454,
+                                        246
+                                    ],
+                                    "score": 0.9,
+                                    "content": "(1-p)",
+                                    "type": "inline_equation"
+                                },
+                                {
+                                    "bbox": [
+                                        454.61944580078125,
+                                        236.51681518554688,
+                                        560.1714477539062,
+                                        246.56082153320312
+                                    ],
+                                    "content": ", respectively. They proposed ",
+                                    "type": "text",
+                                    "score": 1.0
+                                }
+                            ]
+                        },
+                        {
+                            "bbox": [
+                                317,
+                                247.51480102539062,
+                                558,
+                                258
+                            ],
+                            "spans": [
+                                {
+                                    "bbox": [
+                                        317.99041748046875,
+                                        247.51480102539062,
+                                        434.2976379394531,
+                                        257.5588073730469
+                                    ],
+                                    "content": "a utility-based model to estimate",
+                                    "type": "text",
+                                    "score": 1.0
+                                },
+                                {
+                                    "bbox": [
+                                        435,
+                                        249,
+                                        441,
+                                        258
+                                    ],
+                                    "score": 0.83,
+                                    "content": "p",
+                                    "type": "inline_equation"
+                                },
+                                {
+                                    "bbox": [
+                                        440.7506408691406,
+                                        247.51480102539062,
+                                        560.252685546875,
+                                        257.5588073730469
+                                    ],
+                                    "content": " and the distribution of incidence ",
+                                    "type": "text",
+                                    "score": 1.0
+                                }
+                            ]
+                        },
+                        {
+                            "bbox": [
+                                317,
+                                258.5127868652344,
+                                558,
+                                268.5567932128906
+                            ],
+                            "spans": [
+                                {
+                                    "bbox": [
+                                        317.99041748046875,
+                                        258.5127868652344,
+                                        560.2796020507812,
+                                        268.5567932128906
+                                    ],
+                                    "content": "times, and thus the mean waiting time, of aware passengers over ",
+                                    "type": "text",
+                                    "score": 1.0
+                                }
+                            ]
+                        },
+                        {
+                            "bbox": [
+                                317,
+                                269.5107727050781,
+                                558,
+                                279.5547790527344
+                            ],
+                            "spans": [
+                                {
+                                    "bbox": [
+                                        317.99041748046875,
+                                        269.5107727050781,
+                                        560.1358032226562,
+                                        279.5547790527344
+                                    ],
+                                    "content": "a given headway as a function of the headway and reliability of ",
+                                    "type": "text",
+                                    "score": 1.0
+                                }
+                            ]
+                        },
+                        {
+                            "bbox": [
+                                317,
+                                280.5087585449219,
+                                558,
+                                290.5527648925781
+                            ],
+                            "spans": [
+                                {
+                                    "bbox": [
+                                        317.99041748046875,
+                                        280.5087585449219,
+                                        387.9205322265625,
+                                        290.5527648925781
+                                    ],
+                                    "content": "bus departure times",
+                                    "type": "text",
+                                    "score": 1.0
+                                },
+                                {
+                                    "bbox": [
+                                        389,
+                                        281,
+                                        400,
+                                        290
+                                    ],
+                                    "score": 0.41,
+                                    "content": "(l)",
+                                    "type": "inline_equation"
+                                },
+                                {
+                                    "bbox": [
+                                        400.38555908203125,
+                                        280.5087585449219,
+                                        560.2526245117188,
+                                        290.5527648925781
+                                    ],
+                                    "content": ". They observed seven bus stops in Chicago, ",
+                                    "type": "text",
+                                    "score": 1.0
+                                }
+                            ]
+                        },
+                        {
+                            "bbox": [
+                                317,
+                                291.5067443847656,
+                                558,
+                                301.5507507324219
+                            ],
+                            "spans": [
+                                {
+                                    "bbox": [
+                                        317.99041748046875,
+                                        291.5067443847656,
+                                        560.2166748046875,
+                                        301.5507507324219
+                                    ],
+                                    "content": "Illinois, each served by a single (different) bus route, between 6:00 ",
+                                    "type": "text",
+                                    "score": 1.0
+                                }
+                            ]
+                        },
+                        {
+                            "bbox": [
+                                317,
+                                302,
+                                558,
+                                312.5487365722656
+                            ],
+                            "spans": [
+                                {
+                                    "bbox": [
+                                        317.99041748046875,
+                                        302.5047302246094,
+                                        330.9864196777344,
+                                        312.5487365722656
+                                    ],
+                                    "content": "and",
+                                    "type": "text",
+                                    "score": 1.0
+                                },
+                                {
+                                    "bbox": [
+                                        332,
+                                        302,
+                                        365,
+                                        312
+                                    ],
+                                    "score": 0.56,
+                                    "content": "8{\\cdot}00\\;\\mathrm{a.m}",
+                                    "type": "inline_equation"
+                                },
+                                {
+                                    "bbox": [
+                                        365.22247314453125,
+                                        302.5047302246094,
+                                        560.198486328125,
+                                        312.5487365722656
+                                    ],
+                                    "content": ". for 5 to 10 days each. The bus routes had headways ",
+                                    "type": "text",
+                                    "score": 1.0
+                                }
+                            ]
+                        },
+                        {
+                            "bbox": [
+                                317,
+                                313,
+                                558,
+                                323.5467224121094
+                            ],
+                            "spans": [
+                                {
+                                    "bbox": [
+                                        317.99041748046875,
+                                        313.5027160644531,
+                                        344.7024230957031,
+                                        323.5467224121094
+                                    ],
+                                    "content": "of 5 to ",
+                                    "type": "text",
+                                    "score": 1.0
+                                },
+                                {
+                                    "bbox": [
+                                        344,
+                                        313,
+                                        371,
+                                        323
+                                    ],
+                                    "score": 0.43,
+                                    "content": "20~\\mathrm{min}",
+                                    "type": "inline_equation"
+                                },
+                                {
+                                    "bbox": [
+                                        370.91943359375,
+                                        313.5027160644531,
+                                        560.3604736328125,
+                                        323.5467224121094
+                                    ],
+                                    "content": " and a range of reliabilities. The authors found that ",
+                                    "type": "text",
+                                    "score": 1.0
+                                }
+                            ]
+                        },
+                        {
+                            "bbox": [
+                                317,
+                                324.5007019042969,
+                                558,
+                                334.5447082519531
+                            ],
+                            "spans": [
+                                {
+                                    "bbox": [
+                                        317.99041748046875,
+                                        324.5007019042969,
+                                        560.11767578125,
+                                        334.5447082519531
+                                    ],
+                                    "content": "actual average waiting time was substantially less than predicted ",
+                                    "type": "text",
+                                    "score": 1.0
+                                }
+                            ]
+                        },
+                        {
+                            "bbox": [
+                                317,
+                                335.4986877441406,
+                                558,
+                                345.5426940917969
+                            ],
+                            "spans": [
+                                {
+                                    "bbox": [
+                                        317.99041748046875,
+                                        335.4986877441406,
+                                        518.0780029296875,
+                                        345.5426940917969
+                                    ],
+                                    "content": "by the random incidence model. They estimated that",
+                                    "type": "text",
+                                    "score": 1.0
+                                },
+                                {
+                                    "bbox": [
+                                        519,
+                                        336,
+                                        525,
+                                        345
+                                    ],
+                                    "score": 0.79,
+                                    "content": "p",
+                                    "type": "inline_equation"
+                                },
+                                {
+                                    "bbox": [
+                                        525.8904418945312,
+                                        335.4986877441406,
+                                        560.2254028320312,
+                                        345.5426940917969
+                                    ],
+                                    "content": " was not ",
+                                    "type": "text",
+                                    "score": 1.0
+                                }
+                            ]
+                        },
+                        {
+                            "bbox": [
+                                317,
+                                346.4966735839844,
+                                558,
+                                356.5406799316406
+                            ],
+                            "spans": [
+                                {
+                                    "bbox": [
+                                        317.99041748046875,
+                                        346.4966735839844,
+                                        560.2166137695312,
+                                        356.5406799316406
+                                    ],
+                                    "content": "statistically significantly different from 1.0, which they explain by ",
+                                    "type": "text",
+                                    "score": 1.0
+                                }
+                            ]
+                        },
+                        {
+                            "bbox": [
+                                317,
+                                357.4946594238281,
+                                558,
+                                367.5386657714844
+                            ],
+                            "spans": [
+                                {
+                                    "bbox": [
+                                        317.99041748046875,
+                                        357.4946594238281,
+                                        560.0095825195312,
+                                        367.5386657714844
+                                    ],
+                                    "content": "the fact that all observations were taken during peak commuting ",
+                                    "type": "text",
+                                    "score": 1.0
+                                }
+                            ]
+                        },
+                        {
+                            "bbox": [
+                                317,
+                                368.4926452636719,
+                                558,
+                                378.5366516113281
+                            ],
+                            "spans": [
+                                {
+                                    "bbox": [
+                                        317.99041748046875,
+                                        368.4926452636719,
+                                        560.1806640625,
+                                        378.5366516113281
+                                    ],
+                                    "content": "times. Their model predicts that the longer the headway and the ",
+                                    "type": "text",
+                                    "score": 1.0
+                                }
+                            ]
+                        },
+                        {
+                            "bbox": [
+                                317,
+                                379.4906311035156,
+                                558,
+                                389.5346374511719
+                            ],
+                            "spans": [
+                                {
+                                    "bbox": [
+                                        317.99041748046875,
+                                        379.4906311035156,
+                                        560.0728149414062,
+                                        389.5346374511719
+                                    ],
+                                    "content": "more reliable the departures, the more peaked the distribution of ",
+                                    "type": "text",
+                                    "score": 1.0
+                                }
+                            ]
+                        },
+                        {
+                            "bbox": [
+                                317,
+                                390.4886169433594,
+                                558,
+                                400.5326232910156
+                            ],
+                            "spans": [
+                                {
+                                    "bbox": [
+                                        317.99041748046875,
+                                        390.4886169433594,
+                                        560.1895751953125,
+                                        400.5326232910156
+                                    ],
+                                    "content": "incidence times will be and the closer that peak will be to the next ",
+                                    "type": "text",
+                                    "score": 1.0
+                                }
+                            ]
+                        },
+                        {
+                            "bbox": [
+                                317,
+                                401.4866027832031,
+                                558,
+                                411.5306091308594
+                            ],
+                            "spans": [
+                                {
+                                    "bbox": [
+                                        317.99041748046875,
+                                        401.4866027832031,
+                                        560.000732421875,
+                                        411.5306091308594
+                                    ],
+                                    "content": "scheduled departure time. This prediction demonstrates what they ",
+                                    "type": "text",
+                                    "score": 1.0
+                                }
+                            ]
+                        },
+                        {
+                            "bbox": [
+                                317,
+                                412.4845886230469,
+                                558,
+                                422.5285949707031
+                            ],
+                            "spans": [
+                                {
+                                    "bbox": [
+                                        317.99041748046875,
+                                        412.4845886230469,
+                                        560.2703857421875,
+                                        422.5285949707031
+                                    ],
+                                    "content": "refer to as a safety margin that passengers add to reduce the chance ",
+                                    "type": "text",
+                                    "score": 1.0
+                                }
+                            ]
+                        },
+                        {
+                            "bbox": [
+                                317,
+                                423.4825744628906,
+                                558,
+                                433.5265808105469
+                            ],
+                            "spans": [
+                                {
+                                    "bbox": [
+                                        317.99041748046875,
+                                        423.4825744628906,
+                                        560.0728149414062,
+                                        433.5265808105469
+                                    ],
+                                    "content": "of missing their bus when the service is known to be somewhat ",
+                                    "type": "text",
+                                    "score": 1.0
+                                }
+                            ]
+                        },
+                        {
+                            "bbox": [
+                                317,
+                                434.4805603027344,
+                                558,
+                                444.5245666503906
+                            ],
+                            "spans": [
+                                {
+                                    "bbox": [
+                                        317.99041748046875,
+                                        434.4805603027344,
+                                        560.252685546875,
+                                        444.5245666503906
+                                    ],
+                                    "content": "unreliable. Such a safety margin can also result from unreliability in ",
+                                    "type": "text",
+                                    "score": 1.0
+                                }
+                            ]
+                        },
+                        {
+                            "bbox": [
+                                317,
+                                445.4785461425781,
+                                558,
+                                455.5225524902344
+                            ],
+                            "spans": [
+                                {
+                                    "bbox": [
+                                        317.99041748046875,
+                                        445.4785461425781,
+                                        560.2434692382812,
+                                        455.5225524902344
+                                    ],
+                                    "content": "passengers’ journeys to the public transport stop or station. Bowman ",
+                                    "type": "text",
+                                    "score": 1.0
+                                }
+                            ]
+                        },
+                        {
+                            "bbox": [
+                                317,
+                                456.4765319824219,
+                                558,
+                                466.5205383300781
+                            ],
+                            "spans": [
+                                {
+                                    "bbox": [
+                                        317.99041748046875,
+                                        456.4765319824219,
+                                        334.96441650390625,
+                                        466.5205383300781
+                                    ],
+                                    "content": "and ­",
+                                    "type": "text",
+                                    "score": 1.0
+                                },
+                                {
+                                    "bbox": [
+                                        332.71441650390625,
+                                        456.4765319824219,
+                                        560.2346801757812,
+                                        466.5205383300781
+                                    ],
+                                    "content": "Turnquist conclude from their model that the random incidence ",
+                                    "type": "text",
+                                    "score": 1.0
+                                }
+                            ]
+                        },
+                        {
+                            "bbox": [
+                                317,
+                                467.4745178222656,
+                                558,
+                                477.5185241699219
+                            ],
+                            "spans": [
+                                {
+                                    "bbox": [
+                                        317.99041748046875,
+                                        467.4745178222656,
+                                        557.7771606445312,
+                                        477.5185241699219
+                                    ],
+                                    "content": "model underestimates the waiting time benefits of improving reli-",
+                                    "type": "text",
+                                    "score": 1.0
+                                }
+                            ]
+                        },
+                        {
+                            "bbox": [
+                                317,
+                                478.4725036621094,
+                                558,
+                                488.5165100097656
+                            ],
+                            "spans": [
+                                {
+                                    "bbox": [
+                                        317.99041748046875,
+                                        478.4725036621094,
+                                        557.993408203125,
+                                        488.5165100097656
+                                    ],
+                                    "content": "ability and overestimates the waiting time benefits of increasing ser-",
+                                    "type": "text",
+                                    "score": 1.0
+                                }
+                            ]
+                        },
+                        {
+                            "bbox": [
+                                317,
+                                489.4704895019531,
+                                558,
+                                499.5144958496094
+                            ],
+                            "spans": [
+                                {
+                                    "bbox": [
+                                        317.99041748046875,
+                                        489.4704895019531,
+                                        560.4146118164062,
+                                        499.5144958496094
+                                    ],
+                                    "content": "vice frequency. This is because as reliability increases passengers ",
+                                    "type": "text",
+                                    "score": 1.0
+                                }
+                            ]
+                        },
+                        {
+                            "bbox": [
+                                317,
+                                500.4684753417969,
+                                558,
+                                510.5124816894531
+                            ],
+                            "spans": [
+                                {
+                                    "bbox": [
+                                        317.99041748046875,
+                                        500.4684753417969,
+                                        560.2705078125,
+                                        510.5124816894531
+                                    ],
+                                    "content": "can better predict departure times and so can time their incidence to ",
+                                    "type": "text",
+                                    "score": 1.0
+                                }
+                            ]
+                        },
+                        {
+                            "bbox": [
+                                317,
+                                511.4664611816406,
+                                417.1165466308594,
+                                521.5104370117188
+                            ],
+                            "spans": [
+                                {
+                                    "bbox": [
+                                        317.99041748046875,
+                                        511.4664611816406,
+                                        417.1165466308594,
+                                        521.5104370117188
+                                    ],
+                                    "content": "decrease their waiting time.",
+                                    "type": "text",
+                                    "score": 1.0
+                                }
+                            ]
+                        }
+                    ]
+                },
+                {
+                    "type": "text",
+                    "bbox": [
+                        317,
+                        522.4734497070312,
+                        558,
+                        675.6084594726562
+                    ],
+                    "lines": [
+                        {
+                            "bbox": [
+                                326,
+                                522.4734497070312,
+                                558,
+                                532.5173950195312
+                            ],
+                            "spans": [
+                                {
+                                    "bbox": [
+                                        326.99041748046875,
+                                        522.4734497070312,
+                                        557.993408203125,
+                                        532.5173950195312
+                                    ],
+                                    "content": "Furth and Muller study the issue in a theoretical context and gener-",
+                                    "type": "text",
+                                    "score": 1.0
+                                }
+                            ]
+                        },
+                        {
+                            "bbox": [
+                                317,
+                                533.48046875,
+                                558,
+                                543.5244140625
+                            ],
+                            "spans": [
+                                {
+                                    "bbox": [
+                                        317.99041748046875,
+                                        533.48046875,
+                                        442.154541015625,
+                                        543.5244140625
+                                    ],
+                                    "content": "ally agree with the above findings (",
+                                    "type": "text",
+                                    "score": 1.0
+                                },
+                                {
+                                    "bbox": [
+                                        442.0645446777344,
+                                        533.6154174804688,
+                                        446.5645446777344,
+                                        543.5154418945312
+                                    ],
+                                    "content": "2",
+                                    "type": "text",
+                                    "score": 1.0
+                                },
+                                {
+                                    "bbox": [
+                                        446.47442626953125,
+                                        533.48046875,
+                                        560.2523803710938,
+                                        543.5244140625
+                                    ],
+                                    "content": "). They are primarily concerned ",
+                                    "type": "text",
+                                    "score": 1.0
+                                }
+                            ]
+                        },
+                        {
+                            "bbox": [
+                                317,
+                                544.4874877929688,
+                                558,
+                                554.5314331054688
+                            ],
+                            "spans": [
+                                {
+                                    "bbox": [
+                                        317.99041748046875,
+                                        544.4874877929688,
+                                        560.1715698242188,
+                                        554.5314331054688
+                                    ],
+                                    "content": "with the use of data from automatic vehicle-tracking systems to assess ",
+                                    "type": "text",
+                                    "score": 1.0
+                                }
+                            ]
+                        },
+                        {
+                            "bbox": [
+                                317,
+                                555.4945068359375,
+                                558,
+                                565.5384521484375
+                            ],
+                            "spans": [
+                                {
+                                    "bbox": [
+                                        317.99041748046875,
+                                        555.4945068359375,
+                                        558.01123046875,
+                                        565.5384521484375
+                                    ],
+                                    "content": "the impacts of reliability on passenger incidence behavior and wait-",
+                                    "type": "text",
+                                    "score": 1.0
+                                }
+                            ]
+                        },
+                        {
+                            "bbox": [
+                                317,
+                                566.5015258789062,
+                                558,
+                                576.5454711914062
+                            ],
+                            "spans": [
+                                {
+                                    "bbox": [
+                                        317.99041748046875,
+                                        566.5015258789062,
+                                        560.2341918945312,
+                                        576.5454711914062
+                                    ],
+                                    "content": "ing times. They propose that passengers will react to unreliability by ",
+                                    "type": "text",
+                                    "score": 1.0
+                                }
+                            ]
+                        },
+                        {
+                            "bbox": [
+                                317,
+                                577.5084838867188,
+                                558,
+                                587.5524291992188
+                            ],
+                            "spans": [
+                                {
+                                    "bbox": [
+                                        317.99041748046875,
+                                        577.5084838867188,
+                                        560.0997314453125,
+                                        587.5524291992188
+                                    ],
+                                    "content": "departing earlier than they would with reliable services. Randomly ",
+                                    "type": "text",
+                                    "score": 1.0
+                                }
+                            ]
+                        },
+                        {
+                            "bbox": [
+                                317,
+                                588.5155029296875,
+                                558,
+                                598.5594482421875
+                            ],
+                            "spans": [
+                                {
+                                    "bbox": [
+                                        317.99041748046875,
+                                        588.5155029296875,
+                                        560.2614135742188,
+                                        598.5594482421875
+                                    ],
+                                    "content": "incident unaware passengers will experience unreliability as a more ",
+                                    "type": "text",
+                                    "score": 1.0
+                                }
+                            ]
+                        },
+                        {
+                            "bbox": [
+                                317,
+                                599.5225219726562,
+                                558,
+                                609.5664672851562
+                            ],
+                            "spans": [
+                                {
+                                    "bbox": [
+                                        317.99041748046875,
+                                        599.5225219726562,
+                                        560.2792358398438,
+                                        609.5664672851562
+                                    ],
+                                    "content": "dispersed distribution of headways and simply allocate additional ",
+                                    "type": "text",
+                                    "score": 1.0
+                                }
+                            ]
+                        },
+                        {
+                            "bbox": [
+                                317,
+                                610.5294799804688,
+                                558,
+                                620.5734252929688
+                            ],
+                            "spans": [
+                                {
+                                    "bbox": [
+                                        317.99041748046875,
+                                        610.5294799804688,
+                                        557.9752807617188,
+                                        620.5734252929688
+                                    ],
+                                    "content": "time to their trip plan to improve the chance of arriving at their des-",
+                                    "type": "text",
+                                    "score": 1.0
+                                }
+                            ]
+                        },
+                        {
+                            "bbox": [
+                                317,
+                                621.5364990234375,
+                                558,
+                                631.5804443359375
+                            ],
+                            "spans": [
+                                {
+                                    "bbox": [
+                                        317.99041748046875,
+                                        621.5364990234375,
+                                        560.0191040039062,
+                                        631.5804443359375
+                                    ],
+                                    "content": "tination on time. Aware passengers, whose incidence is not entirely ",
+                                    "type": "text",
+                                    "score": 1.0
+                                }
+                            ]
+                        },
+                        {
+                            "bbox": [
+                                317,
+                                632.5435180664062,
+                                558,
+                                642.5874633789062
+                            ],
+                            "spans": [
+                                {
+                                    "bbox": [
+                                        317.99041748046875,
+                                        632.5435180664062,
+                                        560.1539306640625,
+                                        642.5874633789062
+                                    ],
+                                    "content": "random, will react by timing their incidence somewhat earlier than ",
+                                    "type": "text",
+                                    "score": 1.0
+                                }
+                            ]
+                        },
+                        {
+                            "bbox": [
+                                317,
+                                643.550537109375,
+                                558,
+                                653.594482421875
+                            ],
+                            "spans": [
+                                {
+                                    "bbox": [
+                                        317.99041748046875,
+                                        643.550537109375,
+                                        560.2793579101562,
+                                        653.594482421875
+                                    ],
+                                    "content": "the scheduled departure time to increase their chance of catching the ",
+                                    "type": "text",
+                                    "score": 1.0
+                                }
+                            ]
+                        },
+                        {
+                            "bbox": [
+                                317,
+                                654.5575561523438,
+                                558,
+                                664.6015014648438
+                            ],
+                            "spans": [
+                                {
+                                    "bbox": [
+                                        317.99041748046875,
+                                        654.5575561523438,
+                                        486.0926208496094,
+                                        664.6015014648438
+                                    ],
+                                    "content": "desired service. The authors characterize these ­",
+                                    "type": "text",
+                                    "score": 1.0
+                                },
+                                {
+                                    "bbox": [
+                                        483.82440185546875,
+                                        654.5575561523438,
+                                        560.2432250976562,
+                                        664.6015014648438
+                                    ],
+                                    "content": "reactions as the costs ",
+                                    "type": "text",
+                                    "score": 1.0
+                                }
+                            ]
+                        },
+                        {
+                            "bbox": [
+                                317,
+                                665.5645141601562,
+                                371.8464050292969,
+                                675.6084594726562
+                            ],
+                            "spans": [
+                                {
+                                    "bbox": [
+                                        317.99041748046875,
+                                        665.5645141601562,
+                                        371.8464050292969,
+                                        675.6084594726562
+                                    ],
+                                    "content": "of unreliability.",
+                                    "type": "text",
+                                    "score": 1.0
+                                }
+                            ]
+                        }
+                    ]
+                },
+                {
+                    "type": "text",
+                    "bbox": [
+                        317,
+                        676.5625610351562,
+                        558,
+                        730.5984497070312
+                    ],
+                    "lines": [
+                        {
+                            "bbox": [
+                                326,
+                                676.5625610351562,
+                                558,
+                                686.6065063476562
+                            ],
+                            "spans": [
+                                {
+                                    "bbox": [
+                                        326.99041748046875,
+                                        676.5625610351562,
+                                        560.261474609375,
+                                        686.6065063476562
+                                    ],
+                                    "content": "Luethi et al. continued with the analysis of manually collected ",
+                                    "type": "text",
+                                    "score": 1.0
+                                }
+                            ]
+                        },
+                        {
+                            "bbox": [
+                                317,
+                                687.560546875,
+                                558,
+                                697.6044921875
+                            ],
+                            "spans": [
+                                {
+                                    "bbox": [
+                                        317.99041748046875,
+                                        687.560546875,
+                                        456.347412109375,
+                                        697.6044921875
+                                    ],
+                                    "content": "data on actual passenger behavior (",
+                                    "type": "text",
+                                    "score": 1.0
+                                },
+                                {
+                                    "bbox": [
+                                        456.5364074707031,
+                                        687.6954956054688,
+                                        461.0364074707031,
+                                        697.5955200195312
+                                    ],
+                                    "content": "6",
+                                    "type": "text",
+                                    "score": 1.0
+                                },
+                                {
+                                    "bbox": [
+                                        461.33343505859375,
+                                        687.560546875,
+                                        560.1715087890625,
+                                        697.6044921875
+                                    ],
+                                    "content": "). They use the language ",
+                                    "type": "text",
+                                    "score": 1.0
+                                }
+                            ]
+                        },
+                        {
+                            "bbox": [
+                                317,
+                                698.5585327148438,
+                                558,
+                                708.6024780273438
+                            ],
+                            "spans": [
+                                {
+                                    "bbox": [
+                                        317.99041748046875,
+                                        698.5585327148438,
+                                        560.3427734375,
+                                        708.6024780273438
+                                    ],
+                                    "content": "of probability to describe two classes of passengers. The first is ",
+                                    "type": "text",
+                                    "score": 1.0
+                                }
+                            ]
+                        },
+                        {
+                            "bbox": [
+                                317,
+                                709.5565185546875,
+                                558,
+                                719.6004638671875
+                            ],
+                            "spans": [
+                                {
+                                    "bbox": [
+                                        317.99041748046875,
+                                        709.5565185546875,
+                                        560.2250366210938,
+                                        719.6004638671875
+                                    ],
+                                    "content": "timetable-dependent passengers (i.e., the aware passengers), whose ",
+                                    "type": "text",
+                                    "score": 1.0
+                                }
+                            ]
+                        },
+                        {
+                            "bbox": [
+                                317,
+                                720.5545043945312,
+                                558,
+                                730.5984497070312
+                            ],
+                            "spans": [
+                                {
+                                    "bbox": [
+                                        317.99041748046875,
+                                        720.5545043945312,
+                                        560.027587890625,
+                                        730.5984497070312
+                                    ],
+                                    "content": "incidence behavior is affected by awareness (possibly gained ",
+                                    "type": "text",
+                                    "score": 1.0
+                                }
+                            ]
+                        }
+                    ]
+                }
+            ]
+        }
+    ],
+    "_parse_type": "txt",
+    "_version_name": "0.6.1"
+}

+ 638 - 0
tests/test_tools/assets/cli/pdf/output/cli_test_01/auto/model.json

@@ -0,0 +1,638 @@
+[
+    {
+        "layout_dets": [
+            {
+                "category_id": 1,
+                "poly": [
+                    882.4013061523438,
+                    169.93817138671875,
+                    1552.350341796875,
+                    169.93817138671875,
+                    1552.350341796875,
+                    625.8263549804688,
+                    882.4013061523438,
+                    625.8263549804688
+                ],
+                "score": 0.999992311000824
+            },
+            {
+                "category_id": 1,
+                "poly": [
+                    882.474853515625,
+                    1450.92822265625,
+                    1551.4490966796875,
+                    1450.92822265625,
+                    1551.4490966796875,
+                    1877.5712890625,
+                    882.474853515625,
+                    1877.5712890625
+                ],
+                "score": 0.9999903440475464
+            },
+            {
+                "category_id": 1,
+                "poly": [
+                    881.6513061523438,
+                    626.2058715820312,
+                    1552.1400146484375,
+                    626.2058715820312,
+                    1552.1400146484375,
+                    1450.604736328125,
+                    881.6513061523438,
+                    1450.604736328125
+                ],
+                "score": 0.9999856352806091
+            },
+            {
+                "category_id": 1,
+                "poly": [
+                    149.41075134277344,
+                    232.1595001220703,
+                    819.0465087890625,
+                    232.1595001220703,
+                    819.0465087890625,
+                    625.8865356445312,
+                    149.41075134277344,
+                    625.8865356445312
+                ],
+                "score": 0.99998539686203
+            },
+            {
+                "category_id": 1,
+                "poly": [
+                    149.3945770263672,
+                    1215.5172119140625,
+                    817.8850708007812,
+                    1215.5172119140625,
+                    817.8850708007812,
+                    1304.873291015625,
+                    149.3945770263672,
+                    1304.873291015625
+                ],
+                "score": 0.9999765157699585
+            },
+            {
+                "category_id": 1,
+                "poly": [
+                    882.6979370117188,
+                    1880.13916015625,
+                    1552.15185546875,
+                    1880.13916015625,
+                    1552.15185546875,
+                    2031.339599609375,
+                    882.6979370117188,
+                    2031.339599609375
+                ],
+                "score": 0.9999744892120361
+            },
+            {
+                "category_id": 1,
+                "poly": [
+                    148.96054077148438,
+                    743.3055419921875,
+                    818.6231689453125,
+                    743.3055419921875,
+                    818.6231689453125,
+                    1074.2369384765625,
+                    148.96054077148438,
+                    1074.2369384765625
+                ],
+                "score": 0.9999669790267944
+            },
+            {
+                "category_id": 1,
+                "poly": [
+                    148.8435516357422,
+                    1791.14306640625,
+                    818.6885375976562,
+                    1791.14306640625,
+                    818.6885375976562,
+                    2030.794189453125,
+                    148.8435516357422,
+                    2030.794189453125
+                ],
+                "score": 0.9999618530273438
+            },
+            {
+                "category_id": 0,
+                "poly": [
+                    150.7009735107422,
+                    684.0087890625,
+                    623.5106201171875,
+                    684.0087890625,
+                    623.5106201171875,
+                    717.03662109375,
+                    150.7009735107422,
+                    717.03662109375
+                ],
+                "score": 0.9999415278434753
+            },
+            {
+                "category_id": 8,
+                "poly": [
+                    146.48068237304688,
+                    1331.6737060546875,
+                    317.2640075683594,
+                    1331.6737060546875,
+                    317.2640075683594,
+                    1400.1722412109375,
+                    146.48068237304688,
+                    1400.1722412109375
+                ],
+                "score": 0.9998958110809326
+            },
+            {
+                "category_id": 1,
+                "poly": [
+                    149.42420959472656,
+                    1430.8782958984375,
+                    818.9042358398438,
+                    1430.8782958984375,
+                    818.9042358398438,
+                    1672.7386474609375,
+                    149.42420959472656,
+                    1672.7386474609375
+                ],
+                "score": 0.9998599290847778
+            },
+            {
+                "category_id": 1,
+                "poly": [
+                    149.18746948242188,
+                    172.10252380371094,
+                    818.5662231445312,
+                    172.10252380371094,
+                    818.5662231445312,
+                    230.4594268798828,
+                    149.18746948242188,
+                    230.4594268798828
+                ],
+                "score": 0.9997718334197998
+            },
+            {
+                "category_id": 0,
+                "poly": [
+                    149.0175018310547,
+                    1732.1090087890625,
+                    702.1005859375,
+                    1732.1090087890625,
+                    702.1005859375,
+                    1763.6046142578125,
+                    149.0175018310547,
+                    1763.6046142578125
+                ],
+                "score": 0.9997085928916931
+            },
+            {
+                "category_id": 2,
+                "poly": [
+                    1519.802490234375,
+                    98.59099578857422,
+                    1551.985107421875,
+                    98.59099578857422,
+                    1551.985107421875,
+                    119.48420715332031,
+                    1519.802490234375,
+                    119.48420715332031
+                ],
+                "score": 0.9995552897453308
+            },
+            {
+                "category_id": 8,
+                "poly": [
+                    146.9109649658203,
+                    1100.156494140625,
+                    544.2803344726562,
+                    1100.156494140625,
+                    544.2803344726562,
+                    1184.929443359375,
+                    146.9109649658203,
+                    1184.929443359375
+                ],
+                "score": 0.9995207786560059
+            },
+            {
+                "category_id": 2,
+                "poly": [
+                    148.11611938476562,
+                    99.87767791748047,
+                    318.926025390625,
+                    99.87767791748047,
+                    318.926025390625,
+                    120.70393371582031,
+                    148.11611938476562,
+                    120.70393371582031
+                ],
+                "score": 0.999351441860199
+            },
+            {
+                "category_id": 9,
+                "poly": [
+                    791.7642211914062,
+                    1130.056396484375,
+                    818.6940307617188,
+                    1130.056396484375,
+                    818.6940307617188,
+                    1161.1080322265625,
+                    791.7642211914062,
+                    1161.1080322265625
+                ],
+                "score": 0.9908884763717651
+            },
+            {
+                "category_id": 9,
+                "poly": [
+                    788.37060546875,
+                    1346.8450927734375,
+                    818.5010986328125,
+                    1346.8450927734375,
+                    818.5010986328125,
+                    1377.370361328125,
+                    788.37060546875,
+                    1377.370361328125
+                ],
+                "score": 0.9873985052108765
+            },
+            {
+                "category_id": 14,
+                "poly": [
+                    146,
+                    1103,
+                    543,
+                    1103,
+                    543,
+                    1184,
+                    146,
+                    1184
+                ],
+                "score": 0.94,
+                "latex": "E\\!\\left(W\\right)\\!=\\!\\frac{E\\!\\left[H^{2}\\right]}{2E\\!\\left[H\\right]}\\!=\\!\\frac{E\\!\\left[H\\right]}{2}\\!\\!\\left(1\\!+\\!\\operatorname{CV}\\!\\left(H\\right)^{2}\\right)"
+            },
+            {
+                "category_id": 13,
+                "poly": [
+                    1196,
+                    354,
+                    1278,
+                    354,
+                    1278,
+                    384,
+                    1196,
+                    384
+                ],
+                "score": 0.91,
+                "latex": "p(1-q)"
+            },
+            {
+                "category_id": 13,
+                "poly": [
+                    881,
+                    415,
+                    1020,
+                    415,
+                    1020,
+                    444,
+                    881,
+                    444
+                ],
+                "score": 0.91,
+                "latex": "(1-p)(1-q)"
+            },
+            {
+                "category_id": 14,
+                "poly": [
+                    147,
+                    1333,
+                    318,
+                    1333,
+                    318,
+                    1400,
+                    147,
+                    1400
+                ],
+                "score": 0.91,
+                "latex": "\\mathbf{CV}\\big(H\\big)\\!=\\!\\frac{\\boldsymbol{\\upsigma}_{H}}{E\\big[H\\big]}"
+            },
+            {
+                "category_id": 13,
+                "poly": [
+                    1197,
+                    657,
+                    1263,
+                    657,
+                    1263,
+                    686,
+                    1197,
+                    686
+                ],
+                "score": 0.9,
+                "latex": "(1-p)"
+            },
+            {
+                "category_id": 13,
+                "poly": [
+                    213,
+                    1217,
+                    263,
+                    1217,
+                    263,
+                    1244,
+                    213,
+                    1244
+                ],
+                "score": 0.88,
+                "latex": "E[X]"
+            },
+            {
+                "category_id": 13,
+                "poly": [
+                    214,
+                    1434,
+                    245,
+                    1434,
+                    245,
+                    1459,
+                    214,
+                    1459
+                ],
+                "score": 0.87,
+                "latex": "\\upsigma_{H}"
+            },
+            {
+                "category_id": 13,
+                "poly": [
+                    324,
+                    2002,
+                    373,
+                    2002,
+                    373,
+                    2028,
+                    324,
+                    2028
+                ],
+                "score": 0.84,
+                "latex": "30\\%"
+            },
+            {
+                "category_id": 13,
+                "poly": [
+                    1209,
+                    693,
+                    1225,
+                    693,
+                    1225,
+                    717,
+                    1209,
+                    717
+                ],
+                "score": 0.83,
+                "latex": "p"
+            },
+            {
+                "category_id": 13,
+                "poly": [
+                    990,
+                    449,
+                    1007,
+                    449,
+                    1007,
+                    474,
+                    990,
+                    474
+                ],
+                "score": 0.81,
+                "latex": "p"
+            },
+            {
+                "category_id": 13,
+                "poly": [
+                    346,
+                    1277,
+                    369,
+                    1277,
+                    369,
+                    1301,
+                    346,
+                    1301
+                ],
+                "score": 0.81,
+                "latex": "H"
+            },
+            {
+                "category_id": 13,
+                "poly": [
+                    1137,
+                    661,
+                    1154,
+                    661,
+                    1154,
+                    686,
+                    1137,
+                    686
+                ],
+                "score": 0.81,
+                "latex": "p"
+            },
+            {
+                "category_id": 13,
+                "poly": [
+                    522,
+                    1432,
+                    579,
+                    1432,
+                    579,
+                    1459,
+                    522,
+                    1459
+                ],
+                "score": 0.81,
+                "latex": "H\\left(4\\right)"
+            },
+            {
+                "category_id": 13,
+                "poly": [
+                    944,
+                    540,
+                    962,
+                    540,
+                    962,
+                    565,
+                    944,
+                    565
+                ],
+                "score": 0.8,
+                "latex": "p"
+            },
+            {
+                "category_id": 13,
+                "poly": [
+                    1444,
+                    936,
+                    1461,
+                    936,
+                    1461,
+                    961,
+                    1444,
+                    961
+                ],
+                "score": 0.79,
+                "latex": "p"
+            },
+            {
+                "category_id": 13,
+                "poly": [
+                    602,
+                    1247,
+                    624,
+                    1247,
+                    624,
+                    1270,
+                    602,
+                    1270
+                ],
+                "score": 0.78,
+                "latex": "H"
+            },
+            {
+                "category_id": 13,
+                "poly": [
+                    147,
+                    1247,
+                    167,
+                    1247,
+                    167,
+                    1271,
+                    147,
+                    1271
+                ],
+                "score": 0.77,
+                "latex": "X"
+            },
+            {
+                "category_id": 13,
+                "poly": [
+                    210,
+                    1246,
+                    282,
+                    1246,
+                    282,
+                    1274,
+                    210,
+                    1274
+                ],
+                "score": 0.77,
+                "latex": "\\operatorname{CV}(H)"
+            },
+            {
+                "category_id": 13,
+                "poly": [
+                    1346,
+                    268,
+                    1361,
+                    268,
+                    1361,
+                    292,
+                    1346,
+                    292
+                ],
+                "score": 0.76,
+                "latex": "q"
+            },
+            {
+                "category_id": 13,
+                "poly": [
+                    215,
+                    957,
+                    238,
+                    957,
+                    238,
+                    981,
+                    215,
+                    981
+                ],
+                "score": 0.74,
+                "latex": "H"
+            },
+            {
+                "category_id": 13,
+                "poly": [
+                    149,
+                    956,
+                    173,
+                    956,
+                    173,
+                    981,
+                    149,
+                    981
+                ],
+                "score": 0.63,
+                "latex": "W"
+            },
+            {
+                "category_id": 13,
+                "poly": [
+                    924,
+                    841,
+                    1016,
+                    841,
+                    1016,
+                    868,
+                    924,
+                    868
+                ],
+                "score": 0.56,
+                "latex": "8{\\cdot}00\\;\\mathrm{a.m}"
+            },
+            {
+                "category_id": 13,
+                "poly": [
+                    956,
+                    871,
+                    1032,
+                    871,
+                    1032,
+                    898,
+                    956,
+                    898
+                ],
+                "score": 0.43,
+                "latex": "20~\\mathrm{min}"
+            },
+            {
+                "category_id": 13,
+                "poly": [
+                    1082,
+                    781,
+                    1112,
+                    781,
+                    1112,
+                    808,
+                    1082,
+                    808
+                ],
+                "score": 0.41,
+                "latex": "(l)"
+            },
+            {
+                "category_id": 13,
+                "poly": [
+                    697,
+                    1821,
+                    734,
+                    1821,
+                    734,
+                    1847,
+                    697,
+                    1847
+                ],
+                "score": 0.3,
+                "latex": "^{1\\mathrm{~h~}}"
+            }
+        ],
+        "page_info": {
+            "page_no": 0,
+            "height": 2200,
+            "width": 1700
+        }
+    }
+]

BIN
tests/test_tools/assets/cli/pdf/output/cli_test_01/auto/origin.pdf


BIN
tests/test_tools/assets/cli/pdf/output/cli_test_01/auto/spans.pdf


+ 51 - 43
tests/test_tools/test_cli.py

@@ -1,6 +1,7 @@
-import tempfile
 import os
 import shutil
+import tempfile
+
 from click.testing import CliRunner
 
 from magic_pdf.tools.cli import cli
@@ -8,19 +9,20 @@ from magic_pdf.tools.cli import cli
 
 def test_cli_pdf():
     # setup
-    unitest_dir = "/tmp/magic_pdf/unittest/tools"
-    filename = "cli_test_01"
+    unitest_dir = '/tmp/magic_pdf/unittest/tools'
+    filename = 'cli_test_01'
     os.makedirs(unitest_dir, exist_ok=True)
-    temp_output_dir = tempfile.mkdtemp(dir="/tmp/magic_pdf/unittest/tools")
+    temp_output_dir = tempfile.mkdtemp(dir='/tmp/magic_pdf/unittest/tools')
+    os.makedirs(temp_output_dir, exist_ok=True)
 
     # run
     runner = CliRunner()
     result = runner.invoke(
         cli,
         [
-            "-p",
-            "tests/test_tools/assets/cli/pdf/cli_test_01.pdf",
-            "-o",
+            '-p',
+            'tests/test_tools/assets/cli/pdf/cli_test_01.pdf',
+            '-o',
             temp_output_dir,
         ],
     )
@@ -28,29 +30,31 @@ def test_cli_pdf():
     # check
     assert result.exit_code == 0
 
-    base_output_dir = os.path.join(temp_output_dir, "cli_test_01/auto")
+    base_output_dir = os.path.join(temp_output_dir, 'cli_test_01/auto')
 
-    r = os.stat(os.path.join(base_output_dir, f"{filename}.md"))
+    r = os.stat(os.path.join(base_output_dir, f'{filename}.md'))
     assert r.st_size > 7000
 
-    r = os.stat(os.path.join(base_output_dir, "middle.json"))
+    r = os.stat(os.path.join(base_output_dir, f'{filename}_middle.json'))
     assert r.st_size > 200000
 
-    r = os.stat(os.path.join(base_output_dir, "model.json"))
+    r = os.stat(os.path.join(base_output_dir, f'{filename}_model.json'))
     assert r.st_size > 15000
 
-    r = os.stat(os.path.join(base_output_dir, "origin.pdf"))
+    r = os.stat(os.path.join(base_output_dir, f'{filename}_origin.pdf'))
     assert r.st_size > 500000
 
-    r = os.stat(os.path.join(base_output_dir, "layout.pdf"))
+    r = os.stat(os.path.join(base_output_dir, f'{filename}_layout.pdf'))
     assert r.st_size > 500000
 
-    r = os.stat(os.path.join(base_output_dir, "spans.pdf"))
+    r = os.stat(os.path.join(base_output_dir, f'{filename}_spans.pdf'))
     assert r.st_size > 500000
 
-    assert os.path.exists(os.path.join(base_output_dir, "images")) is True
-    assert os.path.isdir(os.path.join(base_output_dir, "images")) is True
-    assert os.path.exists(os.path.join(base_output_dir, "content_list.json")) is False
+    assert os.path.exists(os.path.join(base_output_dir, 'images')) is True
+    assert os.path.isdir(os.path.join(base_output_dir, 'images')) is True
+    assert os.path.exists(
+        os.path.join(base_output_dir,
+                     f'{filename}_content_list.json')) is False
 
     # teardown
     shutil.rmtree(temp_output_dir)
@@ -58,68 +62,72 @@ def test_cli_pdf():
 
 def test_cli_path():
     # setup
-    unitest_dir = "/tmp/magic_pdf/unittest/tools"
+    unitest_dir = '/tmp/magic_pdf/unittest/tools'
     os.makedirs(unitest_dir, exist_ok=True)
-    temp_output_dir = tempfile.mkdtemp(dir="/tmp/magic_pdf/unittest/tools")
+    temp_output_dir = tempfile.mkdtemp(dir='/tmp/magic_pdf/unittest/tools')
+    os.makedirs(temp_output_dir, exist_ok=True)
 
     # run
     runner = CliRunner()
     result = runner.invoke(
-        cli, ["-p", "tests/test_tools/assets/cli/path", "-o", temp_output_dir]
-    )
+        cli, ['-p', 'tests/test_tools/assets/cli/path', '-o', temp_output_dir])
 
     # check
     assert result.exit_code == 0
 
-    filename = "cli_test_01"
-    base_output_dir = os.path.join(temp_output_dir, "cli_test_01/auto")
+    filename = 'cli_test_01'
+    base_output_dir = os.path.join(temp_output_dir, 'cli_test_01/auto')
 
-    r = os.stat(os.path.join(base_output_dir, f"{filename}.md"))
+    r = os.stat(os.path.join(base_output_dir, f'{filename}.md'))
     assert r.st_size > 7000
 
-    r = os.stat(os.path.join(base_output_dir, "middle.json"))
+    r = os.stat(os.path.join(base_output_dir, f'{filename}_middle.json'))
     assert r.st_size > 200000
 
-    r = os.stat(os.path.join(base_output_dir, "model.json"))
+    r = os.stat(os.path.join(base_output_dir, f'{filename}_model.json'))
     assert r.st_size > 15000
 
-    r = os.stat(os.path.join(base_output_dir, "origin.pdf"))
+    r = os.stat(os.path.join(base_output_dir, f'{filename}_origin.pdf'))
     assert r.st_size > 500000
 
-    r = os.stat(os.path.join(base_output_dir, "layout.pdf"))
+    r = os.stat(os.path.join(base_output_dir, f'{filename}_layout.pdf'))
     assert r.st_size > 500000
 
-    r = os.stat(os.path.join(base_output_dir, "spans.pdf"))
+    r = os.stat(os.path.join(base_output_dir, f'{filename}_spans.pdf'))
     assert r.st_size > 500000
 
-    assert os.path.exists(os.path.join(base_output_dir, "images")) is True
-    assert os.path.isdir(os.path.join(base_output_dir, "images")) is True
-    assert os.path.exists(os.path.join(base_output_dir, "content_list.json")) is False
+    assert os.path.exists(os.path.join(base_output_dir, 'images')) is True
+    assert os.path.isdir(os.path.join(base_output_dir, 'images')) is True
+    assert os.path.exists(
+        os.path.join(base_output_dir,
+                     f'{filename}_content_list.json')) is False
 
-    base_output_dir = os.path.join(temp_output_dir, "cli_test_02/auto")
-    filename = "cli_test_02"
+    base_output_dir = os.path.join(temp_output_dir, 'cli_test_02/auto')
+    filename = 'cli_test_02'
 
-    r = os.stat(os.path.join(base_output_dir, f"{filename}.md"))
+    r = os.stat(os.path.join(base_output_dir, f'{filename}.md'))
     assert r.st_size > 5000
 
-    r = os.stat(os.path.join(base_output_dir, "middle.json"))
+    r = os.stat(os.path.join(base_output_dir, f'{filename}_middle.json'))
     assert r.st_size > 200000
 
-    r = os.stat(os.path.join(base_output_dir, "model.json"))
+    r = os.stat(os.path.join(base_output_dir, f'{filename}_model.json'))
     assert r.st_size > 15000
 
-    r = os.stat(os.path.join(base_output_dir, "origin.pdf"))
+    r = os.stat(os.path.join(base_output_dir, f'{filename}_origin.pdf'))
     assert r.st_size > 500000
 
-    r = os.stat(os.path.join(base_output_dir, "layout.pdf"))
+    r = os.stat(os.path.join(base_output_dir, f'{filename}_layout.pdf'))
     assert r.st_size > 500000
 
-    r = os.stat(os.path.join(base_output_dir, "spans.pdf"))
+    r = os.stat(os.path.join(base_output_dir, f'{filename}_spans.pdf'))
     assert r.st_size > 500000
 
-    assert os.path.exists(os.path.join(base_output_dir, "images")) is True
-    assert os.path.isdir(os.path.join(base_output_dir, "images")) is True
-    assert os.path.exists(os.path.join(base_output_dir, "content_list.json")) is False
+    assert os.path.exists(os.path.join(base_output_dir, 'images')) is True
+    assert os.path.isdir(os.path.join(base_output_dir, 'images')) is True
+    assert os.path.exists(
+        os.path.join(base_output_dir,
+                     f'{filename}_content_list.json')) is False
 
     # teardown
     shutil.rmtree(temp_output_dir)

+ 42 - 39
tests/test_tools/test_cli_dev.py

@@ -1,6 +1,7 @@
-import tempfile
 import os
 import shutil
+import tempfile
+
 from click.testing import CliRunner
 
 from magic_pdf.tools import cli_dev
@@ -8,22 +9,23 @@ from magic_pdf.tools import cli_dev
 
 def test_cli_pdf():
     # setup
-    unitest_dir = "/tmp/magic_pdf/unittest/tools"
-    filename = "cli_test_01"
+    unitest_dir = '/tmp/magic_pdf/unittest/tools'
+    filename = 'cli_test_01'
     os.makedirs(unitest_dir, exist_ok=True)
-    temp_output_dir = tempfile.mkdtemp(dir="/tmp/magic_pdf/unittest/tools")
+    temp_output_dir = tempfile.mkdtemp(dir='/tmp/magic_pdf/unittest/tools')
+    os.makedirs(temp_output_dir, exist_ok=True)
 
     # run
     runner = CliRunner()
     result = runner.invoke(
         cli_dev.cli,
         [
-            "pdf",
-            "-p",
-            "tests/test_tools/assets/cli/pdf/cli_test_01.pdf",
-            "-j",
-            "tests/test_tools/assets/cli_dev/cli_test_01.model.json",
-            "-o",
+            'pdf',
+            '-p',
+            'tests/test_tools/assets/cli/pdf/cli_test_01.pdf',
+            '-j',
+            'tests/test_tools/assets/cli_dev/cli_test_01.model.json',
+            '-o',
             temp_output_dir,
         ],
     )
@@ -31,31 +33,31 @@ def test_cli_pdf():
     # check
     assert result.exit_code == 0
 
-    base_output_dir = os.path.join(temp_output_dir, "cli_test_01/auto")
+    base_output_dir = os.path.join(temp_output_dir, 'cli_test_01/auto')
 
-    r = os.stat(os.path.join(base_output_dir, "content_list.json"))
+    r = os.stat(os.path.join(base_output_dir, f'{filename}_content_list.json'))
     assert r.st_size > 5000
 
-    r = os.stat(os.path.join(base_output_dir, f"{filename}.md"))
+    r = os.stat(os.path.join(base_output_dir, f'{filename}.md'))
     assert r.st_size > 7000
 
-    r = os.stat(os.path.join(base_output_dir, "middle.json"))
+    r = os.stat(os.path.join(base_output_dir, f'{filename}_middle.json'))
     assert r.st_size > 200000
 
-    r = os.stat(os.path.join(base_output_dir, "model.json"))
+    r = os.stat(os.path.join(base_output_dir, f'{filename}_model.json'))
     assert r.st_size > 15000
 
-    r = os.stat(os.path.join(base_output_dir, "origin.pdf"))
+    r = os.stat(os.path.join(base_output_dir, f'{filename}_origin.pdf'))
     assert r.st_size > 500000
 
-    r = os.stat(os.path.join(base_output_dir, "layout.pdf"))
+    r = os.stat(os.path.join(base_output_dir, f'{filename}_layout.pdf'))
     assert r.st_size > 500000
 
-    r = os.stat(os.path.join(base_output_dir, "spans.pdf"))
+    r = os.stat(os.path.join(base_output_dir, f'{filename}_spans.pdf'))
     assert r.st_size > 500000
 
-    assert os.path.exists(os.path.join(base_output_dir, "images")) is True
-    assert os.path.isdir(os.path.join(base_output_dir, "images")) is True
+    assert os.path.exists(os.path.join(base_output_dir, 'images')) is True
+    assert os.path.isdir(os.path.join(base_output_dir, 'images')) is True
 
     # teardown
     shutil.rmtree(temp_output_dir)
@@ -63,26 +65,27 @@ def test_cli_pdf():
 
 def test_cli_jsonl():
     # setup
-    unitest_dir = "/tmp/magic_pdf/unittest/tools"
-    filename = "cli_test_01"
+    unitest_dir = '/tmp/magic_pdf/unittest/tools'
+    filename = 'cli_test_01'
     os.makedirs(unitest_dir, exist_ok=True)
-    temp_output_dir = tempfile.mkdtemp(dir="/tmp/magic_pdf/unittest/tools")
+    temp_output_dir = tempfile.mkdtemp(dir='/tmp/magic_pdf/unittest/tools')
+    os.makedirs(temp_output_dir, exist_ok=True)
 
     def mock_read_s3_path(s3path):
-        with open(s3path, "rb") as f:
+        with open(s3path, 'rb') as f:
             return f.read()
 
-    cli_dev.read_s3_path = mock_read_s3_path # mock
+    cli_dev.read_s3_path = mock_read_s3_path  # mock
 
     # run
     runner = CliRunner()
     result = runner.invoke(
         cli_dev.cli,
         [
-            "jsonl",
-            "-j",
-            "tests/test_tools/assets/cli_dev/cli_test_01.jsonl",
-            "-o",
+            'jsonl',
+            '-j',
+            'tests/test_tools/assets/cli_dev/cli_test_01.jsonl',
+            '-o',
             temp_output_dir,
         ],
     )
@@ -90,31 +93,31 @@ def test_cli_jsonl():
     # check
     assert result.exit_code == 0
 
-    base_output_dir = os.path.join(temp_output_dir, "cli_test_01/auto")
+    base_output_dir = os.path.join(temp_output_dir, 'cli_test_01/auto')
 
-    r = os.stat(os.path.join(base_output_dir, "content_list.json"))
+    r = os.stat(os.path.join(base_output_dir, f'{filename}_content_list.json'))
     assert r.st_size > 5000
 
-    r = os.stat(os.path.join(base_output_dir, f"{filename}.md"))
+    r = os.stat(os.path.join(base_output_dir, f'{filename}.md'))
     assert r.st_size > 7000
 
-    r = os.stat(os.path.join(base_output_dir, "middle.json"))
+    r = os.stat(os.path.join(base_output_dir, f'{filename}_middle.json'))
     assert r.st_size > 200000
 
-    r = os.stat(os.path.join(base_output_dir, "model.json"))
+    r = os.stat(os.path.join(base_output_dir, f'{filename}_model.json'))
     assert r.st_size > 15000
 
-    r = os.stat(os.path.join(base_output_dir, "origin.pdf"))
+    r = os.stat(os.path.join(base_output_dir, f'{filename}_origin.pdf'))
     assert r.st_size > 500000
 
-    r = os.stat(os.path.join(base_output_dir, "layout.pdf"))
+    r = os.stat(os.path.join(base_output_dir, f'{filename}_layout.pdf'))
     assert r.st_size > 500000
 
-    r = os.stat(os.path.join(base_output_dir, "spans.pdf"))
+    r = os.stat(os.path.join(base_output_dir, f'{filename}_spans.pdf'))
     assert r.st_size > 500000
 
-    assert os.path.exists(os.path.join(base_output_dir, "images")) is True
-    assert os.path.isdir(os.path.join(base_output_dir, "images")) is True
+    assert os.path.exists(os.path.join(base_output_dir, 'images')) is True
+    assert os.path.isdir(os.path.join(base_output_dir, 'images')) is True
 
     # teardown
     shutil.rmtree(temp_output_dir)

+ 24 - 18
tests/test_tools/test_common.py

@@ -1,52 +1,58 @@
-import tempfile
 import os
 import shutil
+import tempfile
 
 import pytest
 
+import magic_pdf.model as model_config
 from magic_pdf.tools.common import do_parse
 
 
-@pytest.mark.parametrize("method", ["auto", "txt", "ocr"])
+@pytest.mark.parametrize('method', ['auto', 'txt', 'ocr'])
 def test_common_do_parse(method):
     # setup
-    unitest_dir = "/tmp/magic_pdf/unittest/tools"
-    filename = "fake"
+    model_config.__use_inside_model__ = True
+    unitest_dir = '/tmp/magic_pdf/unittest/tools'
+    filename = 'fake'
     os.makedirs(unitest_dir, exist_ok=True)
 
-    temp_output_dir = tempfile.mkdtemp(dir="/tmp/magic_pdf/unittest/tools")
-
+    temp_output_dir = tempfile.mkdtemp(dir='/tmp/magic_pdf/unittest/tools')
+    os.makedirs(temp_output_dir, exist_ok=True)
     # run
-    with open("tests/test_tools/assets/common/cli_test_01.pdf", "rb") as f:
+    with open('tests/test_tools/assets/common/cli_test_01.pdf', 'rb') as f:
         bits = f.read()
-    do_parse(temp_output_dir, filename, bits, [], method, f_dump_content_list=True)
+    do_parse(temp_output_dir,
+             filename,
+             bits, [],
+             method,
+             f_dump_content_list=True)
 
     # check
-    base_output_dir = os.path.join(temp_output_dir, f"fake/{method}")
+    base_output_dir = os.path.join(temp_output_dir, f'fake/{method}')
 
-    r = os.stat(os.path.join(base_output_dir, "content_list.json"))
+    r = os.stat(os.path.join(base_output_dir, f'{filename}_content_list.json'))
     assert r.st_size > 5000
 
-    r = os.stat(os.path.join(base_output_dir, f"{filename}.md"))
+    r = os.stat(os.path.join(base_output_dir, f'{filename}.md'))
     assert r.st_size > 7000
 
-    r = os.stat(os.path.join(base_output_dir, "middle.json"))
+    r = os.stat(os.path.join(base_output_dir, f'{filename}_middle.json'))
     assert r.st_size > 200000
 
-    r = os.stat(os.path.join(base_output_dir, "model.json"))
+    r = os.stat(os.path.join(base_output_dir, f'{filename}_model.json'))
     assert r.st_size > 15000
 
-    r = os.stat(os.path.join(base_output_dir, "origin.pdf"))
+    r = os.stat(os.path.join(base_output_dir, f'{filename}_origin.pdf'))
     assert r.st_size > 500000
 
-    r = os.stat(os.path.join(base_output_dir, "layout.pdf"))
+    r = os.stat(os.path.join(base_output_dir, f'{filename}_layout.pdf'))
     assert r.st_size > 500000
 
-    r = os.stat(os.path.join(base_output_dir, "spans.pdf"))
+    r = os.stat(os.path.join(base_output_dir, f'{filename}_spans.pdf'))
     assert r.st_size > 500000
 
-    os.path.exists(os.path.join(base_output_dir, "images"))
-    os.path.isdir(os.path.join(base_output_dir, "images"))
+    os.path.exists(os.path.join(base_output_dir, 'images'))
+    os.path.isdir(os.path.join(base_output_dir, 'images'))
 
     # teardown
     shutil.rmtree(temp_output_dir)