dbpedia-spotlight / demo

HTML and Javascript code to demonstrate DBpedia Spotlight's web service.
Apache License 2.0
12 stars 12 forks source link

ITS 2.0 output #5

Closed athalhammer closed 8 years ago

athalhammer commented 8 years ago

Hi,

I was searching for a way to get some text annotated in ITS 2.0 format with DBpedia Spotlight. I'm not sure if this is the location to add this but I got it running with some simple HTML:

<!DOCTYPE html>
<html><head><title>Example</title>
<style>span {background-color:#AAAAAA}</style>
<script src="http://code.jquery.com/jquery-2.2.1.min.js"></script>
<script src="http://athalhammer.github.io/demo/dbpedia-spotlight-0.3.js"></script>
<script>
$(document).ready(function() {
    var select = ".annotate";
    var settings = {
        "endpoint" : "http://spotlight.sztaki.hu:2222/rest",
        "spotter"  : "Default",
        "its"      : "yes"
    };
    $(select).annotate(settings);
    $(select).annotate("best");      
});
</script>
</head>
<body><div class="annotate">Angela Merkel is TIME Person of the Year 2015.</div></body>
</html>

Kind regards, Andreas

jodaiber commented 8 years ago

Hi Andreas,

looks good. This does not lead to regressions on the standard format etc? Only additional ITS output?

Jo

athalhammer commented 8 years ago

Hi Joachim,

The standard input remains unchanged (without "its" parameter, or set to "no"). Thanks for the merge :)

Andreas