Upload README.md with huggingface_hub
Browse files
    	
        README.md
    CHANGED
    
    | @@ -1,45 +1,93 @@ | |
| 1 | 
             
            ---
         | 
| 2 | 
            -
             | 
| 3 | 
            -
             | 
| 4 | 
            -
             | 
| 5 | 
            -
             | 
| 6 | 
            -
             | 
| 7 | 
            -
             | 
| 8 | 
            -
             | 
| 9 | 
            -
             | 
| 10 | 
            -
             | 
| 11 | 
            -
                dtype: image
         | 
| 12 | 
            -
              - name: text
         | 
| 13 | 
            -
                dtype: string
         | 
| 14 | 
            -
              - name: alto_xml
         | 
| 15 | 
            -
                dtype: string
         | 
| 16 | 
            -
              - name: has_image
         | 
| 17 | 
            -
                dtype: bool
         | 
| 18 | 
            -
              - name: has_alto
         | 
| 19 | 
            -
                dtype: bool
         | 
| 20 | 
            -
              - name: document_metadata
         | 
| 21 | 
            -
                dtype: string
         | 
| 22 | 
            -
              - name: has_metadata
         | 
| 23 | 
            -
                dtype: bool
         | 
| 24 | 
            -
              - name: exam_type
         | 
| 25 | 
            -
                dtype: string
         | 
| 26 | 
            -
              - name: exam_year
         | 
| 27 | 
            -
                dtype: string
         | 
| 28 | 
            -
              - name: exam_reference
         | 
| 29 | 
            -
                dtype: string
         | 
| 30 | 
            -
              - name: markdown
         | 
| 31 | 
            -
                dtype: string
         | 
| 32 | 
            -
              - name: inference_info
         | 
| 33 | 
            -
                dtype: string
         | 
| 34 | 
            -
              splits:
         | 
| 35 | 
            -
              - name: train
         | 
| 36 | 
            -
                num_bytes: 1040482
         | 
| 37 | 
            -
                num_examples: 10
         | 
| 38 | 
            -
              download_size: 778422
         | 
| 39 | 
            -
              dataset_size: 1040482
         | 
| 40 | 
            -
            configs:
         | 
| 41 | 
            -
            - config_name: default
         | 
| 42 | 
            -
              data_files:
         | 
| 43 | 
            -
              - split: train
         | 
| 44 | 
            -
                path: data/train-*
         | 
| 45 | 
             
            ---
         | 
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | 
|  | |
| 1 | 
             
            ---
         | 
| 2 | 
            +
            viewer: false
         | 
| 3 | 
            +
            tags:
         | 
| 4 | 
            +
            - ocr
         | 
| 5 | 
            +
            - document-processing
         | 
| 6 | 
            +
            - dots-ocr
         | 
| 7 | 
            +
            - multilingual
         | 
| 8 | 
            +
            - markdown
         | 
| 9 | 
            +
            - uv-script
         | 
| 10 | 
            +
            - generated
         | 
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
| 11 | 
             
            ---
         | 
| 12 | 
            +
             | 
| 13 | 
            +
            # Document OCR using dots.ocr
         | 
| 14 | 
            +
             | 
| 15 | 
            +
            This dataset contains OCR results from images in [NationalLibraryOfScotland/Scottish-School-Exam-Papers](https://huggingface.co/datasets/NationalLibraryOfScotland/Scottish-School-Exam-Papers) using DoTS.ocr, a compact 1.7B multilingual model.
         | 
| 16 | 
            +
             | 
| 17 | 
            +
            ## Processing Details
         | 
| 18 | 
            +
             | 
| 19 | 
            +
            - **Source Dataset**: [NationalLibraryOfScotland/Scottish-School-Exam-Papers](https://huggingface.co/datasets/NationalLibraryOfScotland/Scottish-School-Exam-Papers)
         | 
| 20 | 
            +
            - **Model**: [rednote-hilab/dots.ocr](https://huggingface.co/rednote-hilab/dots.ocr)
         | 
| 21 | 
            +
            - **Number of Samples**: 10
         | 
| 22 | 
            +
            - **Processing Time**: 1.6 min
         | 
| 23 | 
            +
            - **Processing Date**: 2025-10-07 14:23 UTC
         | 
| 24 | 
            +
             | 
| 25 | 
            +
            ### Configuration
         | 
| 26 | 
            +
             | 
| 27 | 
            +
            - **Image Column**: `image`
         | 
| 28 | 
            +
            - **Output Column**: `markdown`
         | 
| 29 | 
            +
            - **Dataset Split**: `train`
         | 
| 30 | 
            +
            - **Batch Size**: 16
         | 
| 31 | 
            +
            - **Prompt Mode**: layout-all
         | 
| 32 | 
            +
            - **Max Model Length**: 8,192 tokens
         | 
| 33 | 
            +
            - **Max Output Tokens**: 8,192
         | 
| 34 | 
            +
            - **GPU Memory Utilization**: 80.0%
         | 
| 35 | 
            +
             | 
| 36 | 
            +
            ## Model Information
         | 
| 37 | 
            +
             | 
| 38 | 
            +
            DoTS.ocr is a compact multilingual document parsing model that excels at:
         | 
| 39 | 
            +
            - π **100+ Languages** - Multilingual document support
         | 
| 40 | 
            +
            - π **Table extraction** - Structured data recognition
         | 
| 41 | 
            +
            - π **Formulas** - Mathematical notation preservation
         | 
| 42 | 
            +
            - π **Layout-aware** - Reading order and structure preservation
         | 
| 43 | 
            +
            - β‘ **Fast inference** - 2-3x faster than native HF with vLLM
         | 
| 44 | 
            +
            - π― **Compact** - Only 1.7B parameters
         | 
| 45 | 
            +
             | 
| 46 | 
            +
            ## Dataset Structure
         | 
| 47 | 
            +
             | 
| 48 | 
            +
            The dataset contains all original columns plus:
         | 
| 49 | 
            +
            - `markdown`: The extracted text in markdown format
         | 
| 50 | 
            +
            - `inference_info`: JSON list tracking all OCR models applied to this dataset
         | 
| 51 | 
            +
             | 
| 52 | 
            +
            ## Usage
         | 
| 53 | 
            +
             | 
| 54 | 
            +
            ```python
         | 
| 55 | 
            +
            from datasets import load_dataset
         | 
| 56 | 
            +
            import json
         | 
| 57 | 
            +
             | 
| 58 | 
            +
            # Load the dataset
         | 
| 59 | 
            +
            dataset = load_dataset("{output_dataset_id}", split="train")
         | 
| 60 | 
            +
             | 
| 61 | 
            +
            # Access the markdown text
         | 
| 62 | 
            +
            for example in dataset:
         | 
| 63 | 
            +
                print(example["markdown"])
         | 
| 64 | 
            +
                break
         | 
| 65 | 
            +
             | 
| 66 | 
            +
            # View all OCR models applied to this dataset
         | 
| 67 | 
            +
            inference_info = json.loads(dataset[0]["inference_info"])
         | 
| 68 | 
            +
            for info in inference_info:
         | 
| 69 | 
            +
                print(f"Column: {info['column_name']} - Model: {info['model_id']}")
         | 
| 70 | 
            +
            ```
         | 
| 71 | 
            +
             | 
| 72 | 
            +
            ## Reproduction
         | 
| 73 | 
            +
             | 
| 74 | 
            +
            This dataset was generated using the [uv-scripts/ocr](https://huggingface.co/datasets/uv-scripts/ocr) DoTS OCR script:
         | 
| 75 | 
            +
             | 
| 76 | 
            +
            ```bash
         | 
| 77 | 
            +
            uv run https://huggingface.co/datasets/uv-scripts/ocr/raw/main/dots-ocr.py \
         | 
| 78 | 
            +
                NationalLibraryOfScotland/Scottish-School-Exam-Papers \
         | 
| 79 | 
            +
                <output-dataset> \
         | 
| 80 | 
            +
                --image-column image \
         | 
| 81 | 
            +
                --batch-size 16 \
         | 
| 82 | 
            +
                --prompt-mode layout-all \
         | 
| 83 | 
            +
                --max-model-len 8192 \
         | 
| 84 | 
            +
                --max-tokens 8192 \
         | 
| 85 | 
            +
                --gpu-memory-utilization 0.8
         | 
| 86 | 
            +
            ```
         | 
| 87 | 
            +
             | 
| 88 | 
            +
            ## Performance
         | 
| 89 | 
            +
             | 
| 90 | 
            +
            - **Processing Speed**: ~0.1 images/second
         | 
| 91 | 
            +
            - **GPU Configuration**: vLLM with 80% GPU memory utilization
         | 
| 92 | 
            +
             | 
| 93 | 
            +
            Generated with π€ [UV Scripts](https://huggingface.co/uv-scripts)
         | 
