Model reference · open weights
trocr-handwritten-hist-swe-2 is an open-weight language model from Riksarkivet, listed in the AxForge catalogue. AxForge can bring it up on EU-owned hardware for you on request — with the licence handled where one is required.
About
Swedish Lion Libre An HTR model for historical Swedish developed by the Swedish National Archives in collaboration with the Stockholm City Archives, the Finnish National Archives and Jämtlands Fornskriftsällskap. The model is trained on Swedish handwriting from the period 1600-1900. Model Details Model Description - Developed by: The Swedish National Archives - Model type: TrOCR base handwritten - Language(s) (NLP): Historical Swedish handwriting - License: apache-2.0 - Finetuned from model: trocr-base-handwritten Uses The model is trained on Swedish running-text handwriting dating from the start of the 17th century to the end of the 19th century. Like most current HTR models it operates on a text-line level, so its intended use is within an HTR pipeline that segments the text into text lines, which are transcribed by the model. Direct Use The model can be used without fine-tuning on all handwriting but performs best on the type of handwriting it was trained on, which is Swedish handwriting from 1600-1900. See below for detailed test and evaluation results. Downstream Use The model can be fine-tuned on other types of handwriting, or if you plan to use it to transcribe some specific material that is within it's domain but not included in the training data, for instance if you got a large letter collection dating from the 17th century, it can be fine-tuned on a small amount of manually transcribed in-domain data, say 20-50 letters, and then used to transcribe the entire collection. Out-of-Scope Use The model won't work well out-of-the-box for other languages than Swedish, and it won't work well for printed text. How to Get Started with the Model Use the code below to get started with the model, but bear in mind that the image has to be a single text line. If you want to transcribe entire pages, consider using HTRflow, a package developed by the Swedish National Archives and intended for streamlining large and small scale HTR/OCR-projects. Install the package, write a pipeline config yaml, where you specify the models to use by their huggingface id, add preprocessing or post-processing steps, and then run the pipeline with htrflow pipeline <path/to/yaml <path/to/im
Summarised from the published model card. Read the full card on the HuggingFace links below.
Specifications
| Maker | Riksarkivet |
|---|---|
| Type | Language models |
| Parameters (lead) | 385M |
| Variants | 1 |
| Runs with | htrflow |
| Based on | microsoft/trocr-base-handwritten |
| Released | 2024-08-15 |
| Popularity | 54k downloads / month |
| Likes | 16 |
| Licence | Open weights |
How it works
Variants
Open weights ship in several sizes and precisions. One page, all the variants — pick the one that fits your GPU. VRAM figures are estimates from model size.
| Variant | Params | Precision | VRAM | Fits 16 GB | Weights |
|---|---|---|---|---|---|
| trocr-base-handwritten-hist-swe-2 | 385M | BF16 | ~0.9 GB | ✓ | Weights ↗ |
Using it via the API
Once AxForge deploys trocr-handwritten-hist-swe-2 for you, it answers on the OpenAI-compatible API — the same base URL and keys as every other model. (trocr-handwritten-hist-swe-2 below is illustrative; you get the exact model name on deployment.)
$ curl -sS https://api.axforge.ai/v1/chat/completions \
-H "Authorization: Bearer $AXFORGE_API_KEY" \
-H "Content-Type: application/json" \
-d '{"model":"trocr-handwritten-hist-swe-2","messages":[{"role":"user","content":"Hello"}]}'
Licence
Open weights under apache-2.0 — commercial use is permitted. Deploy it on AxForge EU hardware on request. Read the licence ↗