Annotation for a list of items with arbitrary length

Hi there,

My name is Jackson and I am currently setting up my labeling platform with LabelStudio. Our goal is rate the annotation of a multi-page PDF and each annotation has a list of sub-annotations. The length of the annotation for each page is different (hence we cannot predefine a schema and it would not be the best user experience to display empty annotation). I have looked through list, paragraph and some of your examples but didn’t find any solution. In addition, some of the annotation span multiple pages (a huge bounding box) and I am not sure how to represent that other than maybe relations.

Any help will be greatly appreciated.

Hello Jackson,

You can treat your PDF as a series of images and then:

  1. Convert each PDF page to an image and load them as one task
  2. Use the Multi-Page Document Annotation pattern (<Image valueList> + pagination)
  3. Leverage region-level controls to capture a dynamic number of “sub-annotations” per region
  4. Use per-item controls (e.g. perItem="true") for page-level ratings
  5. Represent cross-page spans by drawing one box per page and linking them with <RelationLabels>

1. Task data (JSON)

{
  "data": {
    "pages": [
      "https://…/page1.jpg",
      "https://…/page2.jpg",
      "https://…/page3.jpg"
    ]
  }
}

2. Labeling config

<View>
  <!-- A. Page-level rating -->
  <Choices name="page_rating" toName="pdf" perItem="true">
    <Choice value="✔️ Good"/>
    <Choice value="❌ Needs work"/>
  </Choices>

  <!-- B. Draw annotations on each page -->
  <RectangleLabels name="labels" toName="pdf">
    <Label value="Section"/>
  </RectangleLabels>

  <!-- C. Sub-annotations for each region (dynamic count!) -->
  <TextArea name="sub_notes"
            toName="pdf"
            perRegion="true"
            placeholder="Add sub-annotation…"/>

  <!-- D. Multi-page pagination -->
  <Image valueList="$pages" name="pdf"/>
</View>
  • <Image valueList="$pages"> automatically adds next/prev controls and loops over your pages.
  • Users draw as many rectangles as needed on each page (no front-loaded empty fields).
  • Each rectangle spawns its own <TextArea perRegion> instance for unlimited “sub-annotations.”
  • Page ratings are handled by perItem="true" on <Choices> (or you can use <Rating> likewise).

3. Spanning annotations across pages
To mark a logical box that covers multiple pages:

  1. Draw one rectangle per relevant page.
  2. Add this tag to let annotators link those rectangles:
    <RelationLabels name="cross_page" toName="pdf" strokeWidth="2">
      <Label value="Continued from previous page"/>
    </RelationLabels>
    
  3. Annotators select two boxes (on different pages) and apply the “Continued…” relation.

Further information:

Thanks so much for getting back to me so quickly Max! That all makes sense and will proceed to implementation.