{"action":"opened","issue":{"url":"https://api.github.com/repos/wit-ai/wit/issues/171","labels_url":"https://api.github.com/repos/wit-ai/wit/issues/171/labels{/name}","comments_url":"https://api.github.com/repos/wit-ai/wit/issues/171/comments","events_url":"https://api.github.com/repos/wit-ai/wit/issues/171/events","html_url":"https://github.com/wit-ai/wit/issues/171","id":59912247,"number":171,"title":"Highlighting for spanned entities","user":{"login":"jeffklassen","id":7376576,"avatar_url":"https://avatars.githubusercontent.com/u/7376576?v=3","gravatar_id":"","url":"https://api.github.com/users/jeffklassen","html_url":"https://github.com/jeffklassen","followers_url":"https://api.github.com/users/jeffklassen/followers","following_url":"https://api.github.com/users/jeffklassen/following{/other_user}","gists_url":"https://api.github.com/users/jeffklassen/gists{/gist_id}","starred_url":"https://api.github.com/users/jeffklassen/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jeffklassen/subscriptions","organizations_url":"https://api.github.com/users/jeffklassen/orgs","repos_url":"https://api.github.com/users/jeffklassen/repos","events_url":"https://api.github.com/users/jeffklassen/events{/privacy}","received_events_url":"https://api.github.com/users/jeffklassen/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":0,"created_at":"2015-03-05T06:41:08Z","updated_at":"2015-03-05T06:41:08Z","closed_at":null,"body":"It would be great to include a 'highlighting' mechanism for spanned entities. This would allow us to have our users be able to validate returned outcomes. \r\n\r\nRather than a returned entity object simply containing the extracted entity, an entity object could contain a pointer to the original text used to derive that entity.\r\n\r\nConsider the following (100% correct) outcome:\r\n\r\n```javascript\r\n\"outcomes\": [{\r\n   \"_text\": \"remember to call Ryan tomorrow night\",\r\n   \"intent\": \"add_reminder\",\r\n   \"entities\": {\r\n    \"datetime\": [{\r\n      \"to\": {\r\n       \"value\": \"2015-03-07T00:00:00.000+01:00\",\r\n       \"grain\": \"hour\"\r\n      },\r\n      \"from\": {\r\n       \"value\": \"2015-03-06T18:00:00.000+01:00\",\r\n       \"grain\": \"hour\"\r\n      },\r\n      \"type\": \"interval\"\r\n     }],\r\n    \"contact\": [ {\r\n      \"value\": \"Ryan\"\r\n     }]},\r\n   \"confidence\": 1\r\n  }]\r\n```\r\nWhy not make the datetime entity look like this (notice the last object property):\r\n```javascript\r\n    {\r\n      \"to\": {\r\n       \"value\": \"2015-03-07T00:00:00.000+01:00\",\r\n       \"grain\": \"hour\"\r\n      },\r\n      \"from\": {\r\n       \"value\": \"2015-03-06T18:00:00.000+01:00\",\r\n       \"grain\": \"hour\"\r\n      },\r\n      \"type\": \"interval\",\r\n      \"original_text\": \"tomorrow night\"\r\n     }\r\n```\r\nand the contact entity look like this: \r\n```javascript\r\n    {\r\n      \"value\": \"Ryan\",\r\n      \"original_text\": \"Ryan\"\r\n     }\r\n```\r\nThis would obviously only work for spanned entities.\r\n"}}