Dexter
Dexter is a framework that implements some popular algorithms and provides all the tools needed to develop any entity linking technique.
Install / Use
/learn @dexter/DexterREADME

The entity linking (aka Wikification) task aims at identifying all the small text fragments in a document referring to an entity contained in a given knowledge base, e.g., Wikipedia. The annotation is usually organized in three tasks:
- Given an input document the first task consists in discovering the fragments that could refer to an entity.
- Since a mention could refer to multiple entities, it is necessary to perform a disambiguation step, where the correct entity is selected tamong the candidates.
- Finally, discovered entities are ranked by some measure of relevance.
Many entity linking algorithms have been proposed, but unfortunately only a few authors have released the source code or some APIs. As a result, evaluating today the performance of a method on a single subtask, or comparing different techniques is difficult.
For these reasons we implemented Dexter, a framework that implements some popular algorithms and provides all the tools needed to develop any entity linking technique. We believe that a shared framework is fundamental to perform fair comparisons and improve the state of the art.
For more information about the team and the framework. please refer to the website.
A simple demo is also available on the website. The tagger used in the demo is our implemented version of TAGME, please note that some annotations could be different since the two frameworks use different Wikipedia dumps and different methods for extracting the spots.
Ok, but I don't have time to understand how things really work, I just want to use it
Hiha! just download the model with the binaries (model was generated from the English Wikipedia dump 07/07/2014):
wget http://hpc.isti.cnr.it/~ceccarelli/dexter2.tar.gz
tar -xvzf dexter2.tar.gz
cd dexter2
java -Xmx4000m -jar dexter-2.1.0.jar
And then visit on your browser the address http://localhost:8080/dexter-webapp/dev. It will show the available REST-API. Enjoy!
Actually I do have some time and I like compiling things.
Dexter's pom includes the json-wikipedia project as a project dependency. The first thing you need to do is make sure that this is also pulled to the project's root. To do this, just use a command like git pull --recurse-submodules to be sure that all dependencies are downloaded.
After that, a simple mvn package compiles the project. Note that the maven command line tool that comes bundled with some versions of linux (e.g. Ubuntu) has a problem fetching dependencies for org.apache.commons.lang. To avoid this error, just make sure that you have an updated version of maven (>= 3.0.5 would do).
Cool, I want to know more!
The following sections describe a bit more in detail how the framework works.
Developing
You can use Dexter in several different ways:
- Using the Rest API, after downloading the jar and its resources;
- Using the Java API;
- Jsonp API + JQuery plugin;
- Python Client.
Compiling and Installing
In order to install and compile Dexter just run the following commands:
Start a REST Server
Download the Resources
Click on this http://hpc.isti.cnr.it/~ceccarelli/dexter2.tar.gz for downloading Dexter.
The archive requires around 2.5 Gigabytes, and contains the Dexter binary code (''dexter2.1.0.jar'') and the model used by Dexter for annotating.
The current model is generated from the 07/07/2014 English Wikipedia dump, available http://dumps.wikimedia.org/enwiki/20140707/enwiki-20140707-pages-articles.xml.bz2. (we plan to release updated models for English and other languages).
Once the download is finished, untar the package, and from the directory ''dexter2'', just run
java -Xmx3000m -jar dexter-2.1.0.jar
(you will need at least 3G of ram and Java 7).
The framework should be available in few seconds at the address:
http://localhost:8080/
The REST-api is available at:
http://localhost:8080/dexter-webapp/dev
First query will take a bit because Dexter will have to load all the model in main memory.
Configuring Dexter
Dexter 2 is configured through an XML file dexter-conf.xml.
Don't worry, is not to hard to understand ;), by default Dexter
searches for the configuration file in the root directory.
Set the Dexter model
In the beginning of the file:
<models>
<default>en</default>
<model>
<name>en</name>
<path>FIXME</path>
</model>
<model>
<name>it</name>
<path>data/it</path>
</model>
</models>
replace the path in FIXME with the absolute or relative path to the folder that contains the dexter model. If you download
the model from the website, the folder is called en-model-20140707. Once you setup the folder just start the server running the command:
java -Xmx3000m -jar dexter-2.1.0.jar
Use the client
Once you performed the installation, you will have to add to your maven project the dependency:
<dependency>
<groupId>it.cnr.isti.hpc</groupId>
<artifactId>dexter-client</artifactId>
<version>2.1.0</version>
</dependency>
Then will be able to call the REST api from your have project using the DexterRestClient as in the following example:
DexterRestClient client = new DexterRestClient("http://localhost:8080/dexter-webapp/api/rest");
AnnotatedDocument ad = client
.annotate("Dexter is an American television drama series which debuted on Showtime on October 1, 2006. The series centers on Dexter Morgan (Michael C. Hall), a blood spatter pattern analyst for the fictional Miami Metro Police Department (based on the real life Miami-Dade Police Department) who also leads a secret life as a serial killer. Set in Miami, the show's first season was largely based on the novel Darkly Dreaming Dexter, the first of the Dexter series novels by Jeff Lindsay. It was adapted for television by screenwriter James Manos, Jr., who wrote the first episode. ");
System.out.println(ad);
SpottedDocument sd = client
.spot("Dexter is an American television drama series which debuted on Showtime on October 1, 2006. The series centers on Dexter Morgan (Michael C. Hall), a blood spatter pattern analyst for the fictional Miami Metro Police Department (based on the real life Miami-Dade Police Department) who also leads a secret life as a serial killer. Set in Miami, the show's first season was largely based on the novel Darkly Dreaming Dexter, the first of the Dexter series novels by Jeff Lindsay. It was adapted for television by screenwriter James Manos, Jr., who wrote the first episode. ");
System.out.println(sd);
ArticleDescription desc = client.getDesc(5981816);
System.out.println(desc);
If you have installed the code with mvn install, and run the server on your machine, you can create an instance of the client with the this address
DexterRestClient client = new DexterRestClient(
"http://localhost:8080/dexter-webapp/api/rest");
More details about the configuration file
The configuration file mainly contains details on the paths of the model files, and it allows to register plugin and to configure the tagger.
More in detail, it allows to register:
Spotters
The component that detects mentions in the text, and maps each mention to a list of candidate entities, you can register a spotter writing inside the <spotters>tag:
<spotters>
<default>wiki-dictionary</default>
<spotter>
<name>wiki-dictionary</name>
<class>it.cnr.isti.hpc.dexter.spotter.DictionarySpotter</class>
</spotter>
</spotters>
In this example, the standard dictionary spotter is registered with the name wiki-dictionary and set as default dictionary, you can also register other dictionaries, for example:
<spotters>
<default>wiki-dictionary</default>
<spotter>
<name>wiki-dictionary</name>
<class>it.cnr.isti.hpc.dexter.spotter.DictionarySpotter</class>
</spotter>
<spotter>
<name>my-dictionary</name>
<class>com.mycompany.Myspotter</class>
</spotter>
</spotters>
Here we registered a new spotter with the name my-dictionary. You can create a new spotter extending the abstract class AbstractSpotter and then adding it to the classpath of the dexter webapp (you can put the jar in the lib folder, or more easily, install the jar with maven and add the dependency in the dexter-webapp/pom.xml).
At runtime, the rest functions allow you to specify the spotter that you want to use with the parameter spt. If you don't specify the name of the spotter, default is used.
SpotFilters
A spot filter allows you to filter the mentions produced by the Spotter before they are sent to the Disambiguator. For example, if you would like to filter short spots, or spots with low probability etc etc, still you can write your filters or use the filters provided by Dexter. As for the spotter, filters must be registered and then you can use them in a spotter. For example:
<spotFilters>
<spotFilter>
<name>probability-filter</name>
<class>it.cnr.isti.hpc.dexter.spotter.filter.SpotProbabilityFilter</class>
<params>
<param>
<name>lp</name>
<value>0.02</value>
</param>
</params>
</spotFilter>
</spotFilters>
Registers a filter that removes mentions with low probability to be links to entities (note the parameter lp).
You could register two different filters:
<spotFilters>
<spotFilter>
<name>f0.02</name>
<class>it.cnr.isti.hpc.dexter.spotter.filter.SpotProbabilityFilter</class>
<params>
<param>
<name>lp</name>
<value>0.02</value>
</param>
</params>
</spotFilter>
<spotFilter>
<name>f0.5</name>
<class>it.cnr.is
Related Skills
node-connect
349.7kDiagnose OpenClaw node connection and pairing failures for Android, iOS, and macOS companion apps
frontend-design
109.7kCreate distinctive, production-grade frontend interfaces with high design quality. Use this skill when the user asks to build web components, pages, or applications. Generates creative, polished code that avoids generic AI aesthetics.
openai-whisper-api
349.7kTranscribe audio via OpenAI Audio Transcriptions API (Whisper).
qqbot-media
349.7kQQBot 富媒体收发能力。使用 <qqmedia> 标签,系统根据文件扩展名自动识别类型(图片/语音/视频/文件)。
