Reintroducing Composite Entities

28 Mar 2017 entities, feature

We introduced composite entities on May 2015 but had to remove them temporarily due to the launch of Bot Engine last year. Many of you asked us to reintroduce them since then. And you have been super patient ;-)

Today, composite entities are back.

Composite entities are spanful entities which have entities within them. For example, you can have “2014 grey Pilot” as a car entity and “Pilot” as the model, “grey” as the color, and “2014” as the year.

Composite entities are trained just like regular entities. First, select the entire span of the composite entity and assign it to a new entity just like you would before. Then, select spans within the tagged entity and tag them as any entity you want (user-defined or provided by Wit).
Reminder, Wit will only process one level of composite entities; you cannot have a composite entity within another composite entity.

In the API response, entities found within composite entities are returned as a list under the field “entities” and are formatted just like regular entities. An example response is below.

{
  "entities": {
        "car": [
          {
            "confidence": 0.9640414518519875,
            "entities": {
              "number": [
                {
                  "confidence": 1,
                  "value": 2014,
                  "type": "value"
                }
              ],
              "color": [
                {
                  "confidence": 0.8704987399812729,
                  "type": "value",
                  "value": "grey"
                }
              ],
              "model": [
                {
                  "confidence": 0.8651929702460204,
                  "type": "value",
                  "value": "Pilot"
                }
              ]
            },
            "type": "value",
            "value": "2014 grey Pilot"
          }
        ],
        "intent": [
          {
            "confidence": 1,
            "value": "find_car"
          }
        ]
      }
}

As always, feel free to reach out if you have any questions, comments, or suggestions. We’re working hard to make Wit smarter and way more robust, see our community update. This is one step in this direction, expect more in the near future!

Team Wit