Clearer controls over entity lookup strategies

23 Aug 2017 entities, news

Today we are making it easier for you to know how Wit finds entities in a sentence. Wit allows you to extract meaning from a user query as a list of entities. We employ various lookup strategies for entities, as described in our docs. Wit can use the following strategies to find entities in sentences:

  • predetermined keywords (keywords strategy)
  • patterns and positions in the sentence where certain words often appear (free-text strategy)
  • common characteristics of the sentence as a whole (trait strategy)

You usually don’t have to worry about lookup strategies, but sometimes it can come in handy to understand and tweak how Wit detects entities.

To keep Wit’s core experience robust and simple, we made these updates:

  • When you first validate a sample (either in Console or via the POST /samples API), Wit finds the right lookup for your entity: keyword, free-text, keyword & free-text or trait without you having to select it yourself.
  • If an entity is being misused (i.e. forgetting to highlight a keyword), Wit detects this and alerts you at validation time.
  • You can change the lookup strategy for a given entity in the Understanding tab, in a more intuitive way.
  • If you are about to update a lookup strategy, you will be prompted to confirm your decision, ensuring that you didn’t make the update unintentionally.

We’re happy to make these updates based on the feedback we’ve received from our community. Thank you for your support, and as always, we look forward to hearing how we can continue to improve your experience with Wit.

Team Wit

Introducing Insights, a way to better understand your app performance

08 Aug 2017 entities, news

Today, we’re releasing Insights to help you better understand and iterate upon the performance of your Wit app. As a first step we are launching a tool within Insights that makes it easier to set the confidence level for your Wit entities.

Over the past year we have received great feedback from our community, and this release is the next step in our efforts to make our NLP API more accurate, reliable and scalable for everyone.

You will now find a new Insights section on the entity page in the Wit console. If you have validated enough data with your bot, this section will show how your Wit models perform at different confidence thresholds. To start, you will be able to measure precision and recall for your Wit entities, allowing you to assess the confidence levels for both the accuracy and frequency at which you are able to identify an entity.

This allows you to pick the confidence threshold depending on what you want to optimize. More info here.

This is just the beginning, we will be adding more Insights in the future to help you better understand your app’s performance and improve its quality. As always, feel free to reach out if you have any questions, comments, or suggestions.

Team Wit

Launching Built-in NLP for Messenger and Sunsetting Bot Engine (beta)

27 Jul 2017 entities, news

We have a few updates to share with you today - most exciting is the launch of Built-in NLP for Messenger, launching with Messenger Platform 2.1 just released today.

By testing and learning from our Bot Engine beta, we determined that it made the most sense to refocus on pure NLP to make it accurate, reliable and scalable for everybody. As a result, we’re sunsetting Bot Engine and will deprecate the Stories UI for new apps starting today. We will also stop serving requests to the associated /converse endpoint on February 1, 2018.

Built-in NLP

Over the past year, we have received a lot of questions and feedback on how to integrate NLP into bots for Messenger. Currently, if you are leveraging an NLP API, it is an additional layer that adds both latency and complexity. We believe almost every bot should use NLP in some way to create delightful experiences. Today, we are excited to make this easier by integrating Wit directly into the Send/Receive Messenger API.

When Built-in NLP is enabled, it automatically detects meaning and information in the text of messages that a user sends, before it gets passed to the bot. This first version can detect the following entities: hello, bye, thanks, date & time, location, amount of money, phone number, email and a URL. This is the first step in bringing NLP capabilities to all developers. Learn more.

Sunsetting Bot Engine

Most of you may know that we created Bot Engine at the beginning of 2016 to help developers build text-based conversational bots. At that time, NLP was still new to many, the bot ecosystem was small and developers did not have the tools we have today (e.g. Chatfuel, Botpress, etc.).

Bot Engine was designed for complex text-only transactions because messaging platforms did not have GUI (Graphical User Interface, like webviews) elements then. The idea was to replace forms with conversations. However for many use cases, a dialog does not provide the pleasant user experience you get with a GUI (constant visual feedback, ability to modify previous choices, etc.).

That’s why in the last year, the ecosystem has shifted towards a mix of NLP and GUI elements to produce a user experience on par with native and web apps. For instance, Messenger has introduced quick replies, menus and even web view. As a result, Bot Engine and its emphasis on text-only bots has become somewhat obsolete.

Upon reviewing the top apps using Stories, we’ve mainly seen apps using 1-turn stories. These FAQ-like apps can easily be achieved with our NLP endpoint (/message) because it’s about understanding the question and then mapping the user intent to an answer that can be stored outside of Wit. Example here. These apps don’t need the power and complexity of Stories (having to do 4 calls on average to /converse to get to an answer as opposed to 1 single call for /message). The recommended migration is to use /message and code on your side to manage the conversation and link to the answers that would be stored in your database.

The numbers talk for themselves. Since the launch of Bot Engine in 2016, we have seen our community grow from 20,000 to more than 100k developers. Most of them build bots for Messenger, Slack, Telegram, and other platforms and use our NLP API (/message). Currently, more than 90% of the Wit API calls are coming from our NLP API.

This is why we are deprecating Bot Engine and the Stories UI today, and will stop serving requests to the associated /converse endpoint on February 1st 2018 to give developers enough time to migrate affected apps. Please check our GitHub tutorial for more details.

We want to make NLP work really well, at scale. This lets developers focus on building the best possible user experience, be it conversational, or hybrid NLP/GUI. This is why we have scaled our /message endpoint to make it easy to programmatically interact with Wit.

Moving forward, we are working on:

  • improving the quality of our NLP by leveraging cutting-edge algorithms developed at Facebook
  • making it easy to share, reuse, and collaborate on entities from the community
  • helping other platforms leverage our NLP API behind the scenes

As always, feel free to reach out if you have any questions, comments, or suggestions.

Team Wit

Open Sourcing our new Duckling

01 May 2017 open-source, news, community

Wit relies both on machine learning and rules-based systems. One of these rule-based systems is Duckling, our open-sourced probabilistic parser to detect entities like dates and times, numbers, and durations. Due to our extensive growth, Duckling was not scaling as fast as we were. After considering several options, we decided to go with a rewrite in Haskell.

Why Haskell?

We were looking for a performant language with a strong support within Facebook. Two natural candidates emerged: C++ and Haskell.

A strength of Duckling is the simple domain-specific language (DSL) we provide to write rules. It allows us to get amazing open-source contributions in languages that we don’t speak. Haskell is notoriously one of the best choices out there to provide a type-safe DSL, whereas C++ would have required ninja coding skills (which we don’t have) to do the same without segfaults!

Haskell is highly scalable (it powers Facebook’s Sigma service, serving millions of requests per second) and offers type safety. Haskell is a purely functional and very expressive language. This makes it the perfect choice for Duckling!


Our main purpose in rewriting Duckling was scalability. We have been working a lot on improving the core engine algorithms as well as the time module internals, which is by far our most complex component. There is still plenty of room for improvement, but Duckling is more efficient than ever. As an example, Duckling is now used at scale internally by Facebook.

Due to Haskell’s strong type system, we had to get rid of our free-form Clojure maps. The end result is a more structured and readable codebase.

We have started housing language-agnostic rules under a common umbrella. As a result, each new language gets a basic support for amounts of money, emails, phone numbers and URLs for free.

Farewell, Clojure

In order to get us up and running quickly on Haskell, we are deprecating the Clojure library today and we will commit those resources into making the Haskell version word class. The new Duckling is up-to-date with the latest Clojure code.

Because we want to make sure the transition is smooth, we are providing a standalone HTTP server to get Duckling results as JSON.

Thank you

Since we’ve open-sourced Duckling two years ago, our Wit community has contributed in many languages and driven real world usage, enhancing Duckling’s capabilities. Thank you to all our contributors who help make Duckling more robust and polyglot for everyone!

Duckling is now available on GitHub.

You can start diving into the new codebase today. To give you a head start:

# Clone the repository
$ git clone && cd duckling
# Install Stack
$ curl -sSL | sh
# Compile and run the example
$ stack build && stack exec duckling-example-exe
# Run the tests
$ stack test

We are looking forward to see how you will use it, help extend the rulesets to make Duckling more robust, and teach it new languages.

Team Wit

Hello, thanks and bye!

26 Apr 2017 entities

Today, we’re releasing in Beta 3 new built-in entities that many of you have requested:

  • wit/greetings
  • wit/thanks
  • wit/bye

These binary entities are of type trait and will help you detect when people say hello, bye or thanks to your app!

Why trait? As you probably know, trait entities are entities that are spanless. Like the classic “intent” entity, trait entities are determined by the sentence as a whole rather than one or certain other words in the sentence. For example: “I’ll see you later”, “see you later”, “bye bye” and “goodbye” are examples of the wit/bye entity.

Why binary? They only have one value that’s “true”. So either the sentence has this meaning and the value=true or the sentence doesn’t have this entity. We’ve always wanted to do multiple intent detection and now binary trait entities allow you to detect multiple intents in a query.

We hope you’ll like these new entities. Since they still need a bit of training, they’re being released in Beta for English. Use them in lieu of your custom intents. As with any built-in entities, they’ll be leveraging all the Wit apps that use them and will be much more inclusive and accurate over time.

As always, feel free to reach out if you have any questions, comments, or suggestions.

Team Wit