Skip to main content

NAF (NLP Annotation Format)

Overview

NAF is a layered stand-off annotation format designed for NLP pipeline interoperability. It organizes annotations into explicitly named layers (text, terms, entities, chunks, dependencies, constituency, SRL, coreference, opinions, temporal expressions, factuality, etc.). NAF was developed as a successor to KAF (Kyoto Annotation Format) and is used in tools like the NewsReader pipeline.

Layer-by-Layer Mapping

Text Layer

NAF ElementLayers EquivalentNotes
<text> layerpub.layers.expression.textRaw text.
<wf> (word form)pub.layers.expression (kind: token)Tokens with character offsets. @offsettoken.textSpan.start; @length → derived from text; @sent → sentence grouping.

Terms Layer

NAF ElementLayers EquivalentNotes
<terms> layerpub.layers.annotation#annotationLayer(kind="token-tag")Term-level annotations.
<term>Multiple annotation objects across layersNAF's <term> bundles POS, lemma, morphology, and sense into a single element. Layers separates these into distinct annotation layers: subkind="pos" for @pos, subkind="lemma" for @lemma, subkind="morph" for @morphofeat, subkind="sense" for <externalRef>.
<term @pos>annotationLayer(kind="token-tag", subkind="pos")POS tag.
<term @lemma>annotationLayer(kind="token-tag", subkind="lemma")Lemma.
<term @morphofeat>annotationLayer(kind="token-tag", subkind="morph")Morphological features.
<term><sentiment>annotationLayer(kind="token-tag", subkind="sentiment") or featuresTerm-level sentiment.
<span> (within term)annotation.anchor.tokenRefSequenceMulti-word terms spanning multiple word forms.

Entity Layer

NAF ElementLayers EquivalentNotes
<entities> layerannotationLayer(kind="span", subkind="entity-mention")Entity mention layer.
<entity @type>annotation.labelEntity type (PER, ORG, LOC, etc.).
<references><span>annotation.anchor.tokenRefSequenceToken references for entity span.
<externalRef>annotation.knowledgeRefsLinks to DBpedia, Wikipedia, etc. @resourceknowledgeRef.source; @referenceknowledgeRef.identifier.

Dependency Layer

NAF ElementLayers EquivalentNotes
<deps> layerannotationLayer(kind="graph", subkind="dependency")Dependency parse.
<dep @rfunc>annotation.labelDependency relation label.
<dep @from @to>annotation.headIndex / annotation.tokenIndexGovernor and dependent.

Constituency Layer

NAF ElementLayers EquivalentNotes
<constituency> layerannotationLayer(kind="tree", subkind="constituency")Constituency parse.
<tree>One parse tree per sentenceTree structure.
<nt @label> (non-terminal)annotation with parentId/childIdsNon-terminal node. @labelannotation.label.
<t> (terminal)annotation with tokenIndexTerminal node linked to token.
<edge>Implicit in parentId/childIds relationshipsTree edges encoded in parent-child structure.

Chunk Layer

NAF ElementLayers EquivalentNotes
<chunks> layerannotationLayer(kind="token-tag", subkind="chunk") or annotationLayer(kind="span")Chunking.
<chunk @phrase>annotation.labelChunk type (NP, VP, PP, etc.).

SRL Layer

NAF ElementLayers EquivalentNotes
<srl> layerannotationLayer(kind="span", subkind="frame")Semantic role labeling.
<predicate>annotation (frame instance)@uriannotation.knowledgeRefs (PropBank/NomBank).
<role @semRole>argumentRef.roleSemantic role label (ARG0, ARG1, ARGM-TMP, etc.).
<role><span>argumentRef.annotationId → span annotationThe span filling the role.

Coreference Layer

NAF ElementLayers EquivalentNotes
<coreferences> layerpub.layers.annotation#clusterSet(kind="coreference")Coreference chains.
<coref>clusterA coreference chain. @typecluster.features.
<span> (within coref)cluster.memberIds → annotation UUIDsMentions in the chain.

Opinion Layer

NAF ElementLayers EquivalentNotes
<opinions> layerannotationLayer(kind="span", subkind="sentiment")Opinion/sentiment annotation.
<opinion>annotationOpinion instance.
<opinion_holder>argumentRef with role="holder"The opinion holder.
<opinion_target>argumentRef with role="target"The opinion target.
<opinion_expression @polarity>annotation.label (polarity) + anchorThe evaluative expression.

Temporal Expression Layer

NAF ElementLayers EquivalentNotes
<timeExpressions> layerannotationLayer(kind="span", subkind="temporal-expression")TimeML TIMEX3 expressions.
<timex3 @type @value>annotation.label (type) + annotation.value (normalized)@type → label (DATE, TIME, DURATION, SET); @value → normalized value.

Factuality Layer

NAF ElementLayers EquivalentNotes
<factualities> layerannotationLayer(kind="span") with custom subkind via subkindUriFactuality assessment (certain, probable, possible, counterfactual).
<factuality @prediction>annotation.labelFactuality value.

NAF Header and Provenance

NAF FeatureLayers EquivalentNotes
<nafHeader>pub.layers.expression metadata + featuresDocument metadata.
<linguisticProcessors>pub.layers.defs#annotationMetadata.tool per layerEach layer records its producing tool.
<lp @name @version @timestamp>annotationMetadata fieldsTool name, version, and timestamp.
<fileDesc>Expression fieldsFile description.
<public>Expression sourceUrlPublic identifier/URI.