NLPCraft is an open source library for adding a natural language interface to any applications. Think Amazon Alexa that is developer friendly, can work with any private data source, and has no hardware or software lock-in while giving you more NLP powers.
It's important to note that NLPCraft is a pure software library and doesn't require any specific hardware. It also doesn't deal with voice-to-text conversion as we consider this problem solved outside of this project - NLPCraft simply accepts textual input irregardless of where it came from.
How does it work in a nutshell?
When using NLPCraft you will be dealing with three main components:
NLPCraft employs model-as-a-code approach where data model is simply an implementation of
NCModel Java interface that can be developed using any JVM programming language like Java, Scala, or Groovy. Data model implementation defines how to interpret user input, how to query or control a particular data source, and finally how to format the result back to the user. Model-as-a-code natively supports any software life cycle tools and frameworks in Java eco-system.
Typically, declarative portion of the model will be stored in a separate JSON or YAML file for simpler modifications. There are no practical limitation on how complex or simple a model can be, or what other tools it can use. Most data models will also use intent-based matching provided by NLPCraft out-of-the-box.
Here's an example of the absolutely minimal data model that simply returns the same answer back for any user input:
NCModelBuilder.newModel("id", "description", "1.0") .setQueryFunction(ctx -> NCQueryResult.text("Hello World!")) .build()
To use data model it has to be deployed into data probe.
Data probe is an application designed to securely deploy and manage data models. Each probe can deploy and manage multiple models and many probes can be connected to the REST server. The main purpose of the data probe is to separate data model hosting from managing REST calls from the clients. While you would typically have just one REST server, you may have multiple data probes deployed in different geo-locations and configured differently.
Data probes can be deployed and run anywhere as long as there is an outbound connectivity, and are typically deployed in DMZ or close to your target data sources: on-premise, in the cloud, etc. Data probe uses strong 256-bit encryption and ingress only connectivity for communicating with the REST server.
REST server (or a cluster of REST servers behind a load balancer) provides URL endpoint for user applications to securely query data sources using NLI via data models deployed in data probes. Its main purpose is to accept REST-over-HTTP calls from user applications, manage connected data probes, and route user requests to and from requested data probes.
There's a subtle yet important difference between chatbot platforms and systems like Alexa, Siri or NLPCraft.
Many, if not most, of the chatbot systems, are designed for dialog driven conversations. In fact, it is chatbots that heavily promoted the term "conversational". These systems allow to script or otherwise design a long-winded flow of simple questions and answers to determine the user's intent - hence the notion of the conversational interface. For many simple use cases this leads to a relatively straightforward implementation and sometimes a long Q&A is a necessary approach. However, this type of system suffers badly from parasitic dialogs - the condition where long Q&A sessions induced by this design feel contrived, cumbersome and unnatural to the actual users resulting in a significant reduction of chatbot adoption.
Alexa, Siri, Goole Assistant or NLPCraft concentrate on the understanding of more complex, nuanced natural language, often referred to as a spoken or free-form natural language. While these systems may not be as simple as basic chatbots they dramatically minimize or even eliminate the parasitic dialogs. These systems enable true natural language command-oriented control where unnecessary dialogs reduced to a minimum and users can get to the desired result in the shortest, the most efficient way.
One of the additional unique characteristics of NLPCraft is that it is hardware or software independent. You are not locked in into iOS or Android or Amazon AWS ecosystems.
NLPCraft uses both Apache OpenNLP and Standford CoreNLP as its basic NLP engine (configurable as either one). Basic NLP engine is responsible for tokenization, lemmatization and optional named entity recognition. NLPCraft uses these in its own processing workflow including advanced semantic modeling and intent-based matching.