Within the field of artificial intelligence, I specialize in natural language processing (NLP). According to SAS, "NLP is a branch of artificial intelligence that helps computers understand, interpret and manipulate human language. NLP draws from many disciplines, including computer science and computational linguistics, in its pursuit to fill the gap between human communication and computer understanding." Within NLP, I then further focus on conversational interface design and development.
Over the years, I captured NLP experience wherever possible. I've been lucky enough to be involved on many projects throughout the sales life cycle and solutions delivery process. I've created marketing materials and sales proposals that won work in the area of NLP. I've also architected and led the development of NLP systems. In this post, I'll share some system and process designs that I've created along my career journey.
High-Level Text Mining Process
I created this design to provide a simple overview of the types of data that can be processed and how that data can be processed. It was used in a sales conversation with Apple.
Chatbot Development Phases
I created this design to describe the features stakeholders can expect a bot to have during different phases of development. The software development life cycle can be applied to chatbots. With each iteration, the system becomes more and more intelligent!
A Cloud Bot Architecture
This diagram describes the architecture I used to build Neona. Each of these components plays a powerful part in the complete composition.
Azure
An open, flexible, enterprise-grade cloud computing platform. Neona uses Azure Functions to process events with a serverless code architecture. These functions are responsible for extracting data from Wikipedia, processing it into the desired form, and storing it in Cosmos DB.
Node.js
An event-driven I/O server-side JavaScript environment. The Azure Functions were written in Node.js. It was used to call the MediaWiki action API, a web service that provides convenient access to wiki features, data, and meta-data over HTTP. Using Node.js’ request module (and JavaScript Promises), the API is called with very carefully constructed queries to return just the data Neona would need.
Cosmos DB
A distributed database service for managing JSON documents at Internet scale. It is a highly-flexible key-value store that integrates closely with other Microsoft systems. It is Neona's knowledge-base.
Azure Search
A fully managed search-as-a-service in the cloud. It indexes the contents of the knowledge-base and provides an HTTP endpoint Neona can hit to query the knowledge-base. It natively supports Cosmos DB.
Bot Framework
This framework provided an impressive amount of functionality and was the inspiration for this project. For Neona, it provides the connection to the various channels, manages incoming and outgoing messages, and helps orchestrate the dialogue flow. It also integrates naturally with LUIS, a fast and effective way of adding language understanding to applications.
You can learn more about Neona in my portfolio post about her.
Bot-to-Human Handoff
A common request from customers is to design systems where humans can take over the conversation when necessary.
System Requirements
There are several things to consider when transitioning to a human.
User Scenarios
User scenarios may include triage, escalation, and supervision.
Transition Initiation
The transition could be initiated by the user, the agent, or an automated system.
Transition Detection
The chat bot could automatically detect when a transition needs to occur based on sentiment analysis or by detecting certain entities or intents.
Type of Human Interaction
The human could engage via a support ticket, phone, text, or a chat platform.
System Architecture
Here is a technical architecture diagram I created for a bot-to-human hand-off system built on Microsoft Azure.
Features
- A dashboard for agents to view live conversations where the agent can take control if necessary.
- Custom middleware to connect users and agents together.
- A database of conversations where you can perform in-house analytics.
Knowledge Transfer Module
While working at Decooda, I built a system, called the Knowledge Transfer Module (KTM), for automating the labeling of data. The KTM creates high-quality training data at enterprise scale. It helps train, test, and tune machine learning algorithms for everything from search relevance and sentiment analysis to conversational agents.
By annotating data with this system, business analysts were able to contribute to our knowledge base and improve the quality of predictions made by Decooda’s machine learning classifiers.
Application Architecture
The client application was a native application that initially targeted Windows and Mac desktops with Android and iOS mobile support to follow. I wanted to use a technology stack and architecture that lends itself easily to rapid, iterative development. Any frameworks, libraries, and languages I chose not only needed to be reliable and easily maintainable, but also leading edge and feature rich. This required a careful balance. I wanted to use the best production-ready tools out there, but also wanted to create a technology stack that will have broad community support for years to come.
Electron
“Electron is a framework for creating native applications with web technologies like JavaScript, HTML, and CSS.”
https://electronjs.org/
Electron allowed us to take advantage of the massive web development ecosystem while developing a cross-platform (Mac, Windows, and Linux) desktop application. It not only allowed us to use any front-end development libraries or frameworks to create the user interface, but also allowed us to take advantage of Node.js and its package ecosystem for running more complex processes (like data processing) on the client machine. Plus, since Electron is essentially a container for a client-side web application, the code was written in a way that made it portable to other platforms. This allowed for an easier migration as we targeted web applications. Eventually, we'll also be able to target native mobile applications through tools like React Native.
JavaScript, HTML, CSS
The three standard powerhouse languages of the modern web were used to develop the client application. This allowed for common web tooling and design patterns to be applied to the application, improving the speed and ease of development. JavaScript was used for things like application logic, state management, and generating UI components. By also exploiting the availability of Node.js and its package ecosystem (the world’s largest ecosystem of open source libraries) through Electron, JavaScript performed even more complex computation as necessary. Of course, HTML was used to define the structure of the page and CSS was used to describe the presentation.
React
“A JavaScript library for building user interfaces.”
https://reactjs.org/
Since Electron supports the standard web stack, React was a perfect fit. React helps developers create reusable UI components while also encouraging good software design patterns like proper encapsulation and separation of the state from the DOM. To make applications more interactive, React updates and renders the view as data changes. React positioned us well to share any UI components we created with any future web applications we build with React or with any mobile applications we build with React Native. We were also able to exploit React's vibrant community of open-source libraries and reusable components during development.
Conclusion
With almost a decade in the AI space, life has thrown a lot of awesome experience my way. I'm excited to continue building my expertise in natural language processing and machine learning. There is so much potential ahead!