Label Sets
Label Sets
This guide covers creating, managing, and using label sets to define document structure for your annotations in the editor.
Understanding Label Sets
Label sets define the document structure for annotations, specifying how regions are categorized within the editor and exported in XML format.
What Are Labels?
Labels are structural classifications that you apply to regions in the editor. They define the semantic type of each annotated region.
Label Sets vs Tag Sets
| Aspect | Label Sets | Tag Sets |
|---|---|---|
| Location | Editor (annotation regions) | Dashboard (Projects, Pages) |
| Purpose | Define document structure | Organize projects/pages |
| Applied To | Annotation regions | Projects, Pages |
| Example | <TextRegion>, <IllustrationRegion> | "Important", "Urgent", "Review" |
When to Use Labels
- Classifying regions by semantic type (text, illustration, etc.)
- Defining document structure for XML export
- Creating ground truth for machine learning
- Preparing data for OCR correction
- Structured metadata for digital archives
Supported Formats
PAGE (Page Analysis and Ground-Truth Elements)
LAREX primarily uses the PAGE XML format for annotations:
<pc:Pagina xmlns:pc="http://schema.primaresearch.org/PAGE/gts/pagecontent/2019-07-15">
<pc:Page imageFilename="page001.jpg">
<pc:PrintSpace>
<pc:TextRegion type="paragraph">
<pc:TextLine>
<pc:Word>
<pc:Unicode>Sample</pc:Unicode>
</pc:Word>
</pc:TextLine>
</pc:TextRegion>
<pc:IllustrationRegion>
<pc:Coords points="100,100;200,100;200,200;100,200"/>
</pc:IllustrationRegion>
</pc:PrintSpace>
</pc:Page>
</pc:Pagina>
ALTO Compatibility
ALTO (Analysis and Layout Tool) export is planned for future implementation:
- Currently under development
- Will support ALTO 4.0 format
- Will include conversion from PAGE labels
Accessing Label Sets
From the Library
- Navigate to the Library
- Open the sidebar
- Click Label Sets
From Project Settings
- Open project settings
- Navigate to Label Set section
- Select or create label set
From the Editor
- Open a project in the editor
- Select a region
- In the Properties panel, use the Label dropdown
Creating Label Sets
Creating a New Label Set
- Click Create Label Set
- Enter a name
- Optional: Add description
- Click Create
Label Set Properties
| Property | Description |
|---|---|
| Name | Label set name |
| Description | Purpose of the label set |
Label Set Components
| Component | Description |
|---|---|
| Region Types | Types of regions to define |
| Attributes | XML attributes for elements |
Managing Labels
Adding Labels
- Open the label set for editing
- Click Add Label
- Configure label properties:
- Name: Label identifier
- Display Name: Shown in editor UI
- Description: Human-readable description
- Color: Editor highlight color
- Click Save
Label Properties
| Property | Description |
|---|---|
| Name | Label identifier |
| Display Name | Shown in editor UI |
| Description | Usage notes |
| Color | Editor highlight color |
Common Label Types
PAGE Region Types
| Label | Description |
|---|---|
| TextRegion | Region containing text |
| IllustrationRegion | Image or graphic |
| TableRegion | Tabular content |
| SeparatorRegion | Divider, line |
| ChartRegion | Graph or chart |
| ChemRegion | Chemical formula |
| MusicRegion | Musical notation |
| MapRegion | Map or geographic content |
| TextBox | Non-text box element |
| Word | Individual word (optional) |
| Glyph | Individual glyph (optional) |
| Grapheme | Grapheme cluster (optional) |
Editing Labels
- Find the label in the label set
- Click the edit icon
- Modify properties
- Click Save
Deleting Labels
- Find the label in the label set
- Click the delete icon
- Confirm deletion
Applying Labels to Regions
Selecting Labels
- Select one or more regions in the editor
- Open the Label Selector in the Properties panel
- Select a label type
- Label is applied to regions
Label Display
| Element | Description |
|---|---|
| Highlight | Color-coded region outline |
| Tooltip | Label name on hover |
| Properties Panel | Current label shown |
Changing Labels
- Select region with existing label
- In Properties panel, select new label
- Label is updated
Bulk Label Application
- Select multiple regions
- Open Label Selector
- Select label
- Apply to all selected
Output Configuration
Export Settings
Configure XML export:
| Setting | Description |
|---|---|
| Namespace | XML namespace for elements |
| Attributes | Include custom attributes |
| Encoding | Character encoding (UTF-8) |
Custom Attributes
Add custom attributes to elements:
- Open label properties
- Navigate to Attributes tab
- Add attribute:
- Name: Attribute name
- Value: Fixed or variable
- Save attribute
Output Preview
Preview XML output:
- Click Preview tab
- Select a region
- View XML representation
Best Practices
Label Naming
- Use Standard Names: Follow PAGE format conventions
- Be Consistent: Same naming across label sets
- Be Descriptive: Clear, meaningful names
- Avoid Spaces: Use underscores or camelCase
Structure Design
| Guideline | Description |
|---|---|
| Standard Types | Use established PAGE labels |
| Minimal Depth | Avoid unnecessary nesting |
| Document Purpose | Match to use case |
PAGE Best Practices
- Use standard PAGE region types
- Include required attributes (ID, type)
- Define coordinates accurately
- Set reading order via reading order tool
Troubleshooting
Labels Not Exporting
Problem: Labels don't appear in XML output
Solutions:
- Verify label set is assigned to project
- Check label mapping in export settings
- Ensure regions have labels assigned
Invalid XML Output
Problem: Export produces invalid XML
Solutions:
- Check for special characters in text
- Verify namespace declarations
- Validate against PAGE schema
Missing Labels
Problem: Can't find label in selector
Solutions:
- Check if label exists in label set
- Verify label set is active
- Refresh editor view
Keyboard Shortcuts
| Shortcut | Action |
|---|---|
L | Open label selector |
Ctrl + L | Apply last label |
Esc | Close label selector |
Next Steps
- Tag Sets - Organize projects and pages
- Annotation Tools - Create and edit regions
- Editor Interface - Editor overview