The keyphrase extraction comes in various deployments:
The following documents how to use the Java API and DBus implementation.
For general usage of the keyphrase extraction as GATE plugin please refer to the dedicated page.
This program constitutes the functionality of a keyword/keyphrase extraction algorithm for the English language, and can be embedded into Java applications.
It is able to extract keywords/keyphrases from textual sources (given as string) and document formats {pdf,doc,txt} , given as URL to the respective document.
It provides a Map
$> java -Dgate.home=path/to/gate/dir -jar younameyour.jar
System.setProperty("gate.home","path/to/gate/dir");
KeywordExtraction kex = new KeywordExtractionImpl();
KeywordExtraction kex = new KeywordExtractionImpl();
Map kwMap = kex.getKeywordsFromText("This sentence is not sufficiently long to produce meaningful keyphrases, if at all.");
KeywordExtraction kex = new KeywordExtractionImpl();
Map kwMap = kex.getKeywordsFromUrl(documentUrl);
This program constitutes the functionality of a keyword/keyphrase extraction algorithm for the english language, running as a service on the DBus.
It is able to extract keywords/keyphrases from textual sources, and provides a Map
The functionality is exposed as an object on the DBus, and may be called by a connecting client.
$> sh start-service.sh
If called from some application (or directly), it is mandatory to call the jar with specified JVM option java.library.path in order to indicate the path to the location of the native unix-java library "libunix-java.so":
$> java -Djava.library.path=lib/ -Dgate.home=gate -jar keyword-extractor-dbus.jar
The exposed service may be called by two different methods, as specified in the respective interface
ie.deri.smile.nlp.KeywordExtraction.java
KeywordExtraction kex = new KeywordExtractionImpl();
Map kwMap = kex.getKeywordsFromText("My very short sample sentence that will not generate any keyphrases because it is too short.");
KeywordExtraction kex = new KeywordExtractionImpl();
Map kwMap = kex.getKeywordsFromUrl("http://newsvote.bbc.co.uk/mpapps/pagetools/print/news.bbc.co.uk/sport2/hi/football/teams/n/newcastle_united/7636504.stm");
Feel invited to take a look at a sample client implementation:
ie.deri.smile.nlp.KeywordExtractionDBusClient.java
please see the info page dedicated to the web service