'How to get the original entity value from Wit.Ai?

I was wondering if there is a way to also return the original value of an entity from Wit.Ai.

For instance, my entity "states" correctly maps the misspelled and lower case word massachusets to Massachusetts. But it does not return the original word. So, I cannot easily tag the incorrect word.

{
  "msg_id": "a6ac0938-d92c-45f4-8c41-4ca990d83415",
  "_text": "What is the temperature in massachusets?",
  "entities": {
    "states": [
      {
        "confidence": 0.7956227869227184,
        "type": "value",
        "value": "Massachusetts"
      }
    ]
  }
}

I really appreciate if you know how I can accomplish that with Wit.Ai.

Thanks



Solution 1:[1]

Keep the search strategy of "states" as free-text & Keywords. This way you can extract the original word in the message. Declaring it as keyword matches it with the close one and returns that keyword where as if it is a free-text it returns original word in the message.

Solution 2:[2]

You may have to train wit each time to do so, by highlighting "Massachusetts" as a resolved value. This will make wit understand that you do not agree with the autocorrection.

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Ravi Teja
Solution 2