Search code examples
ibm-watsonconcept-insights

Meaning of the text_index parameter in the Concept Insights annotateText call?


The example /annotateText Concept Insights call provides the following example output:

curl -H 'Content-Type: text/plain' -d 'IBM announces new Watson services.' 

'https://watson-api-explorer.mybluemix.net/concept-insights/api/v2/graphs/wikipedia/en-20120601/annotate_text'

{
  "annotations": [
    {
      "concept": {
        "id": "/graphs/wikipedia/en-20120601/concepts/Watson_(computer)",
        "label": "Watson (computer)"
      },
      "score": 0.99832845,
      "text_index": [
        18,
        24
      ]
    },
    {
      "concept": {
        "id": "/graphs/wikipedia/en-20120601/concepts/IBM",
        "label": "IBM"
      },
      "score": 0.9980473,
      "text_index": [
        0,
        3
      ]
    }
  ]
}

What is the meaning of the text_index parameter that is being returned?


Solution

  • text_index tells you the start and end position where the identified concept is.

    In your example, the concept IBM_Watson was identified in the snippet IBM announces new Watson.