REST methods for IBM Concept Insights
Base URI
{user}
/{corpus}
{user}
/{corpus}
{user}
/{corpus}
{user}
/{corpus}
/{documentid}
{user}
/{corpus}
/{documentid}
{user}
/{corpus}
/{documentid}
{user}
/{corpus}
/{documentid}
{user}
/{graphid}
{user}
/{graphid}
{user}
/{graphid}
{user}
/{graphid}
/{conceptid}
{user}
/{corpus}
{user}
/{corpus}
{user}
/{corpus}
/{documentid}
{user}
/{corpus}
/{documentid}
Authenticated requests return public collections and collections with read permission.
Example Request
Retrieves the available corpora:curl -u user:password ‘https://gateway.watsonplatform.net/concept-insights-beta/api/v1/corpus/’
[
{
“access”: “private”,
“id”: “/user/test”,
“users”: [
{
“permission”: “ReadWriteAdmin”,
“uid”: “user”
}
]
}
]
{user}
/{corpus}
Requires ‘Admin’ permission to the corpus. The operation also deletes all the documents contained in the corpus.
Example Request
Deletes corpus ‘test’:curl -D - -X DELETE -u user:password 'https://gateway.watsonplatform.net/concept-insights-beta/api/v1/corpus/user/test’
HTTP/1.1 200 OK
Path variables
User ID
Corpus ID
{user}
/{corpus}
Returns the content of the corpus if it has public access or has read permission. The content of a corpus is the list of document IDs within a corpus.
Example Request
Retrieves the list of documents in ‘/user/test’ corpus:curl -u user:password https://gateway.watsonplatform.net/concept-insights-beta/api/v1/corpus/user/test?limit=10
[“a”, “foo”, “testdoc”, “testdoc”]
Path variables
User ID
Corpus ID
Request parameters
Number of possible items to return in the range 0 – 10. Specify ‘0’ to return the maximum value of 100,000.
Number of items to skip
Responses
{user}
/{corpus}
Example Request
Creates corpus '/user/test' with private access:curl -D - -X PUT -u user:password -d '{"access":"private"}'
'https://gateway.watsonplatform.net/concept-insights-beta/api/v1/corpus/user/test'
HTTP/1.1 201 Created
Path variables
User ID
Corpus ID
Request body
{user}
/{corpus}
/{documentid}
Requires write access to the corpus.
Example Request
Deletes the ‘/user/test/foo.mw’ document:curl -D - -X DELETE -u user:password 'https://gateway.watsonplatform.net/concept-insights-beta/api/v1/corpus/user/test/mydoc’
HTTP/1.1 200 OK
Path variables
User ID
Corpus ID
Node ID
{user}
/{corpus}
/{documentid}
Authenticated requests return documents from a corpus if it has public access and from a corpus with read permission.
Example Request
Retrieves the ‘/user/test/ibmnews’ document:curl -D - -u user:password 'https://gateway.watsonplatform.net/concept-insights-beta/api/v1/corpus/user/test/ibmnews’
HTTP/1.1 200 OK
Content-Length: 13
Content-Type: application/json
Date: Thu, 18 Sep 2014 14:23:08 GMT
{
“id”: “ibmnews”,
“label”: “IBM News”,
“parts”: [
{
“name”: “excerpt”,
“uri”: “”,
“type”: “”,
“data”: “IBM announced today a new cognitive system…”
}
]
}
Path variables
User ID
Corpus ID
Document ID
Responses
Body
{user}
/{corpus}
/{documentid}
Requires write access to the corpus.
Example Request
Updates the ‘/user/test/mydoc’ document:curl -D - -X POST -u user:password -d ‘{“label”:“a new label”,“parts”:[{“data”:“International Business Machines
announced today a new cognitive system.”,“name”:“field”}]}’
‘https://gateway.watsonplatform.net/concept-insights-beta/api/v1/user/test/mydoc’
Path variables
User ID
Corpus ID
Document ID
Request body
{user}
/{corpus}
/{documentid}
Requires write access to the corpus.
Example Request
Creates the ‘/user/test/ibmnews’ document:curl -D - -X PUT -u user:password -d ‘{“label”:“IBM News”,“parts”:[{“name”:“excerpt”,“data”:“IBM announced today
a new cognitive system…”}]}’ 'https://gateway.watsonplatform.net/concept-insights-beta/api/v1/corpus
/user/test/ibmnews’
HTTP/1.1 201 Created
Path variables
User ID
Corpus ID
Document ID
Request body
Similar to the GET /v1/graph/{user}/{graphid}/{conceptid} method, but for multiple concepts.
Example Request
Retrieves the metadata for two concepts: “IBM” and “Information theory”:curl --get -u username:password --data-urlencode “func=minfo” --data-urlencode
‘ids=["/graph/wikipedia/en-20120601/Information_theory",
“/graph/wikipedia/en-20120601/IBM”]’ ‘https://gateway.watsonplatform.net/concept-insights-beta/api/v1/graph’
| python -mjson.tool
[
{
“abstract”: “Information theory is a branch of applied mathematics and electrical engineering involving
the quantification of information. Information theory was developed by Claude E. Shannon to find fundamental
limits on signal processing operations such as compressing data and on reliably storing and communicating data.”,
“id”: “Information_theory”,
“label”: “Information theory”,
“link”: “http://en.wikipedia.org/wiki/Information_theory”,
“type”: “wiki_resource”
},
{
“abstract”: “International Business Machines Corporation or IBM is an American multinational technology
and consulting corporation headquartered in Armonk, New York, United States. IBM manufactures and sells
computer hardware and software, and it offers infrastructure, hosting and consulting services in areas
ranging from mainframe computers to nanotechnology.”,
“id”: “IBM”,
“label”: “IBM”,
“link”: “http://en.wikipedia.org/wiki/IBM”,
“ontology”: [
“Company”,
“Organisation”,
“Agent”
],
“thumbnail”: “http://upload.wikimedia.org/wikipedia/commons/thumb/5/51/IBM_logo.svg/200px-IBM_logo.svg.png”,
“type”: “wiki_resource”
}
]</code>
Request parameters
Response requested
Array of concept URIs
{user}
/{graphid}
Searches for partial matches on the concept label field. The comparison is not case sensitive. When the prefix parameter is set to true, the main use of this method is to build query boxes that offer auto-complete.
Example Request
Retrieves four concepts in which the label starts with the word ‘cognitive’:curl -u username:password ‘https://gateway.watsonplatform.net/concept-insights-beta/api/v1/graph/wikipedia/en-20120601?
func=labelSearch&label=cognitive&prefix=true&limit=4’ | python -m json.tool
[
{
“abstract”: “In science, cognition: refers to mental processes. These processes include attention,
memory, producing and understanding language, solving problems, and making decisions. Cognition is
studied in various disciplines such as psychology, philosophy, linguistics, science and computer
science. Usage of the term varies in different disciplines; for example in psychology and cognitive
science, it usually refers to an information processing view of an individual’s psychological functions.”,
“id”: “Cognition”,
“label”: “Cognitive”,
“link”: “http://en.wikipedia.org/wiki/Cognition”,
“type”: “wiki_resource”
},
{
“abstract”: “Cognitive psychology is a subdiscipline of psychology exploring internal mental processes.
It is the study of how people perceive, remember, think, speak, and solve problems. Cognitive psychology
differs from previous psychological approaches in two key ways. It accepts the use of the scientific
method, and generally rejects introspection as a valid method of investigation - in contrast with
such approaches as Freudian psychology.”,
“id”: “Cognitive_psychology”,
“label”: “Cognitive approach”,
“link”: “http://en.wikipedia.org/wiki/Cognitive_psychology”,
“type”: “wiki_resource”
},
{
“abstract”: “Cognitive behavioral therapy (CBT) is a psychotherapeutic approach that addresses dysfunctional
emotions, behaviors, and cognitions through a goal-oriented, systematic process. The name refers to
behavior therapy, cognitive therapy, and to therapy based upon a combination of basic behavioral and
cognitive research. CBT is effective for the treatment of a variety of conditions, including mood,
anxiety, personality, eating, substance abuse, tic, and psychotic disorders.”,
“id”: “Cognitive_behavioral_therapy”,
“label”: “Cognitive behavior modification”,
“link”: “http://en.wikipedia.org/wiki/Cognitive_behavioral_therapy”,
“type”: “wiki_resource”
},
{
“abstract”: “A cognitive architecture is a blueprint for intelligent agents. It proposes (artificial)
computational processes that act like certain cognitive systems, most often, like a person, or acts
intelligent under some definition. Cognitive architectures form a subset of general agent
architectures. The term ‘architecture’ implies an approach that attempts to model not only
behavior, but also structural properties of the modelled system.”,
“id”: “Cognitive_architecture”,
“label”: “Cognitive architecture”,
“link”: “http://en.wikipedia.org/wiki/Cognitive_architecture”,
“type”: “wiki_resource”
}
]
Path variables
User
Graph ID
Request parameters
Response requested
String to use as search
Unique ID of the knowledge base that contains the concept.
Prefix search flag. Set to true to treat the input string as a prefix to the label. Useful to restrict the results to labels that begin with the label string.
{user}
/{graphid}
Each entry in the response is augmented with a score field in the range 0.5 - 1.0. The higher the score, the more evidence that the query concept is related to the concept in the returned entry.
Example Request
Retrieves high-level concepts that are related to color blindness:curl --get -u username:password --data-urlencode “func=related” --data-urlencode
‘concepts=["/graph/wikipedia/en-20120601/Color_blindness"]’ --data-urlencode “level=0”
‘https://gateway.watsonplatform.net/concept-insights-beta/api/v1/graph/wikipedia/en-20120601/’
| python -m json.tool
[
{
“score”: 0.9773398,
“uri”: “/v1/graph/wikipedia/en-20120601/Retina”
},
{
“score”: 0.9358882,
“uri”: “/v1/graph/wikipedia/en-20120601/Human_eye”
},
{
“score”: 0.92706054,
“uri”: “/v1/graph/wikipedia/en-20120601/Color”
},
{
“score”: 0.9090508,
“uri”: “/v1/graph/wikipedia/en-20120601/Ophthalmology”
},
{
“score”: 0.886107,
“uri”: “/v1/graph/wikipedia/en-20120601/Zygosity”
}
]
Path variables
User
Graph ID
Request parameters
Response requested
Array of concept IDs, each identifying a concept.
Number in the range 0 - 3 that represents the level of popularity of related concepts. A value of 0 indicates a very popular concept or a high-level concept (for example, countries, institutions, celebrities, and subject areas). Values ranging from 1 - 3 indicate less famous concepts that are likely to be related to fewer other concepts and are usually domain-specific.
Number in the range 1 - 10 that represents the number of possible concepts to return. Fewer concepts might be returned if the level parameter is set to “0”.
Responses
{user}
/{graphid}
Attempts to identify words in the text that correspond to concepts in the graph. You can use the operation to test sample content for suitability in the Concept Insights service before it is ingested in a corpus. For useful results, use content that has at least 10 Wikipedia concepts with a score of 0.7 or higher:
curl -u username:password -d “My heart sank when I saw that Deep Blue won against Kasparov. Computer science</code>
and humanity would never be the same after that.” ‘https://gateway.watsonplatform.net/concept-insights-beta
/api/v1/graph/wikipedia/en-20120601?func=annotateText’ | python -m json.tool
[
{
“concept”: “/graph/wikipedia/en-20120601/Computer_science”,
“coords”: [
[
62,
70
],
[
71,
78
]
],
“weight”: 0.8426364
},
{
“concept”: “/graph/wikipedia/en-20120601/Deep_Blue_vs_Kasparov”,
“coords”: [
[
30,
34
],
[
35,
39
],
[
52,
60
]
],
“weight”: 0.7565227
},
{
“concept”: “/graph/wikipedia/en-20120601/Humanity”,
“coords”: [
[
83,
91
]
],
“weight”: 0.6133502
}
]
Path variables
User
Graph ID
Request parameters
Response requested
Request body
Responses
{user}
/{graphid}
/{conceptid}
The graph is restricted to ‘/wikipedia/en-20120601/.’ The concept is the string that Wikipedia uses for an article’s URI. For example, for ‘The New York Times,’ the concept is 'The_New_York_Times.'
Example Request
Retrieves the metadata for concept “IBM”:curl -u username:password -s ‘https://gateway.watsonplatform.net/concept-insights-beta/api/v1/graph
/wikipedia/en-20120601/IBM’| python -mjson.tool
{
“abstract”: “International Business Machines Corporation or IBM is an American multinational technology
and consulting corporation headquartered in Armonk, New York, United States. IBM manufactures and sells
computer hardware and software, and it offers infrastructure, hosting and consulting services in areas
ranging from mainframe computers to nanotechnology.”,
“id”: “IBM”,
“label”: “IBM”,
“link”: “http://en.wikipedia.org/wiki/IBM”,
“ontology”: [
“Company”,
“Organisation”,
“Agent”
],
“thumbnail”: “http://upload.wikimedia.org/wikipedia/commons/thumb/5/51/IBM_logo.svg/200px-IBM_logo.svg.png”,
“type”: “wiki_resource”
}
Path variables
User
description
description
{user}
/{corpus}
The main use of this operation is to build auto-complete query boxes. The order of the concept URIs is influenced by the corpus contents. Concepts to the corpus are prioritized. Returns corpus listings with read permission.
Example Request
Finds both concepts and searchables in the ‘ibmresearcher’ domain with a prefix of ‘mark.’ Limit set to two items for each:curl -u username:password ‘https://gateway.watsonplatform.net/concept-insights-beta/api/v1/searchable/public/ibmresearcher
?func=labelSearch&query=mark&prefix=true&concepts=true&limit=2’ | python -m json.tool
[
{
“id”: “zurich-mla”,
“label”: “Lantz, Mark A.”,
“result”:{
“id”: “zurich-mla”,
“label”: “Lantz, Mark A.”,
“lastbuild”: “0001-01-01T00:00:00Z”,
“lastmodified”: “2015-01-07T16:32:09Z”,
“state”:{
“stage”: “compute”,
“status”: “locked”,
“timestamp”: “2015-01-31T03:55:06.216Z”
},
“type”: “”,
“user”: {
“thumbnail”: “http://researcher.watson.ibm.com/researcher/photos/942.jpg”
}
},
“type”: “/public/ibmresearcher”
},
{
“id”: “us-mferriss”,
“label”: “FERRISS, MARK A.”,
“result”:{
“id”: “us-mferriss”,
“label”: “FERRISS, MARK A.”,
“lastbuild”: “0001-01-01T00:00:00Z”,
“lastmodified”: “2015-01-16T11:22:24-05:00”,
“state”:{
“stage”: “ready”,
“status”: “done”,
“timestamp”: “2015-01-30T08:54:40.34Z”
},
“type”: “”,
“user”: {
“thumbnail”: “http://researcher.watson.ibm.com/researcher/photos/1274.jpg”
}
},
“type”: “/public/ibmresearcher”
},
{
“id”: “Garbage_collection_(computer_science)”,
“label”: “Mark and sweep”,
“result”:{
“abstract”: “In computer science, garbage collection (GC) is a form of automatic memory management.
The garbage collector, or just collector, attempts to reclaim garbage, or memory occupied by objects
that are no longer in use by the program. Garbage collection was invented by John McCarthy around
1959 to solve problems in Lisp.”,
“id”: “Garbage_collection_(computer_science)”,
“label”: “Garbage collection (computer science)”,
“type”: “wiki_resource”,
“link”: “http://en.wikipedia.org/wiki/Garbage_collection_(computer_science)”
},
“type”: “concept”
},
{
“id”: “Markov_chain”,
“label”: “Markhow chain”,
“result”:{
“abstract”: “A Markov chain, named after Andrey Markov, is a mathematical system that undergoes transitions
from one state to another, between a finite or countable number of possible states. It is a random
process characterized as memoryless: the next state depends only on the current state and not on
the sequence of events that preceded it. This specific kind of “memorylessness” is called the
Markov property. Markov chains have many applications as statistical models of real-world processes.”,
“id”: “Markov_chain”,
“label”: “Markov model”,
“type”: “wiki_resource”,
“link”: “http://en.wikipedia.org/wiki/Markov_chain”
},
“type”: “concept”
}
]
Path variables
User
Corpus ID
Request parameters
Response requested
String to search for
Prefix search flag. Set to true to specify that the query parameter string is a prefix query.
Concepts flag. Set to true to return concepts in addition to searchables.
Number in the range 1 – 10 that represents the number of possible concepts to return.
Responses
Body
{user}
/{corpus}
Returns documents from the specified corpus that are sorted by conceptual relevance to the query. Additionally, the operation returns an explanation of why concepts within the corpus are relevant to the query, with enough information to render the original text with concepts relevant to the query.
Example Requests
Finds documents in /‘user/corpus’ that are conceptually related to Java virtual machine:curl -u username:password 'https://gateway.watsonplatform.net/concept-insights-beta/api/v1/searchable/public/ibmresearcher<p/>Finds documents in ‘/user/corpus’ that are conceptually related to the /‘user/mydocs/foo’ document:
?func=semanticSearch&&ids=["/graph/wikipedia/en-20120601/Java_virtual_machine"]&limit=4’
curl -u username:password ''https://gateway.watsonplatform.net/concept-insights/beta/api/v1/searchable/user/corpus<p/>Find IBM researchers by using Charlie Bennet (us-bennetc) as an example:
?func=semanticSearch&ids=["/corpus/user/mydocs/foo"]&limit=4’
curl --get -u username:password --data-urlencode “limit=4” --data-urlencode “func=semanticSearch”
--data-urlencode ‘ids=["/corpus/public/ibmresearcher/us-bennetc"]’
‘https://gateway.watsonplatform.net/concept-insights-beta/api/v1/searchable/public/ibmresearcher’
Path variables
User
Corpus ID
Request parameters
Response requested
Reference to a Concept URI or Searchable
Number of items to skip
Number in the range 1 – 10 that represents the number of possible concepts to return.
Responses
Body
{user}
/{corpus}
/{documentid}
The item is ready for semantic search when stage is in the ‘ready’ state. The intermediate stages are 'annotate and ‘compute.’ When you update a corpus document, the ‘annotate’ process restarts.
Example Request
curl ‘https://gateway.watsonplatform.net/concept-insights-beta/api/v1/searchable/user/corpus/documentid?func=getState’
{
“stage”: “ready”,
“status”: “done”,
“timestamp”: “2014-03-31T20:04:57.74-04:00”
}
Path variables
User
Corpus ID
Document ID
Request parameters
Response requested
{user}
/{corpus}
/{documentid}
Example Request
Asks how related a document is by score to the 'Hash_functions' concept:curl -u username:password 'https://gateway.watsonplatform.net/concept-insights-beta/api/v1/searchable/public/ibmresearcher
/us-bennetc?func=relScore&dest=\["/graph/wikipedia/en-20120601/Hash_functions"\]'
{
"score":0.9582957029342651
}
Path variables
User
Corpus ID
Document ID
Request parameters
Response requested
Reference to a Concept URI
Step 1. Upload the seed list.
Request parameters
Dataset to run against.
A conceptual classification of the seed terms.
Request body
Responses
Body
Step 2. Query the status of the job created with the POST /upload operation.
Request parameters
The jobid returned from the POST /upload operation.
Responses
Body
Step 3. Retrieve the concept-expanded seed list and delete the results.
Request body
Responses
You can detect the language of text that is encoded as UTF-8 by using the Watson Language Identification (LID) service.
Request parameters
Language identification of the text.
The text that you want to process. Must be encoded as UTF-8.
Return type. The content type to accept.
Responses
Request parameters
Language identifiers. Uses the ISO language and country code in the form “mt-<from-language>-<to-language>”.
The text that you want to translate. Must be encoded as UTF-8.
The format of the translated content that you want.
Responses
The ringscore has the range 0 - 99. The larger the ringscore, the more effective the term.
Request parameters
The term to use for the ringscore
The ID of the community to which the ringscore applies. Use GET /v1/datasets to retrieve the communities. If dataset is not included, the service returns an aggregate ring score.
Responses
Body
Responses
Body
{classifier_id}
/classify{classifier_id}
{classifier_id}
Sends data to create and train a classifier, and returns information about the new classifier.
The status has the value of Training
when the operation is successful, and might remain at this status for a while.
Example Request
Creates a classifier with the information in the filetrain.json
:curl -X POST -u user:password -H “Content-Type:application/json” -d @train.json
“https://gateway.watsonplatform.net/natural-language-classifier-experimental/api/v1/classifiers”
Request body
Responses
Body
Bad request. Likely caused by a missing training_data
property or malformed JSON. Or this request exceeds the maximum number of classifiers for this user or service instance.
Body
Body
Returns an empty array if no classifiers are available.
Example Request
curl -u user:password “https://gateway.watsonplatform.net/natural-language-classifier-experimental/api/v1/classifiers”
Responses
{classifier_id}
/classifyThe status must be Available
before you can use the classifier to classify calls. Use GET /classifiers/{classifier_id}
to retrieve the status.
Example Request
Classify a phrase with the classifier6C76AF-nlc-43
:curl -X POST -u user:password -H “Content-Type:application/json” -d “{“text”:“what is your phone number?”}”
“https://gateway.watsonplatform.net/natural-language-classifier-experimental/api/v1/classifiers/6C76AF-nlc-43/classify”
Path variables
Classifier ID to use
Request body
Responses
Body
Body
{classifier_id}
Example Request
Delete the classifier `6C76AF-nlc-43`:curl -X DELETE -u user:password "https://gateway.watsonplatform.net/natural-language-classifier-experimental
/api/v1/classifiers/6C76AF-nlc-43"
Path variables
Classifier ID to delete
Responses
Body
{classifier_id}
Example Request
Retrieves the information for classifier with the id `6C76AF-nlc-43`:curl -u user:password "https://gateway.watsonplatform.net/natural-language-classifier-experimental
/api/v1/classifiers/6C76AF-nlc-43"
Path variables
Classifier ID to query
Responses
Body
Body
Currently only English (en) is supported for both input and output. A JSON response conforms to the Profile model. When an error status code is returned, a JSON response is returned with more details about the error.
Request parameters
If true, column labels are sent with a CSV response. Specify “text/csv” for the Accept header.
Request headers
The content type of the request
The desired content type of the response. CSV output includes a fixed number of columns
The desired language of the response. Currently only “en” is supported.
The content language of the request. Applies when the Content-Type header is set to “text/plain” or “text/html”. Currently only “en” is supported.
Request body
The POST /v2/visualize operation is deprecated, it will be removed in a future release. The visualization capability now is included in the sample code to facilitate its use with caching and content distribution networks.
Accepts a User Modeling portrait that is generated from the response of the POST /profile operation. The response is a visualization of the portrait that is generated via JavaScript, HTML and SVG with the D3.js library.
Request parameters
Width of the visualization, in pixels.
Height of the visualization, in pixels.
The id of the result div element containing the visualization.
If true, return the D3.js library inline. If false, do not. Specify “true” for the first widget you place in your page and “false” for the rest to avoid having multiple copies of D3.
The url to an image to place at the center of the visualization. Typically this would be a picture of the person who created the text that was analyzed. For example, a URL to the user’s portrait from Twitter.
The visualization uses some names that are more meaningful to a lay person. Set to true to see the original names for these characteristics.
Request body
{dataset}
{dataset}
Accepts a Question and Answer REST API request and routes it to the Watson instance identified by the “dataset” path parameter. The response includes answers and supporting evidence.
Path variables
Identifies the data set or domain that Watson is trained for
Request headers
Specifies how long the Watson pipeline waits for a response
Request body
Responses
Body
The feedback API allows you to provide information on how well the service performed. The feedback is used to further improve the service and future results.
Request body
Responses
You can extract useful information from text by using the IBM Watson Relationship Extractor service.
Request parameters
Language identifier. “es” refers to Spanish, and “en” refers to English.
The text that you want to process. Must be encoded as UTF-8.
Return type. The content type to accept.
Responses
{modelId}
{sessionId}
{sessionId}
/observeResult{sessionId}
/recognize{sessionId}
/recognize{sessionId}
/recognizeThe default model is WatsonModel (English). Create a session to lock an engine to the session. You can use the session for multiple recognition requests, so that each request is processed with the same speech-to-text engine. Use the cookie that is returned from this operation in the Set-Cookie header for each request that uses this session. The session expires after 15 minutes of inactivity.
{sessionId}
/observeResultStart the request before the POST to recognize finishes. If the POST request is finished, the response for this request waits for the next recognition. You can submit multiple requests that point to the same recognition task and specify interim results.
Path variables
Session used in the recognition
Request parameters
If true, interim results are returned as a stream of JSON objects. Each object represents a single SpeechRecognitionEvent. If false, the response is a single SpeechRecognitionEvent
with all final results.
Request headers
Specify 0 to prevent the server from saving the audio and transcription. Setting applies only to this request.
Responses
Body
Body
Internal server error. The session ID is destroyed after this error. Future request using this session will return HTTP 404.
Body
{sessionId}
/recognizeConcurrent recognition tasks during the same session are not allowed. This method offers a way to check whether the session can accept another recognition task. The returned state must be ‘initialized’ to send the POST recognize operation.
Path variables
Session used in the recognition
Responses
Body
Body
Body
{sessionId}
/recognizeReturns only the final results. To see interim results, call GET {sessionId}/observeResult?interim_results=true before this POST finishes. Endianness of the audio is autodetected. Audio longer than 5 minutes has to be sent in streaming mode (see Transfer-encoding header)
Path variables
Session used in the recognition
Request parameters
If true, multiple final results representing multiple consecutive phrases separated by pauses can be returned. Otherwise, the recognition ends after first ‘End of speech’ is detected.
Request headers
Media type of the audio
Set this header to chunked
to send the audio in streaming mode. Streaming is required for audio longer than 5 minutes
Specify 0 to prevent the server from saving the audio and transcription. Setting applies only to this request.
Request body
Responses
Body
Body
Body
Internal server error. The session will be destroyed after this error and next requests on this session would return 404.
Body
Session is already processing a request. Concurrent requests are not allowed on the same session. Session remains alive after this error.
Body
{sessionId}
/recognizeReturns only the final results. To see interim results, call GET {sessionId}/observeResult?interim_results=true before this POST finishes. Audio longer than 5 minutes has to be sent in streaming mode (see Transfer-encoding header). The first part must be a JSON, the following parts must be audio files, e.g. {“part_content_type”:“audio/flac”, “num_data_parts”:1, “continuous”:true}, where 1 flac file would follow in the second part
Path variables
Session used in the recognition
Request parameters
If true, multiple final results representing multiple consecutive phrases separated by pauses can be returned. Otherwise, the recognition ends after first ‘End of speech’ is detected
Request headers
Content-Type of the payload
Set this header to chunked
to send the audio in streaming mode. Streaming is required for audio longer than 5 minutes
Specify 0 to prevent the server from saving the audio and transcription. Setting applies only to this request.
Request body
Metadata and audio files
Responses
Body
Body
Body
Internal server error. The session will be destroyed after this error and next requests on this session would return 404
Body
Session is already processing a request. Concurrent requests are not allowed on the same session. Session remains alive after this error
Body
The default model is WatsonModel (English). Returns only the final results. Use sessions to enable interim results. Endianness of the audio is autodetected. Audio longer than 5 minutes has to be sent in streaming mode (see Transfer-encoding header)
Request parameters
If true, multiple final results that represent multiple consecutive phrases separated by pauses can be returned. Otherwise, the recognition ends after first ‘End of speech’ is detected.
Request headers
Media type of the audio. Both audio/flac and audio/l16 MIME types are supported. If you use the audio/l16 MIME type, specify the rate and channels. For example, “audio/l16; rate=48000; channels=2”. Ensure that the rate matches the rate at which the audio is captured.
Set this header to chunked
to send the audio in streaming mode. Streaming is required for audio longer than 5 minutes
Specify 0 to prevent the server from saving the audio and transcription. Setting applies only to this request.
Request body
Responses
Body
Body
Returns only the final results. Use sessions to enable interim results. Audio longer than 5 minutes has to be sent in streaming mode (see Transfer-encoding header). The default model is WatsonModel (English). The first part must be a JSON, the following parts must be audio files, e.g. {“part_content_type”:“audio/flac”, “num_data_parts”:1, “continuous”:true}, where 1 flac file would follow in the second part
Request parameters
If true, multiple final results representing multiple consecutive phrases separated by pauses can be returned. Otherwise, the recognition ends after first ‘End of speech’ is detected
Request headers
Content-Type of the payload
Set this header to chunked
to send the audio in streaming mode. Streaming is required for audio longer than 5 minutes
Specify 0 to prevent the server from saving the audio and transcription. Setting applies only to this request.
Request body
Metadata and audio files
Responses
Body
Body
Identical to the POST method but passes shorter text in a query parameter. The text size is limited by the maximum length of the HTTP request line and headers, or about 6KB.
Request parameters
Requested MIME type. You can use this query parameter instead of a header parameter.
Selects a voice to use for synthesis. Retrieve available voices with GET /v1/voices method.
Text to synthesize. Text size limited to about 6KB.
Request headers
Specify 0 to prevent the server from saving the input text. Setting applies only to this request.
Identical to the GET method but passes longer texts in the body. Text size is limited to 4MB.
Request parameters
Requested MIME type. You can use this query parameter instead of a header parameter.
Selects a voice to use for synthesis. Retrieve available voices with GET /v1/voices method.
Request headers
Specify 0 to prevent the server from saving the input text. Setting applies only to this request.
Request body
Returns a dilemma that contains the problem and a resolution. The problem contains a set of options and objectives. The resolution contains a set of optimal options, their analytical characteristics, and representation on a 2D space.
Request parameters
Determines whether to calculate visualization
Request body
Responses
Body
You can query a label group to return other label groups and relevant labels.
Request parameters
Label groups and labels object. Send the JSON data as a string. Omit the parameter to return all items. Specify a label group to return a subset of label groups and corresponding labels. Existing labels that you specify are returned.
Responses
Classifies the images you upload against the label groups and labels. For each image, the response includes a score for a label if the score meets the minimum threshold of 0.5. If no score meets the threshold for an image, no labels are returned.
The operation consumes both parameters as multipart/form-data
Request body
The labels to check. Send the JSON data as a string. Use the response from the GET /labels method to narrow the list of labels to check. Omit this parameter to use all labels.
The image file to analyze. Ensure that the image includes a file name extension (for example, .jpg or .png). You can also upload a compressed (.zip) file of images.
Responses
Link to external resource for this concept (for example, a wikipedia page)
Coordinates of the extracted terms in the original document as specified in the ‘sources’ property of the Searchable object. Each pair of integers corresponds to the beginning and ending of each word in the term.
Decimal percentage of the confidence in the annotation. Higher values represent higher confidences.
User ID
Combination of ‘Read’, ‘Write’ and ‘Admin’
Unique identfier for this concept
Human-readable title of the concept
Link to external resource for this concept (for example, a wikipedia page)
List of potential categories for a concept
URL of a small image of the concept
The conceptual relationship score in the range 0.5 - 1.0. The higher the score, the more evidence of a relationship.
Must match the URI corpus ID in requests
Visibility of the corpus
‘public’ or ‘private’
List of document descriptor objects
As defined in RFC 3339. Set by server if not sent by client
Array of Annotation. Dictionary mapping of a key from ‘sources’ field to an array of extracted annotations.
The state of the searchable
List of document descriptor objects
As defined in RFC 3339. Set by server if not sent by client
As defined in RFC 3339. Set by server if not sent by client
Additional information
Document name
document URI. The only supported protocol is that of the doc service. Specify URIs without a protocol and with a relative path. For example, “/api//v1/doc/user/collection/document.txt”
Document MIME type
Immediate document data (takes precedence over URI)
ID of Concept or Searchable
Label of Concept or Searchable
‘Concept’ to identify concept. Also, domain name for Searchable of a domain
Concept URI or Searchable object representation
The conceptual relationship score in the range 0.5 - 1.0. The higher the score, the more evidence of a relationship.
Unique identifier for the submitted job in the form “<id_number>#<serialnumber>”
Current status of the job: Done. Awaiting start. Going, Retrieved, and Failed
Comma-separated list of seed terms
Ranked score for result
A new term
Error description
HTTP status code
Representative phrase. For example, questions that users might ask
Identifier (or “key”) of the specific action that the application takes for the representative phrase.
The classifiers available to the user
Unique identifier for this classifier
Link to the classifer
The state of the classifier
Additional detail about the status
Unique identifier for this classifier
Link to the classifer
The submitted phrase
The class with the highest confidence
An array of up to ten class-confidence pairs sorted in descending order of confidence
The submitted phrase
Class label
A decimal percentage that represents the confidence that Watson has in this class. Higher values represent higher confidences.
IETF primary language subtag for the classifier
The set of questions and their “keys” used to adapt a system to a domain (the ground truth)
Unique identifier for this classifier
Link to the classifer
The unique identifier for which these characteristics were computed, from the “userid” field of the input ContentItems.
The source for which these characteristics were computed, from the “sourceid” field of the input ContentItems.
The number of words found in the input.
A message indicating the number of words found and where that value falls in the range of required/suggested number of words.
The id of the characteristic, globally unique.
The user-displayable name of the characteristic.
The normalized value of the characteristic, from 0-1. For example, if the percentage for Openness is 0.25, you scored in the 25th percentile. You are more open than 24% of the population and less open than 74% of the population.
Indicates the sampling error of the percentage, based on the number of words in the input. The number defines a 95% confidence interval around the percentage. For example, the sampling error is 4% and percentage is 61%. It is 95% likely that the actual percentage value is between 57% and 65% if more words are given.
Unique identifier for this content item.
Unique identifier for the author of this content.
Identifier for the source of this content. For example, blog123, twitter.
Timestamp that identifies when this content was created. In milliseconds since midnight 1/1/1970 UTC.
Timestamp that identifies when this content was last updated. In milliseconds since midnight 1/1/1970 UTC.
MIME type of the content, for example, “text/plain, text/html”. The tags are stripped from HTML content before it is analyzed. Other MIME types are processed as is.
Character set of the text, for example, “UTF-8”
Language identifier (two-letter ISO 639-1 identifier). Currently only English content (en) is supported.
Content to be analyzed. Up to 20MB of content is supported.
Unique id of the parent content item. Used to identify hierarchical relationships between posts/replies, messages/replies, etc.
Indicates whether this content item is a reply to another content item.
Indicates whether this content item is a forwarded/copied version of another content item.
Question information
The text of the question to be answered
An integer in the range 1 – 10 that represents the number of possible answers to be returned. If you do not specify the number of items, the request assumes five answers.
Specifies that you want Watson to return supporting evidence for each answer in the answers/answer/evidence section of the answer response.
Specify an answer to receive the supporting evidence passages for that answer. Without this element, Watson searches for answers from the questionText. When you assert an answer, Watson uses that answer instead to search for supporting evidence passages.
The category of the question in terms of a constraint on the possible answers.
A natural language string that is composed of words that provide extra information for Watson to consider when it determines answers.
Requests Watson to return the formatted answer.
Specifies a string that you include with the question. The passthru data is not submitted with the pipeline but does pass through to the answer.
The container for the set of synonyms. You can provide feedback to Watson by resubmitting a question and including an updated list of synonyms.
The lexical answer type (LAT) of the question. The LAT is a word or noun phrase that appears in the question, or is implied by it.
Supports the use of metadata to restrict answers to specific documents
An integer in the range 1 – 10 that defines the number of supporting passages to return for each answer. Fewer passages might be returned for answers that do not have good passage support. The default value is 3 passages.
Whether to return evidence profiles for each possible answer.
The type of the filter
The name of the indexed metadata field. Use “indexedKey.” for dateRangeFilter use “indexed” for other filterTypes.
The metadata value of the indexed field name.
An integer that is assigned by the service to identify this question and its answers.
The category of the question that was submitted with the question. When no category was submitted with the question, an empty category element is returned in the response.
The container for a list of focus elements that are determined by the pipeline for the final answer.
The container for lexical answer types (LATs) that the pipeline determined for the final answer. The /question/lat is submitted in the POST when the question what submitted. The/question/latlist contains the LATs that were determined by the pipeline when it processed the answer.
The internal ID that is assigned for the final answer CAS. This element contains the internal CAS ID that is assigned after the question is answered. You can use this ID to identify the question with the internal data structures that Watson uses.
The container for a list of question classes that are determined by the pipeline for the final answer.
The response status of the request.
Contains more information about the answers for a customization of the IBM Watson processing pipeline. In a Watson system that is not customized, this element is not returned.
An integer that uniquely identifies an answer in the context of the question.
A string that contains an answer to the question in the form of text.
A decimal percentage that represents the confidence that Watson has in this answer. Higher values represent higher confidences.
The HTML-formatted version of the answer text that is returned when you set formattedAnswer to true when you submit a question. The formatted answer includes content from the <body> tag of the answer.
The copyright holder for the document that contains the evidence passage. If there is no copyright information, the element is empty.
The URL to a document passage for an answer.
A URL that points to the license that describes the terms of use of the document.
The passage text, essentially one or more sentences.
The passage title, a string of text.
The container for message information about a recoverable error.
A string that describes the error.
The original term value with its part of speech, such as noun, adj, adv, and verb.
The set that represents the source (such as wordnet or wikiredirect) of the synonyms.
A synonym that belongs to a synSet. The synonym is represented by its value and whether it is used. All synonyms are returned in lowercase text.
The copyright holder for the document that contains the evidence passage. If there is no copyright information, the element is empty.
The container for the metadata from the document that contains the evidence passage. This element is returned only when the IBM Watson processing pipeline is configured to support metadata.
A URL that points to the license that describes the terms of use of the document that contains the evidence passage. If there is no information about terms of use, the element is empty.
The evidence passage text.
The title of the document for the evidence passage.
The URL to a document passage for an answer.
A decimal percentage that represents the confidence that Watson has in this evidence. Higher values represent higher confidences.
The question ID, obtained from the QA API result.
The question text obtained from the QA API result.
The answer ID to provide feedback on. The Answer ID is obtained from the QA API result.
The answer text to provide feedback on. The answer text is obtained from the QA API result.
The name of the user submitting the feedback.
The Watson mode used to obtain the QA API result.
The confidence of the answer obtained from the QA API result.
If the answer was shown to the user.
If the evidence was viewed by the user.
String representation of the feedback [-1 = answers was irrelevant, 0=neutral feedback, 1=answer was relevant, 9=answer was partially relevant]
User comment.
Index of the first updated result in the array of all results. The returned array contains only the items from this index.
Updated results. Each item corresponds to a single utterance ended by ‘end of speech’ detected by the service.
If true, result for this utterance will not be updated further
List of alternative transcripts received from the service
Transcript of the utterance
Name of the model to use as identifier in all requests
Sampling rate used by model (minimal rate to use)
URI for sessions on this model
URI of the model.
ID of the session created
URI for the session created
URI for recognize
URI for results observers
This must be the first part and contain JSON-formatted text, with the metadata describing the following parts, which contain the data. The Content-Type of the parts will be ignored
Audio parts as described by metadata. Endianness of the audio is autodetected.
The MIME type of the data in the following parts. All data parts must have the same MIME type
The number of the data parts (should be one less than total number of parts in the request). When specified, server-side end-of-stream detection can be applied to the last (and possibly the only) data part. If omitted, the number of parts is determined from the request itself.
If true, multiple final results that represent multiple consecutive phrases separated by pauses can be returned. If set to false (default), the recognition ends after first ‘End of speech’ is detected.
Description of state and possible actions on the current session
State of the session. It must be ‘initialized’ to perform new recognition tasks on the session
URI where information about the model that is used in the session can be found
URI for recognize
URI for results observers
The name of the voice. Use this as voice identifier in all requests.
The language and region of the voice (for example, ‘en-US’).
The gender of the voice: ‘male’ or ‘female’.
URI of the voice.
Text to synthesize
Analytical data per option
2D position of option on map polygon
Configuration of algorithm parameters used for this map output
Metrics associated with map quality
Anchor point on map
Cell on map. Structure is {“coordinates”: {“x”: 0, “y”: 0}, “solution_refs”: [“key1”, “key3”]}. Coordinates
describe the position on the map of options identified by keys in solution_refs
.
Comments related to map, currently not in use
Direction of the objective. The direction can be minimized (price of a car) or maximized (safety of a car)
Specifies whether this column is acting as objective in the given problem
A value that is considered an insignificant loss for this objective
A value that is considered a significant gain for this objective
A value that is considered a significant loss for this objective
Unique ID
Currently only numeric types are supported. Might extend with additional types, such as categorial and date
Descriptive name
Range of valid values
Reserved
A regex used to apply formatting on the measure values
Long description
Option status
list of references to solutions which are shadowed by this solution
Option key as reference
list of references to solutions which shadow this solution
detailed description for status value
Low end
High end
Anchor point name
Anchor point position
Text description for status value
Problematic fields in the option that cause this error
Error code
Kappa error
Kappa error for final map
Radius finish
Radius initialization
Radius anchor
Number of iterations
Maximum size of map
Alpha initatlization value
Anchor training ratio
List of possible objectives. Typically, the columns in a table representation of your data
Name of the decision problem. Typically, the name of the column representing the options names in a table representation of your data
A list of options. Typically, the rows in a table representation of your data
The decision problem
The decision problem resolution
X coordinate
Y coordinate
Unique ID
Name
Map of objective key to objective value with the structure, “values”: { “key1”: value1, “key2”: value2 }
Description in HTML format
Reserved
Radius initialization
Radius finish
Radius anchor
Random seed used in the algorithm
Estimated number of neurons in map
Algorithm training iterations
Rate of anchor training
Alpha initialization value
Raw algorithm parameters used for map generation
Derived algorithm parameters used for map generation
Name of the label
Number that represents how strongly the label is recognized in the image