v1
latestOpenAPI 3.0.02026-08-061473373.5 KBAnalyze text (GET)
Analyzes raw text, HTML, or a public webpage.
If a language for the input text is not specified with the language parameter, the service automatically detects the language.
Query parameters
URL-encoded text to analyze. One of the text, html, or url parameters is required.
URL-encoded HTML to analyze. One of the text, html, or url parameters is required.
Public webpage to analyze. One of the text, html, or url parameters is required. url is not supported in IBM Cloud Dedicated instances.
Comma separated list of analysis features
Set this to true to show the analyzed text in the response
Set this to false to disable text cleaning when analyzing webpages. For more information about webpage cleaning, see Analyzing webpages.
An XPath query to perform on html or url input. Results of the query will be appended to the cleaned webpage text before it is analyzed. To analyze only the results of the XPath query, set the clean parameter to false.
Whether to use raw HTML content if text cleaning fails
ISO 639-1 code that specifies the language of your text. This overrides automatic language detection. Language support differs depending on the features you include in your analysis. For more information, see Language support.
Set this to true to return explanations for each categorization. This feature is available only for English language text.
Maximum number of categories to return.
(Beta) Enter a custom model ID to override the standard categories model. This feature is available only for English language text.
Model ID of the classifications model to be used
Maximum number of concepts to return.
Set this to false to hide document-level emotion results
Target strings, separated by commas. Emotion results will be returned for each target string found in the document
Maximum number of entities to return.
Set this to true to return locations of entity mentions
Enter a custom model ID to override the standard entity detection model
Set this to true to return emotion information for detected entities
Set this to true to return sentiment information for detected entities
Maximum number of keywords to return.
Set this to true to return emotion information for detected keywords
Set this to true to return sentiment information for detected keywords
Enter a custom model ID to override the default en-news relations model
Maximum number of semantic_roles results to return
Set this to true to return entity information for subjects and objects
Set this to true to return keyword information for subjects and objects
Set this to false to disable document level sentiment analysis
Sentiment information will return for each target string that is found in the text
Set this to true to return information about the tokens in the input text.
Set this to true to return the lemma for each token.
Set this to true to return the part of speech for each token.
Set this to true to return information about the sentences in the input text.
Sets the maximum number of characters that are processed by the service.
Response
Analysis results
Example response
{
"advanced_rules": {
"Country": [
{
"Country": {
"text": "USA",
"location": {
"end": 23,
"begin": 20
}
},
"Continent": null
}
]
},
"concepts": [
{
"text": "Social network service",
"relevance": 0.92186,
"dbpedia_resource": "http://dbpedia.org/resource/Social_network_service"
},
{
"text": "Thomas J. Watson",
"relevance": 0.871908,
"dbpedia_resource": "http://dbpedia.org/resource/Thomas_J._Watson"
},
{
"text": "Lotus Software",
"relevance": 0.839578,
"dbpedia_resource": "http://dbpedia.org/resource/Lotus_Software"
}
],
"entities": [
{
"text": "Social network service",
"relevance": 0.92186,
"dbpedia_resource": "http://dbpedia.org/resource/Social_network_service"
},
{
"text": "Thomas J. Watson",
"relevance": 0.871908,
"dbpedia_resource": "http://dbpedia.org/resource/Thomas_J._Watson"
},
{
"text": "Lotus Software",
"relevance": 0.839578,
"dbpedia_resource": "http://dbpedia.org/resource/Lotus_Software"
}
],
"keywords": [
{
"text": "curated online courses",
"sentiment": {
"score": 0.792454
},
"relevance": 0.864624,
"emotion": {
"sadness": 0.188625,
"joy": 0.522781,
"fear": 0.12012,
"disgust": 0.103212,
"anger": 0.106669
},
"count": 1
},
{
"text": "free virtual server",
"sentiment": {
"score": 0.664726
},
"relevance": 0.864593,
"emotion": {
"sadness": 0.265225,
"joy": 0.532354,
"fear": 0.07773,
"disgust": 0.090112,
"anger": 0.102242
},
"count": 1
}
],
"categories": [
{
"score": 0.594296,
"label": "/technology and computing/computing/computer software and applications"
},
{
"score": 0.448495,
"label": "/science"
},
{
"score": 0.426429,
"label": "/business and finance/industries"
}
],
"classifications": [
{
"class_name": "temperature",
"confidence": 0.562519
},
{
"class_name": "conditions",
"confidence": 0.433996
}
],
"emotion": {
"targets": [
{
"text": "apples",
"emotion": {
"sadness": 0.028574,
"joy": 0.859042,
"fear": 0.02752,
"disgust": 0.017519,
"anger": 0.012855
}
},
{
"text": "oranges",
"emotion": {
"sadness": 0.514253,
"joy": 0.078317,
"fear": 0.074223,
"disgust": 0.058103,
"anger": 0.126859
}
}
],
"document": {
"emotion": {
"sadness": 0.32665,
"joy": 0.563273,
"fear": 0.033387,
"disgust": 0.022637,
"anger": 0.041796
}
}
},
"metadata": {
"title": "IBM - United States",
"publication_date": "2015-10-01T00:00:00",
"image": "",
"feeds": [],
"authors": []
},
"relations": [
{
"type": "awardedTo",
"sentence": "Leonardo DiCaprio won Best Actor in a Leading Role for his performance.",
"score": 0.680715,
"arguments": [
{
"text": "Best Actor",
"location": [
22,
32
],
"entities": [
{
"type": "EntertainmentAward",
"text": "Best Actor"
}
]
},
{
"text": "Leonardo DiCaprio",
"location": [
0,
17
],
"entities": [
{
"type": "Person",
"text": "Leonardo DiCaprio"
}
]
}
]
}
],
"semantic_roles": [
{
"subject": {
"text": "IBM"
},
"sentence": "IBM has one of the largest workforces in the world",
"object": {
"text": "one of the largest workforces in the world"
},
"action": {
"verb": {
"text": "have",
"tense": "present"
},
"text": "has",
"normalized": "have"
}
}
],
"sentiment": {
"targets": [
{
"text": "stocks",
"score": 0.279964,
"label": "positive"
}
],
"document": {
"score": 0.127034,
"label": "positive"
}
},
"summarization": {
"text": "Today, IBM and Workday, a leading provider of enterprise applications for human resources and finance, announced a joint solution designed to help companies begin the process of safely re-opening their workplaces. Here are five key takeaways from the announcement. The two companies, which have had a partnership since 2011, announced a new solution to help businesses and communities determine when and how to safely open up their workplaces during the ongoing COVID-19 pandemic."
}
}