Back to portfolio

NifWrapper

Python package for handling the NLP Interchange Format (NIF)
September, 2019 #entity-linking#nif#python#rdf#nlp

Overview

NifWrapper is a Python library that makes it practical to work with the NLP Interchange Format (NIF) — an RDF-based vocabulary for representing text annotations such as named entities, mentions and links to knowledge bases like DBpedia or Wikidata. NIF is the de-facto interchange format in the Entity Linking community, but its RDF nature means that even simple operations (load a document, list its mentions, filter by surface form) require boilerplate code using a triple store API.

The package wraps that complexity behind a small, Pythonic API and is available on PyPI.

Technical design

Why it matters

Reading and writing NIF correctly is surprisingly error-prone — offset semantics, URI minting, the difference between a context and a mention, and the multiple prefixes (nif:, itsrdf:) all conspire against quick iteration. NifWrapper consolidates the conventions that emerged from Fine-Grained Entity Linking, VoxEL and the NIFify tool into a single dependency so other researchers can focus on their algorithms instead of on RDF plumbing.

Related publications

  1. Rosales-Méndez, H.; Hogan, A.; Poblete, B. Fine-Grained Entity Linking. Journal of Web Semantics, 2020. doi
  2. Rosales-Méndez, H.; Hogan, A.; Poblete, B. NIFify: Towards Better Quality Entity Linking Datasets. LA-WEB 2019.
  3. Rosales-Méndez, H.; Hogan, A.; Poblete, B. VoxEL: A Benchmark Dataset for Multilingual Entity Linking. ISWC 2018.
View on PyPI