---
# System prepended metadata

title: Definition

---

# Definition

# Command line interface
## Inference mode
### Data input (requirements, but utility to generate it for Impresso)
- Input (Folder/stream directly)
  - Paths files (can be local or remote (http, etc.)) 
  - IIIF Links
  - TODO IIIF text representation
  - OCR
      1. Impresso-canonical
      2. ALTO
      3. PAGE
      4. hOCR
- Trained model
### Config
- Trained model configuration (required)
  - Model path
  - Type of embeddings -> model to generate embeddings
  - Merging options (word, line, paragraph, article, etc.)
  - Meta-informations -> Classes names
- Post processing configuration (optional + tdb.)
- Output (optional)
  - Path 
  - Format (tbd.)
      - VIA 
      - (-> JSON -> IIIF image api -> Compatibility with the viewer OpenSeadragon, Universal Viewer, Mirador)
      - Text output
### CLI interface
```predict --pages /path/to/root/pages --model-config /path/to/model/config [--post-process-config /path/to/config] --output-path /path/to/output [--output-format output_format]```
## Training mode
### Data input (requirements, but utility to generate it for Impreso)
- Input (Folder/stream directly)
  - Paths files (can be local or remote (http, etc.)) 
  - IIIF Links
  - TODO IIIF text representation
  - OCR
      1. Impresso-canonical
      2. ALTO
      3. PAGE
      4. hOCR
- Annotations
  - VIA format
  - BNL format METS-ALTO/ Impresso canonical
  - Other format ?
### Config
- Embeddings (can be no embeddings) (required)
  - Embeddings type 
    - Flair (can configure stacking): all flairs embeddings implementation (per language or multilingual)
    - Question of size of the embbeddings (Fasttext is large, so maybe not put it inside the vanilla config)
    - Custom embeddings -> python decorator
  - Embeddings merging level (word, line, paragraph, article, etc.)
- Config with sensible defaults (optional):
  - Train/test/dev sizes
  - Rebalancing of data (_None_, Downsample, Oversample)
  - Network parameter
    - Encoder-decoder (_Resnet50_)
    - Embeddings merging level
  - Training parameters
    - Number of epochs
    - Learning rate 
      - value
      - decay
    - Data augmentation
    - Resolution
  - Post-procesing (tbd.)
### CLI interface
```train --pages /path/to/root/pages --annotations /path/to/annotations [--config /path/to/config]```
