FN goes NIF: Integrating FrameNet in NIF

Vladimir Alexiev, Gerard Casamayor (Presenting: Neli Hateva)

Ontotext Corp, University Pompeu Fabra

Linked Data in Linguistics (LDL-2016). Portoroz, Slovenia, May 2016

2D interactive presentation: press O for overview, H for help.

Normal continuous HTML.

Github source & accompanying materials.

1 What is FrameNet

FrameNet (FN) is a large-scale linguistic resource for English developed at ICSI (UC Berkeley). Documents the syntactic and semantic combinations (valences) of predicative word senses:

  • Frames are conceptual situations along with their participants
    e.g. frame:Statement is an event in which a statement is made
  • Lexical Units (LU) are phrases or words that evoke frames
    e.g. lu:announce.v and lu:declare.v both evoke frame:Statement
  • Frame Elements (FE) are roles taken by participants in a frame: things, entities, times, places, etc
    e.g. fe:Speaker.statement, fe:Message.statement

1.1 Frames

Eg annotations of frame:Statement, lu:announce.v over varying phrases. Colors show different FE's

FN-annotation-colored.png

1.1.1 Frame Documentation

Frames are extensively documented. E.g. documentation for frame:Statement:

  • Definitions for each FE (classified as Core, Non-Core and Extra-Thematic)
  • "Coreness sets": which FE alternatives are required to realize the frame.
    • eg {Message, Topic}
    • and {Medium, Speaker}
  • Frame relations: inheritance, using, subframe, causative/inchoative, etc.
    • Similar toUML Use Case relations but richer.

1.1.2 Frame Relations

Visualization with FrameGrapher

FN-grapher.gif

1.1.3 Frame Relations

The figure for Statement shows that:

  • Statement is inherited by Complaining, Predicting, Reading_aloud, Recording, Reveal_secret, Telling (red arrows)
  • Statement uses Communication (green arrows)
  • Statement is used by Adducing, Attributed_information, Chatting, Judgment_communication, Renunciation, Unattributed_information (green arrows)
  • FE relations between Statement and Telling also shown
  • FE status: c (Core), nc (Non-Core)
    • Eg fe:Addressee.statement is nc: can make a statement without addressing anyone in particular
    • But fe:Addressee.telling is c: you have to tell someone.

1.2 SEMAFOR

  • Some softwares are available for automatic FN annotation
  • Used SEMAFOR to annotate sample sentence
    • Electrolux announced today the theme for its design competition
  • Candidate frames are generated from Dependency Parsing
  • Highlighted: frame:Statement
    • invoked by lu:announce.v
    • FEs Speaker, Time, Message

SEMAFOR-horizontal.png

1.2.1 SEMAFOR

May be easier to see the candidate frames in vertical layout

  • Each column is a frame

SEMAFOR-vertical.png

1.2.2 Candidate Frame Filtering

SEMAFOR returns JSON with candidate frames, LUs, FEs, and frame score

Frame Score
Statement 113.2
Competition 54.6
Coming_up_with 50.7
Calendric_unit 30.4
Topic 25.4
  • 2 top-scoring candidates (Statement and Competition) are the best frames
  • Coming_up_with is wrong ("design competition" is not creative "design")
  • Topic and Calendric_unit are parts of Statement

Filter candidate frames:

  • Order candidate frames by decreasing score
  • Repeat:
    • Add the highest scoring frame f
    • Discard any frames that are governed by f in the dependency tree

2 FN LOD

  • FN has been converted to RDF LOD by ISTC CNR (Italy)
  • Covers FrameNet metamodel (tbox) and frame definitions (abox)
  • Includes a corpus of sentences annotated with FN (fndata)

Impediments to real world use:

  • Complexity of the involved ontologies
  • There are two to choose from: fntbox and framenet
    • framenet is significantly more complex
    • Perhaps corresponds better to FN Book
    • But is not used in fndata so not considered further
    • See paper for links and diagram of framenet
  • Lack of overall picture how classes and properties fit together
  • Lack of adequate documentation for some ontology elements

2.1 FN LOD Documentation

FN LOD paper:

Many elements not documented, e.g. class fn:Header, data prop fn:frame_cBy

  • Can you guess that's ID of the person who created the frame?

We studied fndata and diagrammed classes and properties to understand them

  • fndata is very large
  • had to extract smaller connected fragments to understand them

2.2 fntbox Ontology

fntbox (terminology box) is the FN-LOD metamodel. OWLDoc documentation

  • Uses Restrictions extensively: easiest to understand in Manchester notation ./fntbox.omn
  • 16 Classes, 67 ObjectProperties, 49 DataProperties
  • Most relations have inverses, which hinders understanding the data hierarchy implied by the ontology

Prefixes (registered in prefix.cc):

prefix description
fn: FN metamodel (tbox)
frame: frame
fe: frame element
lu: lexical unit
st: semantic type

2.2.1 fntbox Diagram

Control-click for full size

fntbox-marks.png

2.2.2 fntbox Understanding (1A)

To understand fntbox consider the classes in two groups and navigate top-down.

(1) Text and annotations (FN and other linguistic info):

  • Header holds together all FullTextAnnotation and CorpDoc about the same frame.
  • FullTextAnnotation represents a mode of annotation where sentences are "preselected" by a given text.
  • CorpDoc is a corpus comprising of documents and sentences that are carefully chosen by lexicographers to illustrate the possible valences of LUs, i.e. make various frames for each sense of each LU.
  • Sentence holds the text being annotated and some identifying information.
  • AnnotationSet is a set of annotations about one frame. One sentence may have several frames and they may even overlap.

2.2.3 fntbox Understanding (1B)

Layer: subset of annotations with a single purpose, indicated in fn:layer_name.

Often used ones:

  • Target: LU that is target of the frame. Such layer has a single label.
  • FE: frame elements
  • PENN: part of speech (e.g. VBD, VVN, dt, nn)
  • PT: phrase type (e.g. NP, AJP, PP, PPing)
  • GF: grammatical function (e.g. Ext, Obj, Dep, Comp)
  • NER: named entity recognition (e.g. person, location)

2.2.4 fntbox Understanding (1C)

Label: word or phrase in an annotated Sentence

  • selected by index label_start, label_end

Can be:

  • LU instance: fn:label_name "Target", or
  • FE instance: fn:label_FE points to FE definition e.g. fe:Speaker.statement, or
  • Carries grammatical or POS tag in label_name, or
  • Indicates lexically omitted FE (FN book 3.2.3 Null instantiation): fn:label_itype "CNI", "DNI", etc

2.2.5 fntbox Understanding (2A)

(2) Frame definition:

  • Frame: abstracts over a real-world situation
    • Relations: Causative, Inchoative, Subframe, inherits, uses, precedes, perspectiveOn
  • LexUnit: head-word of a (sub)sentence, invokes the frame
    • SentenceCount: simple statistics to manage annotators work
  • Lexeme: linguistic representation of LU (a LU can have several)
  • Frame 7 LU point to AnnotationSets that attests them

2.2.6 fntbox Understanding (2B)

  • FrameElement: entity participating in a frame
    • Eg Things, actors, times, messages, etc
    • FE relations: excludes, requires, SubFE
    • FE_coreType: Core, Core-Unexpressed, Extra-Thematic, Peripheral
    • FECoreSet: set of alternative FEs, one must be present in the frame
  • SemType classifies elements, eg
    • for Frame: Non-perspectivalized_frame, Non-Lexical_Frame
    • for FE: Sentient (agent), Artifact, Message, State_of_affairs

2.3 fnabox Ontology

fnabox (assertion box) includes all frame definitions

  • Only individuals, not classes nor property definitions.
  • Had illegal local-name chars (spaces and parentheses): converted to underscores
    • e.g. lu:swing_(into).v -> lu:swing__into_.v
  • Converted to ./fnabox.ttl: more readable, all statements about an individual are together. Eg
frame:Statement
  fn:hasFrameElement fe:Time.statement, fe:Iteration.statement... ;
  fn:hasLexUnit lu:gloat.v, lu:explain.v, lu:declaration.n, lu:talk.v... ;
  fn:isInheritedBy frame:Telling, frame:Reveal_secret, frame:Recording... ;
  fn:isUsedBy frame:Unattributed_information, frame:Adducing... ;
  fn:uses frame:Communication .

Triples for a couple of the core FEs in that frame:

fe:Speaker.statement a fn:FrameElement ;
  fn:hasSemType st:Sentient ;
  fn:hasSuperFE fe:Speaker.speak_on_topic...
fe:Message.statement a fn:FrameElement ;
  fn:hasSemType st:Message ;
  fn:hasSuperFE fe:Message.encoding, fe:Message.communication...

2.4 fndata Dataset

fndata_v5: FN LOD annotations corpus

  • 3.8M triples
  • 540Mb of RDF/XML (292Mb Turtle, 1.03Gb NTriples)
  • 5946 sentences, 20361 frame instances (annotationSetFrame)
  • 3.4 frames per sentence
  • 640 triples per sentence, 45 triples per frame

2.4.1 fndata Sample

./iran_missile_sentence_52.ttl: all triples about iran_missile_fullTextAnnotation_sentence_52

  • sentence 3 of paragraph 10 of fullTextAnnotation corpus named "iran_missile":
  • This project was focused on the development of a longer ranged (150-200 km) and more heavily armed version of the Israeli Gabriel anti-ship missile (not as sometimes reported with the development of a ballistic missile based upon Israeli Jericho surface-to-surface missile technology).
  • 6 manually annotated frames: Gizmo, Bearing_arms, Cause_to_make_progress (twice), Project, Type
  • Gizmo is invoked by "surface-to-surface missile technology"
  • SEMAFOR reports these frames and a number of smaller frames (see next)
  • SEMAFOR misses Gizmo: it may have an older set of frame definitions

Crucial in allowing us to understand the structure of FN-LOD and the meaning of most fields

2.4.2 fndata Sample in SEMAFOR

SEMAFOR reported frames

fndata-sample-SEMAFOR.png

3 NIF

  • NLP Interchange Format (NIF), formerly nlp2rdf
  • Ontologies, specifications, software to exchange linguistic annotations as RDF/OWL
  • NIF core: text annotations, binding to text
  • Reuses and incorporates NLP vocabularies

"Payload" ontologies:

  • ITS and NERD: Named Entity Recognition (NER): individuals and classes
  • OLIA: tagsets of various types of NLP tools (Penn POS, Stanford dependency parse, etc)
  • MARL: sentiment/opinion

Links:

3.1 NIF Core Schema

NIF-schema.png

4 Comparing FN-LOD to NIF

  • The FN-LOD and NIF models are very dis-similar
  • How to put them together?
  • Start with a comparison between the two

4.1 Text Framing

Document:

  • Document is the basic correspondence level: fn:Document vs nif:Context
  • Text is stored in fn:text vs nif:isString

Above document:

  • FN-LOD has fn:CorpDoc or fn:FullTextAnnotation (two kinds of corpora).
  • NIF uses nif:broaderContext to point to higher-level contexts

Below document:

  • FN-LOD: fn:Sentence is the basic level, then fn:AnnotationSet, fn:Layer, fn:Label
  • NIF: generic class nif:Structure, subclasses Paragraph, Sentence, Phrase, Word…
  • Char offsets: fn:Label: label_start, label_end vs nif:String: beginIndex, endIndex

4.2 Text Links

NIF links:

  • Every String (Paragraph, Sentence, Phrase…) points to enclosing context (referenceContext)
  • subString (inv superString) points uniformly from higher level texts to lower level texts
  • word (inv nif:sentence): from sentence down to its words (not declared sub-prop of subString?)
  • Chains: sentences (previousSentence inv nextSentence), words (previousWord inv nextWord)
  • From sentence to firstWord and lastWord

FN-LOD: non-uniform treatment of links:

  • from Sentence to its strings (Label): must follow property path
  • sentenceInDocument/annoForSentence/hasLayer/hasLabel

4.3 Text Nodes

Most significant difference between FN-LOD and NIF.

FN-LOD:

  • Defines Labels "as needed" by linguistic annotation, and locally
  • Several Label nodes can point to the same piece of text (offsets in the document)
  • Labels are not shared between different annotations (NLP features)
  • No recommendation about text node URLs

NIF:

  • Defines Strings for every word and sentence of the document, globally.
  • Each piece of text is represented by one node
    • (But Words overlap Phrases, Phrases overlap Sentences)
  • Recommends RFC5147 URLs based on char offset, eg
    <#char=282,253> a nif:Phrase; nif:beginIndex 282; nif:endIndex 253;
      nif:referenceContext <#char=0,2353>. # whole text
    
  • Ensures interoperability: different NLP tools emit triples against the same nodes, so triples "mesh" together

5 Integrating FN-LOD in NIF

  • The FN-LOD and NIF models for representing annotated text are totally different
  • Principle: represent minimum possible FN nodes, point to them using nif:String.oliaLink

Multisensor relies on a dependency parse of the sentence. Assume:

  • head is a head-word that governs word1..N
  • head corresponds to lexUnit that invokes frame
  • frame has elements frameElement1..N, corresponding to word1..N
  • (for illustration) frame has a lexically omitted FE frameElementN+1 of type CNI (constructional null instantiation)

Note: same model works without dependency parse, if you have some other way of discovering FEs

5.1 Diagram of FN-LOD in NIF

fn-nif.png

5.2 Understanding FN-LOD in NIF (1)

Think of fn:AnnotationSet as frame instance and of fn:Label as FE instance. 3 tiers:

  1. NIF has word offset info, dependency tree from head to word1..N (not shown).
    • nif:dependency or specific sub-props are used for that tree
    • eg MS uses upf-deep:deepDependency
  2. Frame instance connects nif:Words to fn:AnnotationSet thus frame
  3. Frame definition is defined in fnabox ontology

5.3 Understanding FN-LOD in NIF (2)

  • Skipped fe:label_start/end, they duplicate nif:begin/endIndex
  • Same word can participate in several frames (as LU or FE): will have multiple nif:oliaLink
  • labelN+1 is lexically omitted FE (of type CNI) with no corresponding NIF node
  • Nodes labelLU and layerLU are redundant, carry no information (except the fixed string "Target").
    • Indirect path fn:hasLayer/fn:hasLabel is even "harmful": it causes head to have two nif:oliaLink, which could be confusing
    • Included these redundant nodes to be faithful to fntbox ontology, but they can safely be omitted
  • Links of label1..N+1 are not redundant:
    • fn:hasLabel ties the frame instance together
    • fn:label_FE points to specific FE in the frame definition

5.4 Querying FN-NIF

  • FN-LOD in NIF involves a fairly complex graph structure
  • We show a few queries to extract data from that graph
  • We use SPARQL property paths liberally, including inverses ^
  • We indicate the input parameter of a query with $
  • Don't bother to check intermediate node types: rely that specific FN properties occur only on appropriate nodes

5.4.1 Find Frame and LU corresponding to a head-word

  • Find frame and LU of head-word $head (if it has a frame):
select * {
  $head nif:oliaLink ?annoSet.
  ?annoSet fn:annotationSetLU ?lu;
    fn:annotationSetFrame ?frame}

Could also use the round-about path:

select * {
  $head nif:oliaLink [
    fn:label_name "Target";
   ^fn:hasLabel/^fn:hasLayer ?annoSet.
  ?annoSet fn:annotationSetLU ?lu;
    fn:annotationSetFrame ?frame]}

5.4.2 Get all FE and constituents of a head-word

  • Find all FEs and constituent words of head-word $head:
select ?fe ?word ?itype {
  # Find the ?annoSet and ?frame
  $head nif:oliaLink ?annoSet.
  ?annoSet fn:annotationSetFrame ?frame.
  # Get all ?fe, ?label, (optionally) ?word
  ?frame fn:hasFrameElement ?fe.
  ?annoSet fn:hasLayer/fn:hasLabel ?label.
  ?label fn:label_FE ?fe.
  optional {?word nif:oliaLink ?label}
  optional {?label fn:label_itype ?itype}}

5.4.3 Find all frames of a sentence

  • Usually nif:word is used to point out the words of a sentence
    • (Also practice in Multisensor)
  • Find annotation sets and frames of $sentence:
select * {
  $sentence nif:word/nif:oliaLink ?annoSet.
  ?annoSet fn:annotationSetFrame ?frame}

5.4.4 Find all frames of complete text

  • NIF mandates that nif:referenceContext is used to connect each word to the complete text
  • Find all frames of $context (a nif:Context):
select * {
  $context ^nif:referenceContext/ nif:oliaLink ?annoSet.
  ?annoSet fn:annotationSetFrame ?frame}

6 Examples

6.1 Stylized Example

  • Electrolux announced today the theme for its design competition
  • 3 of 5 candidate frames shown (Statement, Topic, Competition)
  • Elided for simplicity: Label, Layer, AnnotationSet

FN-NIF-example.png

6.2 Actual Example (1)

  • 42% of this cost - some $183b - is the annual direct medical and extended care expenses

Control-click for full size

MS-Frame-complex-part1.png

6.3 Actual Example (2)

  • 12 frames
  • in addition to FN frames, includes fe-upf:Linguistic_situation to connect the graph

Control-click for full size

MS-Frame-complex-part2.png

7 Future Work, Acknowledgements

Representing Confidence. Candidates:

RDF Shapes:

  • This work is not an ontology but an application profile, data pattern or RDF Shape
  • W3C RDF Shapes working group is close to defining standards for data shapes
    • ShEx is more concise
    • SHACL is more formal and near standardization

Acknowledgements:

  • This work is part of MultiSensor (EC FP7 610411)
  • 4 anonymous referees made useful suggestions for improving the article
  • Diagrams are made with PlantUML and rdfpuml