Intelligent Tagging - RESTful API
Intelligent Tagging - Tutorial
Download tutorial source code |
Click here to download |
| Last update | January 2020 |
| Environment | Windows, Linux |
| Compilers | JDK 1.7 or greater |
| Prerequisites | Components
|
Description
Our example will open and read one or more input text files containing unstructured content, parse, analyze and create one or more structured output text files containing the results of the analysis:
- Our example picks up from inputDir (included with the tutorial) a file with the text to be tagged.
- Our example creates in outputDir (included with the tutorial) an xml file with the produced tags.
Please note that any language that supports HTTP can be used to implement the request.
Setup Steps
The steps include:
- If you don't already have a free Open Calais access token, register for MyRefinitiv, and then login to PermID.org with your credentials. An Open Calais access token is automatically e-mailed to you.
- Review the example source code
- Put your file(s) to be tagged into inputDir folder (the tutorial includes a sample input text file called: apireq.txt)
- Make sure outputDir exists and is writable (the tutorial includes the inputDir and outputDir folders)
- Build and run
Review the example code
The steps include:
- Create HTTP client
- Create PostMethod
- Specify mandatory parameters
- Set request entity to be our input file
- Execute the post method on the client and release connection
Run
It takes 3 arguments:
- Input folder name to process
- Output folder name to store response from Calais
- Token
Understanding the input
Input file is just plain text:
Request URL:
The request includes the path and the query parameters. The mandatory headers are also included with the request (see the code). From api-eit.refinitiv.com we request from the open calais service to tag the information contained within our file.
Understanding the expected output
This is the command line response we receive when we submit for matching the example file included with this tutorial:
This is an excerpt from the tagged file:
Or, if we were to go with outputFormat=”application/json” (an excerpt from the tagged file):
In addition to identifying and tagging individual text strings, Open Calais further enriches your data with metadata tags designed to describe the text. Open Calais automatically analyzes your input text and performs the following processes:
- Named Entity and Relationship Recognition
- Aboutness Tagging
- Social Tagging – Classifies the document based on Wikipedia folksonomy.
- Category Tagging – Identifies the topics discussed in the document. The list of possible topics is defined by the Refinitiv Coding Services (RCS) and International Press Telecommunications Council (IPTC) taxonomies.
- Industry Tagging –Identifies the industries related to the text. The list of industries that can be identified is defined by the TRBC Business Classification taxonomy
Learn more
For more information, developer guides, FAQ and Release Notes check out the documentation.