Mova0.6 pre-release

the flag of Denmark 34. Danish in Mova

Mova has a multilingual parsing pipeline, but the Danish package has no parser model, no annotated corpus and no measured Universal Dependencies baseline. Language identification and grammatical annotation are separate stages. This chapter describes what each stage can provide for Danish, how the parser would be measured, and how Squid records grammar rules for future implementation.

Latin-script language identification and Danish coverage

tools/mova-parse runs in two levels. At level 1, tools/langseg assigns languages to sentences and spans. At level 2, tools/mova-parse uses the language assigned to each span to look up that span’s parser model. In a multilingual text, each span has its own lookup. A model found for one span applies only to that span.

For Latin script, tools/langseg distinguishes English and French using a Latin table, a lexicon for each language and a character 4-gram model. It also distinguishes Hebrew-script varieties and recognizes Hebrew or Aramaic in scholarly transliteration. Scripts outside the supported set are assigned other. This rule concerns script coverage. Danish uses the Latin script, so the unsupported-script rule does not determine the label for Danish text.

The Danish package uses the language code da. Extending Latin-script identification to Danish requires a Danish lexicon and support for Danish in Lang. The langseg latin-lexicon command builds a lexicon from an open UD training split. The package code identifies Danish, while the current Latin-script distinction covers English and French. The missing-Danish-model behavior applies when a span actually reaches level 2 with the label da. Grammatical annotation of such a span also requires a Danish parser model.

The Danish model and corpus inventory

ItemStatus in Mova
Danish level-2 parser modelAbsent
Annotated Danish corpus held by MovaNone
Measured Danish UD treebank baselineNone

The en crate supplies Mova’s tree parser and tagger. English and French have model files, en.bin and fr.bin. A span assigned da requires a Danish model because model selection follows the language assigned to the span. The specification in What every language gets calls for the same UD baseline procedure for every language, using that language’s training and development splits.

DaNE is an external annotated Danish resource that adds a named-entity layer to the Danish Dependency Treebank. The named-entity layer marks entities. The underlying dependency annotation supplies the syntactic heads and relation labels needed for attachment evaluation. A parser evaluation based on this resource uses the dependency layer as its reference. Mova holds no annotated Danish corpus. (Hvingelby et al. 2020, pp. 4597–4599)

UD provides a common framework for parts of speech, morphological features and typed syntactic dependencies. In the package inventory, the model is the trained artifact used to annotate spans, the corpus supplies annotated data for training and evaluation, and the baseline records scores obtained by comparing parser output with reference analyses. The availability of an external treebank establishes a potential data source. A measured baseline requires a trained model and an evaluation run. (de Marneffe et al. 2021, pp. 255–257)

Output when a Danish parser model is absent

When level 2 receives a span labeled da, there is no Danish model to apply. tools/mova-parse reports the missing model in the # parse comment. On the token rows for that span, it emits _ for each grammatical field listed below and records Parse=None in MISC.

FieldValue for a token in the spanInformation the field would carry
LEMMA_Lemma
UPOS_Universal part-of-speech tag
XPOS_Language-specific part-of-speech tag
FEATS_Morphological features
HEAD_Syntactic head
DEPREL_Dependency relation to the head
MISCParse=NoneStatus of the parse

Parse=None marks the missing parse on each affected row. In HEAD, _ leaves the head unspecified. A root assignment in a UD tree has HEAD set to 0. With DEPREL also set to _, the row supplies no dependency relation. Token rows can therefore be present without a Danish dependency tree. Danish-specific tokenization, tagging, lemmatization and parsing are unavailable in this case.

This behavior depends on the language label passed to level 2. In a mixed-language input with one span labeled da and another labeled en, the Danish rows carry Parse=None. If the English model is available for its span, the English rows can carry grammatical annotations in the same output.

Training and measuring a Universal Dependencies baseline

The package calls for a tree parser and tagger trained on a language’s UD training split and evaluated on its development split. A Danish run uses Danish data for both splits. en xpos-fill prepares the training split before en train. en parse-eval compares the trained parser’s output with the reference analyses in the development split.

StepCommandRole in the baseline
Prepare the training spliten xpos-fillPrepare the training split’s XPOS field before training
Trainen trainTrain a tree parser and tagger on the prepared UD training split
Evaluateen parse-evalMeasure UAS and LAS on the UD development split

Unlabeled attachment score (UAS) is the share of evaluated tokens whose predicted head matches the reference head. Labeled attachment score (LAS) is the share whose predicted head and dependency relation both match the reference. A correct relation label with the wrong head earns no credit for either score. The scores concern syntactic attachments. Lemma, part-of-speech and feature accuracy are separate measurements.

Consider an ordinary Danish transitive clause (constructed).

FormHunlæserbogen
Glosssheread.PRSbook.DEF.SG

‘She is reading the book.’

In a reference UD analysis, læser is the head of bogen, and the relation is obj. Predicting læser with obj counts toward both scores. Predicting læser with obl counts only toward UAS. Predicting hun with obj counts toward neither score. (de Marneffe et al. 2021, pp. 255–257)

Keep the development split separate from training. To make scores comparable, identify the treebank release, the evaluation split, the source of the token boundaries and the set of tokens counted by the evaluator. This includes whether punctuation is counted. Mova has no measured Danish baseline and reports no Danish UAS or LAS.

Squid's grammar claims and implementation queue

Squid reads the grammar manual and records grammatical points as claims. Claims that can be formalized enter its implementation queue. These include rules with conditions and exceptions, closed inventories and statistics. Queue membership records a claim for possible implementation. A claim affects runtime behavior once it is implemented.

A rule states the construction it applies to and the conditions that license its general pattern. When an exception applies, the claim also states what triggers the exception and what outcome it permits or requires. A closed inventory lists all its members and specifies the construction or annotation context in which the list is exhaustive. A statistic identifies the population, the counted unit and any conditions on inclusion. If the statistic is a proportion, its numerator and denominator need to be identifiable. Squid can record these claims for a language without a parser model.

For Danish, claims relevant to a tokenizer and tagger describe such matters as token boundaries, the categories assigned to tokens and the contexts for assigning feature values. For example, in the constructed clause Hun læser bogen, bogen is one written word, and its suffixed definite article is reflected in the word’s definiteness. This supplies a concrete example of a token boundary and a morphological distinction. The corresponding treebank analysis also needs to record the head and relation of bogen. The manual supplies grammatical claims and examples, and the annotated UD training split supplies instances for parser and tagger training. Danish grammar claims await implementation.

How Mova handles Danish trees, frames and pragmatics

At level 1, tools/mova-parse uses tools/langseg to assign languages to sentences and spans. For Latin script, the segmenter distinguishes English and French using a Latin table, lexicons and a character 4-gram model. The Danish package code is da. At level 2, tools/mova-parse uses each span’s assigned language to look up its model.

If a span reaches level 2 labeled da, tools/mova-parse reports the missing model in # parse. It puts _ in LEMMA, UPOS, XPOS, FEATS, HEAD and DEPREL, and records Parse=None in MISC. The rows supply no dependency tree for that span. Danish-specific tokenization, tagging, lemmatization and parsing are unavailable. Mova holds no annotated Danish corpus and has no measured Danish result for the procedure in What every language gets.

Mova’s frame, pragmatics and world components read English trees. A Danish span with Parse=None supplies no parsed Danish tree to these components, including prag and world. Squid records grammar points as claims and queues those that can be formalized. Danish claims in the queue await implementation.

Sources for this chapter

This page in Markdown https://md.mova.elamur.ai/free/en/docs/languages/da/34-danish-in-mova/