Topic Extractor
https://analytics.babelstreet.com/rest/v1/topics
https://raw.githubusercontent.com/rosette-api/curl-examples/develop/examples/topics.curl
Topic Extractor extracts the most salient themes of a piece of text, and is useful for summarizing documents.
Given an input, both a list of concepts and a list of keyphrases are returned. Concepts are higher level topics implicit in the text, but which may or may not actually appear in the text. Keyphrases are found in the text and representative of the overall content.
Query Parameters
Name | Value | Description |
---|---|---|
output | rosette | Returns the response in ADM format. |
Note
All input parameters, including the text being analyzed and any relevant options, are defined in the request body.
Request
Both keyphrases and concepts are returned with a salience value between 0 and 1, indicating how relevant the result is to the overall content of the text. You can suppress results with a salience value lower than a given score. The threshold salience values for keyphrases and concepts are independently configurable.
Option | Type | Description | Default |
---|---|---|---|
| number | Value of salience below which concepts are not returned. | 0 |
| number | Value of salience below which key phrases are not reurned. | o |
{ "content": "string", "language": "string", "options": { "conceptSalienceThreshold": 0, "keyphraseSalienceThreshold": 0 } }
Response
Both keyphrases and concepts are returned with a salience value between 0 and 1, indicating how relevant the result is to the overall content of the text. The user can suppress results with a salience value lower than a given score. The threshold salience values for keyphrases and concepts are independently configurable.
{ "concepts": [ { "conceptId": "string", "phrase": "string", "salience": 0 } ], "keyphrases": [ { "phrase": "string", "salience": 0 } ] }
Supported languages
GET /topics/supported-languages
Returns the list of supported languages and scripts for the endpoint, along with whether you have a license for the language.
Language | Code |
---|---|
English |
|
Response
Field | Type | Description |
---|---|---|
| string | ISO 639 language code |
| string | Four-letter ISO-15924 script code |
| boolean | Indicates if you are licensed for this language |
{ "supportedLanguages": [ { "language": "string", "script": "string", "licensed": boolean } ] }