--- language: - nn - no license: apache-2.0 library_name: transformers tags: - norwegian - nynorsk - morphology - normform - text2text-generation pipeline_tag: text-generation --- # NormForm Nynorsk Two-Task Model (`NbAiLab/normform-nynorsk-multitask`) > **Experimental Release (`v0.1`)**: Part of the [NormForm](https://github.com/NationalLibraryOfNorway/normform) toolkit for context-aware Norwegian morphological standardization, alternative generation, and sub-norm consistency auditing. This two-task `T5Gemma2` sequence-to-sequence model handles: 1. **`create_morphological_alternatives:`** — Expands Norwegian Nynorsk sentences into contextually valid `[alt1|alt2]` morphological alternative lattices while preserving all non-alternative text byte-for-byte. 2. **`skriv_i_samme_morfologiske_stil:`** — Resolves `[alt1|alt2]` morphological lattices into a consistent target sub-norm style conditioned on steering prompt words. ## Quick Start with `normform` Install the [`normform`](https://pypi.org/project/normform/) package (which wraps this model with strict `Template.align` lattice validation and the official reviewed [`NbAiLab/normform-nynorsk-nasjonalbiblioteknorm`](https://huggingface.co/datasets/NbAiLab/normform-nynorsk-nasjonalbiblioteknorm) style cache): ```bash pip install normform # Standardize Nynorsk text using Nasjonalbiblioteknorm: normform standardize -t "Me ønskjer å bruke den første søndagen til å gjere dette." --lang nno --style nasjonalbiblioteknorm # -> Vi ynskjer å bruka den fyrste sundagen til å gjera dette. # Generate [alt1|alt2] morphological alternative brackets: normform alternatives -t "Me ønskjer å bruke den første søndagen." --lang nno # Audit a document for internal sub-norm inconsistencies: normform audit -i manuscript_nno.txt --lang nno --raw ``` ### Python API ```python from normform import Standardizer std = Standardizer(lang="nno", style="nasjonalbiblioteknorm") print(std("Me ønskjer å bruke den første søndagen til å gjere dette.")) # -> "Vi ynskjer å bruka den fyrste sundagen til å gjera dette." ``` ## Model Provenance - **Selected Checkpoint**: `checkpoint-19052` from the pinned Nynorsk two-task training run (training manifest SHA-256: `bda1108ce308f19811dc040f44c8ad8f127a673c74524c1103c8151059b2282b`). - **Validation & Test Scores**: Constrained validation score `0.967486`; constrained sealed-test score `0.963089` (see `normform_provenance.json` for full checksums). - **Official Companion Style Cache**: [`NbAiLab/normform-nynorsk-nasjonalbiblioteknorm`](https://huggingface.co/datasets/NbAiLab/normform-nynorsk-nasjonalbiblioteknorm)