Command Line API - SubhasisDutta/Text-Analysis GitHub Wiki

The command Line API provides a easy way to connect with the Text Analytics server and explore the extracted output. The command Line API can be fed with options such as analyze, text and file. The analyze option consists of components namely Entity, Sentiment, Topic, all. The analyze can be used with each of the components to give the text analytics output. The text refers to the text input given through command line. The file refers to the file input given through command line.

Syntax java -analyze entity|sentiment|topics|keyword|all -text java -analyze entity|sentiment|topics|keyword|all -file

---- show full example for the cases above ------ Example:

$ java -Xmx2048m -jar diskoverorta-0.1.jar -analyze all -text "Sachin Tendulkar was the winner in the Worldcup event at South Africa during the year 2014 :)" -analyze Entity

Example Usage

  • -text "Sachin Tendulkar was the winner in the Worldcup event at South Africa during the year 2014 :)" -analyze all

-file

Example Usage

  • -file file.txt -analyze Entity
  • -file file.txt -analyze all

SAMPLE OUTPUT

Run the following commands from the command line

Output 1

Text Analytics output : { "entity_general": { "Location": [ "miami" ], "Person": [ "lewis hamilton" ] }, "text_information": { "sentiment": [ "2" ] } }

$ java -Xmx2048m -jar diskoverorta-0.1.jar -text "Sachin Tendulkar was the winner in the Worldcup event at South Africa during the year 2014 :)" -analyze Entity

Output 2

Text Analytics output : { "entity_general": { "Location": [ "south africa" ], "Person": [ "sachin tendulkar" ] } }