AI in ServiceNow with Microsoft's LUIS
I watched a colleague do a demo of Microsoft's Language Understanding Intelligence Service (LUIS) recently and immediately got excited about what I could do with it and ServiceNow. The main idea that left the session with me was to set up a portal that would allow users to input a question or request; be redirected to a location based on their need; and if redirecting to a form, pre-populate fields for which the user had already provided information.
Here's a quick video of the portal in action:
The concept built here is pretty simple:
- Take a question or request from the user.
- Query the LUIS REST API with the user's question.
- Take the response from LUIS and respond based on the intent and entities provided. I'll get into what those are below.
- Direct the user to an appropriate location or respond locally based on the question.
LUIS can be configured to use Bing's spell check to account for spelling variations and when "trained" does not depend on specific syntax in the question or request from the user. It responds based on the understood intent of the user. I'm not an expert on LUIS, but here are some basic things that I configured in my LUIS app to set up this integration:
- Intents. These are just what they sound like--reflections of what the user is attempting to ask or accomplish. Do they intend to order a new laptop? To reset a password? To order lunch?
- Entities. These, as I understand them, are details about the statement being made. What model of laptop does the user want? Which password did they forget? What toppings does the user want on the lunch sandwich?
- Pre-built Entities. Microsoft provides certain pre-built entities for capturing content like dates, temperature, locations, and many other details.
My app has a couple of intents in addition to the "None" catch-all: Laptop and Password Reset. In order to help LUIS match user input with one of these intents, I used the training feature within the LUIS application. To train LUIS, you input a variety of phrases (questions, requests, etc.) that match your intent along with appropriate details to map to entities. Once you're getting reliable results (as indicated by LUIS properly matching your intent, automatically finding and mapping your entities, and giving you a relatively high intent score), you can click the button to train your app and publish it. I did find it a bit non-intuitive that you have to push updates to your app by clicking on the "Publish" button every time you do additional training.
On the ServiceNow side, I set up a basic Service Portal with a widget that accepts user input, makes an $http call to the LUIS REST API, and responds or redirects the user based on the reply from LUIS. My mappings are definitely in the POC tier of quality and not production-ready. The logic does matches against the intent options, looking for a score above 0.6. If the match is "None" or has a lower score, the app responds with an "I don't understand" message. As far as setting specific fields on any catalog item targets, I took advantage of a script from Brad Tilton's blog article here. On the sending side, the parameters are defined based on entities returned from LUIS.
LUIS is in beta, so don't go throwing anything into your production environment yet, but the concept carries some awesome possibilities!
Follow me on Twitter @cloudyrobert.
Great! I will wait for your next post to know about all.
ServiceNow Leader and Architect | CTA | CIS x6 | CAD | CSA
8 年Hi Shamma--no plugin. I can do another post on how I put it together if there's interest.
ServiceNow Technical Architect | Rising Star?2024 | Arch X Certified | Custom Integration/Flow Designers/HRSD/CSM/Workspace
8 年awesome..is it a plugin or what?