Public-Eye
A lot of named entity disambiguation services, like dpedia spotlight, are now available on the web. They all expose a solid REST api and they all disambiguate on top of DBpedia resources. They have different output formats, though, and this is where Public-Eye comes in handy. Public-Eye is a tiny open source library that aims to harmonize the different annotation results and gives you access to language detection automatically thanks to the awesome languagedetect library.
// minimalistic example with spotlight var publicEye = ;var text = 'First documented in the 13th century, Berlin was the capital of the Kingdom of Prussia (1701–1918), the German Empire (1871–1918), the Weimar Republic (1919–33) and the Third Reich (1933–45). Berlin in the 1920s was the third largest municipality in the world. After World War II, the city became divided into East Berlin -- the capital of East Germany -- and West Berlin, a West German exclave surrounded by the Berlin Wall from 1961–89. Following German reunification in 1990, the city regained its status as the capital of Germany, hosting 147 foreign embassies.'; publicEye;
This tiny library gives you easy access to a number of named entity disambiguation services, including dpedia spotlight, Babelfy and Textrazor. We have just added a basic service for local stanfordNER via the ner node library. The public-eye "mapping service" translates each proprietary format to a common format; this means you can annotate text using multiple services.
Installation
npm install public-eye --save
simple examples and configuration hints
More example are provided in the /test
folder.
The very first thing to do is to require the library and correctly set apikeys provided by the different services:
var publicEye =services:textrazor:apiKey: 'your-api-key'babelfy:key: 'your-babelfy-api-key';
Once the library is available to your script, the easiset way to uniform and harmonize different services on the same text is using the series
method:
publicEye
The usage type for textrazor entity disambiguation:
var publicEye =services:textrazor:apiKey: 'your-api-key';// ..publicEye
Usage type for babelfy:
var publicEye =services:babelfy:key: 'your-api-key';// ..publicEye
Usage type for StanfordNER, cfr. ner node library documentation:
var publicEye = services: stanfordNER: port: 9191 host: 'localhost' ; publicEye;
Usage type for geonames search:
var publicEye = services: geonames: username: 'your-username' ; publicEye;
More services to come, stay tuned!