Inference Tagging API Calls Overview
This section uses some of the sample calls we configured using the Workbench and copied then to clipboard. You need to keep in mind that these are sample API request calls along with those parameters we previously set up using the Workbench.
We will now test those sample calls (previously copied to clipboard as cURL requests).
Note
Keep in mind that our example is comprised of two queries - extraction and expansion.
Caution
You have to be authenticated and authorized to make these API calls on your server.
Web Service Method: Extract concepts from an input text
This endpoint takes a text input together with specified configuration parameters and then returns concepts found in this text.
URL:
https://[your_PoolParty_server]/extractor/api/extract
Content type is
application/json
.Method:
GET
.
The request body
Content type is
application/json
.The request configuration parameters are the
project ID
,andtext
. You also need thecorpus ID
if you want to include corpus scoring and extract shadow concepts.Optional request configuration parameters are:
filterNestedConcepts, useCorpusScoring, useShadowConcepts, useDisambiguation
andshowMatchingInformation
,language
,conceptMinimumScore
.
When configuring Inference Tagging using on the Workbench we saved both requests (extraction and expansion) as cURL requests;
Responses
The response codes are 200 for correctly formed request, respectively 400 for bad request (user side) or 5xx indicating an unexpected error (server side).
The response format is
application/json
.
Web Service Method: Create a semantic footprint for a list of concepts
This endpoint takes a list of concepts and an expansion query and creates a semantic footprint for those two. This means, the result will be a list of concepts which are related to the input concepts, whereby the relation between those is defined by the expansion query.
URL:
https://[your_PoolParty_server]/PoolParty/api/tagging/{project}/expand
Content type is
application/json
.Method:
POST
.
The request body
Content type is
application/json
.The request configuration parameters are the
projectID
,language
,expansion query
along with the concepts retrieved during the extraction.
Let us use the query we saved on the Workbench.
Responses
The response codes are 200 for correctly formed request, respectively 400 for bad request (user side) or 5xx indicating an unexpected error (server side).
The response with code 200 delivers the identified concepts matching the expansion query criteria with their label, uri and score (if queried).
The response format is
application/json
.