JAVA API - SubhasisDutta/Text-Analysis GitHub Wiki

JAVA API helps to utilize the diskoveror-ta package as a library in other JAVA applications. The JAVA API specification is mentioned below.

#####Method specification :

public String tagUniqueTextAnalyticsComponentsINJSON(String sDoc, TAConfig config)

PARAMETERS

  • sDoc: - The text which has to be analyzed with the diskoveror-ta package

  • config: - The config parameters which needs to be passed

Example of using Java API to analyze given text :

String example = "Sachin Tendulkar was the winner of Worldcup event in South AFrica during the year 2014"

TextManager obj = new TextManager();

TAConfig config = new TAConfig()

config.analysisConfig.put("Entity", "TRUE")

config.analysisConfig.put("Sentiment", "TRUE")

config.analysisConfig.put("Topic", "TRUE")

config.analysisConfig.put("Keyword", "TRUE")

System.out.println(obj.tagUniqueTextAnalyticsComponentsINJSON(example, config))

SAMPLE OUTPUT:

Text Analytics output :

{ "entity_general": { "Location": [ "south africa" ], "Person": [ "sachin tendulkar" ] }, "text_information": { "topics": [ "beauty", "entertainment", "general" ], "sentiment": [ "3" ] } }