Git Product home page Git Product logo

summaclient's Introduction

summaClient

This JavaScript client implementation of the SUMMA API lets you integrate summaries from arbitrary SUMMA servers into your HTML documents.

It supports three modes:

  • SUMMA client This mode lets you retrieve a summary from a specific entity that will be attached to a predefined DIV element in your page.
  • qSUM This mode lets you annotate elements with the Internationalization Tag Set (ITS) property its-ta-ident-ref inside your HTML and summaries will be displayed as soon as you hover over the annotated elements.
  • ELES This mode combines qSUM with DBpedia Spotlight ITS annotations.

Demo

An integrated demo can be found at http://athalhammer.github.io/summaClient.

Use

Include the following lines in your HTML:

  • SUMMA client
<link rel="stylesheet" type="text/css" href="http://athalhammer.github.io/summaClient/css/summaClient.css" />
<script src="http://code.jquery.com/jquery-2.1.3.min.js"></script>
<script src="http://code.jquery.com/ui/1.11.4/jquery-ui.min.js"></script>
<script src="http://athalhammer.github.io/summaClient/js/summaClient.js"></script>
<script>
$(document).ready(function() {

	// define which element should contain a specific summary
	// parameters: entity, topK, language, fixed properties, (html) DIV-id, service
	summa("http://dbpedia.org/resource/Quentin_Tarantino", 5, "en",
		 "http://dbpedia.org/ontology/director,http://dbpedia.org/ontology/knownFor",
		 "pf-summary", "http://km.aifb.kit.edu/services/link/sum");
});
</script>
<!-- here is the element that should contain a specific summary -->
<div class="sum" id="pf-summary"></div>
  • qSUM
<link rel="stylesheet" type="text/css" href="http://athalhammer.github.io/summaClient/css/summaClient.css" />
<script src="http://code.jquery.com/jquery-2.1.3.min.js"></script>
<script src="http://code.jquery.com/ui/1.11.4/jquery-ui.js"></script>
<script src="http://athalhammer.github.io/summaClient/js/summaClient.js"></script>
<script>
$(document).ready(function() {

	// inline popups for annotated text
	// parameters: topK, language, fixed properties, service
	qSUM(5, "en", null, "http://km.aifb.kit.edu/services/link/sum");

});
</script>
The narrative sequence called "The Gold Watch" of 
<span its-ta-ident-ref="http://dbpedia.org/resource/Pulp_Fiction">Pulp Fiction</span>
ends with Butch picking up Fabienne with Zed's
<span its-ta-ident-ref="http://dbpedia.org/resource/Chopper_(motorcycle)">chopper</span>
  • ELES
<link rel="stylesheet" type="text/css" href="http://athalhammer.github.io/summaClient/css/summaClient.css" />
<script src="http://code.jquery.com/jquery-2.2.1.min.js"></script>
<script src="http://code.jquery.com/ui/1.11.4/jquery-ui.js"></script>
<script src="http://dbpedia-spotlight.github.io/demo/dbpedia-spotlight-0.3.js"></script>
<script src="http://athalhammer.github.io/summaClient/js/summaClient.js"></script>
<script>
$(document).ready(function() {
	// selector on HTML element(s)
	var select = ".annotate";

	// as soon as the annotations are ready, start registering mouseover events
	// parameters: topK, language, fixed properties, service
	$(select).bind("DOMSubtreeModified", function() {
	qSUM(5, "en", null, "http://km.aifb.kit.edu/services/link/sum");
	});

	// DBpedia Spotlight configuration and annotation
	var settings = { "endpoint" : "http://model.dbpedia-spotlight.org/en/", "its" : "yes", "spotter" : "Default" };
	$(select).annotate(settings);
	$(select).annotate("best");
});
</script>

<style>span{background-color:#AAAAAA}</style>
<div class="annotate">Angela Merkel is TIME Person of the Year 2015.</div>

As a matter of fact, you can download the above *.js files respectively and include them on your own server.

Summaries

You don't like the summaries of LinkSUM? Build your own ones by implementing the interface edu.kit.aifb.summa.Summarizer of https://github.com/athalhammer/summaServer.

License

This source code is dual-licensed under the MIT license and GPL v3.

summaclient's People

Contributors

athalhammer avatar jtren avatar

Stargazers

 avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

summaclient's Issues

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.