4 ms·
Speaking about chat bots. There are the usual simple bots based on keywords and simple fixed coded branches. But for more advanced bots, that uses NLP (eg Stan
by frik 10y ago
Speaking about chat bots. There are the usual simple bots based on keywords and simple fixed coded branches.
But for more advanced bots, that uses NLP (eg Stanford's CoreNLP). What's the next step? What do you do with input sentence, each word labeled as noun, adverb, person, company, etc ? I imagine a list of sentence structure templates and calc the probability. This step is only very briefly and vaguely mentioned in literature (books, papers).
Can you recommend some blogs, sample code, tutorials that explain that step, how resonate based on NLP lib? And where machine learning comes in, to improve the trained data?
- Rabidgremlin 10y agoCheck out https://github.com/rabidgremlin/Mutters https://github.com/rabidgremlin/Mutters It uses ML to figure out the "intent" of what the user has said (using a document classifier) and named entity recognition (NER) to extract data from the text (date, location etc). That is actually the easy part. The harder part is the conversation scripting and state handling. Mutters uses the Ink narration engine (originally designed for dialogue heavy games) for this. It works pretty well. IMHO :)
- hallman76 10y agoCool - thanks for sharing! I played around with Mycroft's Adapt Intent Parser[0] a couple weeks ago. It's written in Python. I was looking for something open source to replace IBM Watson's Conversation API. With Mycroft working I quickly realized that I'd need some way to deal with state handling and conversation branching. I don't think Mycroft has a counterpart to the Ink narration component - I'm really curious to dig into that! [0] https://github.com/MycroftAI/adapt https://github.com/MycroftAI/adapt
- samcodes 10y agoOther services and projects: There are hosted services like API.ai, wit.ai and Microsoft LUIS. Init.ai has NLP built into their bot building platform. Rasa NLU is an open source NLP project that is very interesting.
- adamra 10y agoI'm curious if some of those platforms allow to write custom code for processing of the raw message. Either to embed the code directly on their server or to expose a custom webhook. For instance, if I were to write such a diagnostic chatbot as described in the article but would prefer to use a service such as those to take care of the integrations with various platforms, message queueing, tracking basic stats etc.
- doomsdaychicken 10y agoI'd like to know this too. I experimented with Pythons nltk library, but it's definitely a different world out there than simple programming.
- metachris 10y agoCheck out api.ai, for instance the demo in this video: https://www.youtube.com/watch?v=9SUAuy9OJg4 https://www.youtube.com/watch?v=9SUAuy9OJg4
- bduerst 10y agoI was just reading their concepts this morning: https://docs.api.ai/docs/concept-agents https://docs.api.ai/docs/concept-agents Do the agents actively process NLU out of the box, or is that something you need to train yourself?
- riyadparvez 10y agoI work for chatbot building platform: http://deeppixel.ai/ http://deeppixel.ai/. We use state-of-the-art ensemble of deep learning algorithms that try to understand the meaning of sentences by taking the whole sentence as well as bag of words/bag of ngrams. In addition to that, we use classic NLP techniques like POS tagging, constituency parsing, dependency parsing, Named Entity Recognition (NER), clustering.
- deet 10y agoThere are custom-built bots that use tools like CoreNLP. They tend to not use any framework. But, most NLP-powered bots are using machine learning based NLP APIs rather than CoreNLP. These tend to do two functions: intent determination and slot detection. Intent determination means finding the overall meaning of a message. Slot detection means locating and extracting important terms (not just standard NER) within a message. Both happen based on examples provided by training data that is used to train a machine learning model. The difference intent determination and keyword-detection is that ML based intent determination is much more resistant to different ways of saying the same thing. If you search the ML research for intent determination and slot filling you will find various techniques to do it, from CRFs to CNNs to RNNs. Example: "I want to find a flight from London to New York" => Intent: find_flight, City.Departure: London, City.Arrival: New York That set of information will then be passed to program code to determine the response. (generalization:) Right now, most code will generally map intents and conversation state to a branch of code and will have code that takes specific action based on the current conversation state. Whenever slots are detected, those get stored to conversation state. As the user types each message, the process repeats. The logic is generally either structured as a tree or as something that resembles a state machine. Examples are Microsoft's Bot Framework, Wit.ai's SDK, Init.ai's conversation logic, etc. (the future) The machine learning model can be adapted to predict the next message type if it's trained on sequences of messages. At Init.ai we do that, where in addition to classifying the current message and extracting slots, the machine learning model predicts who (which person or computer) will send the next message and what type it will be. That enables the bot developer to not have to write code and let the prediction system select text to send as appropriate. In the future you'll see other things that make it easier, where the machine learning system starts using more of the conversational content to make more accurate sophisticated predictions of what actions to take and messages to send. For example, some new ML research is around automatic question-answering based on a dataset, and that could be used to make bots respond automatically based on information. So over time it will get easier for developers as the ML progresses.
- frik 10y agoVery insightful, thanks!
- Joeri 10y agoAs an alternative to building it yourself you can rely on services that do this for you. I've been using the microsoft bot framework together with the luis.ai (azure) service for natural language parsing. Works really well in my experience. It supports bimodal operation where first a regex is attempted and then as a fallback the sentence is passed to the NLP service to parse into action/entities. I can really recommend the microsoft bot framework even without the natural language parsing. It plugs into a range of chat platforms, including sms and email, and you're free to build your bot with node or .net. I went with node and have been pretty happy with it so far.