Wednesday, October 18, 2017

Immersive And Conversational Apps And Why Improper Design Will Hurt Your Customer Experience...

As  we  are  seeing  that   emerging  trends  suggest  total  new  channels  and   new  ways  of user experience which mainly  point  to  the  technologies .

  • Conversational Platforms
  • Immersive Experience
These  trends   make  several  customer  facing  organizations  to  adapt  them  to  make  a difference for themselves.  However  some  of  these  efforts  like  introducing  automated  BOTS  or  Cortana based  applications  as  part  of  your  customer  interactions  needs  to be  planned  carefully.

Lot  of  us  would  have  seen  the  epic fail  of  Cortana  in a  large  conference,  while  that  is a  smaller  issue  may  be due  to  crowds clapping  and  laughing  in the  back  ground  and  the  Cortana would  not  have  understood  the  voice  fully.  But  the  bigger  issue  is  that   the  customer  is  not there  to  experiment  on  voice  conversations  or  chat  conversations  unless  they  are so  natural  and  fully understand  customer  intent  and  help  him.

Most  of  the  time  we  hear  customers  saying  that,  "I  could  have  typed  or  clicked  the  screens  faster"  than  going  through  a  so called  intelligent  or  smart   application  which  still  has  not understood   what  I  really  want.

So  the bottom  line  is  that  your  Voice  Based  Applications  as  well  as   Chat based  BOT  applications  should  include   within  them  lot  of  intelligence,  so  that  they  really  help the customers  in  what  they  are  looking  for  and  not  serve the  function  of  a  experimentation  tool where the customer  has  to  really  talk  or  type  only a  few  exact  sentences  and  then the  system  does  the work.

Microsoft BOT Framework :     BOT is basically  an intelligent  application hosted on Azure  that  will  let it's consumer  interact  with it in a  conversational  way, mainly  using  chat based interface, however it  will also support  voice  and  form  based  inputs  also.  BOTS guide  the  user towards a  solution and typically  are useful  when  we don't  know the user intent  and let  him to  choose from a  free form of  ideas.

There  are  multiple  ways  we  can  build  BOTS  using  Microsoft  framework.
  1. Using Azure  BOT  Service  which  provides  an end to end  integrated environment for  building, testing  and deploying  BOTS. Lot of the BOT Management activities are automated in this option and  makes  it easier for building less complex  BOTS
  2. BOT  Builder is an Open Source framework  and  uses  traditional  Visual Studio IDE to develop  BOTS  using  standard  programming  approach. BOT Builder SDK is available for both .net  and  Node Js.
Using Industry Standard Design Principles :    As  always  in the design  of  any  "user interface related" computer program  lot  of common sense is  needed in building BOTS  also. BOTS are not meant to  show  cause  a  technological  feature  but  more  about  ensuring  that  user  is able to finish their  work  easily and  able  to  get  best  out  of the  interaction.

Also  Microsoft  has  provided  guidelines  on  wrong  usage  of  conversations  using  BOT  Technology,  some  of the guidelines are below.

  • First Interaction with the customer is important  and  it  should  not provide an unlimited and open ended options such that  customers  may  get  lost  in the conversation. Most times as an organization we  know  our  list  of  services  and  let the user to narrow down what  he/she requires  will be an better usage.
  • Guidelines  warn  against  building  what  is known as "Stubborn Bot"  which does  not  let user to change the  track  during the course  of  transaction  and  makes the user frustrated. For example  in a  BOT  for  booking  airline tickets,  if  the  BOT  keeps  asking  about  your destination  without  even  letting the user to understand  various  discounts and  offers available in your  site.
  • Guidelines   warn  against  building "cludless Bot"  which are unintelligent  and  does  not understand the  context.  For example  your  user  is already  logged  in  and  you know his name and other  details,  there is no point for Bot  to  ask  the details  again. We  will talk more about  how to fix the problem of "clueless Bot"  in the  below  sections.
  • While  Unintelligent  BOTs are not  unwelcome,  it  is  also  true  that  some  times  BOTS  exhibiting  too much  of  intelligent  beyond  what  is  required  for the  conversation. Suppose  assuming  that  user  is  trying  to  book a  hotel  room  for  his business travel  to  attend a conference,  the  BOT  should  not  use  the  Social  Media  profile  of the  user  and  assume and ask questions  about  User's  family or  hobbies.  Like  the  BOT  should  not  offer  some services  for  user's  kids  during  the  stay.
While  these  guidelines are  just  indicative,  there is  not a  single  useful  navigational  flow  that  will  provide a  blueprint  of  a  perfect  customer  centric  BOT. It  will differ  from case to  case. However  applying common  sense  and  utilizing  the  appropriate  intelligence  as  part  of the solution is key to its success. The  following  are some  of  Azure  AI & Cognitive  Services  that will  assist in BOT  development  and  make  them more useful for customers.

Understand Customer Language (Basic Level):    Understanding  the  natural language  is  fundamental to the success of this new user experience interfaces.  The  best  thing  with a  human interaction is that however differently  asked  humans  will understand  the intent  most of the times. However  BOTS unless given the intelligence,  they may  just  act  like  dump machines  which merely  replays  what  is  pre programmed. LUIS (Language Understanding  Intelligent Service) is  one  important  Azure cognitive Service  that  will  provide the much needed  intelligence  to BOT interfaces.  LUIS understand the  intent  from  User's  input  which is the  Verb  which is the action user wanted to perform. For example  Intent  could  be like,  Register for a  Event, or   Book a flight. LUIS also  extracts  entities  that  is  of  interest  from  a  textual conversation, which is very important, because when some  one  wanted to  book a ticket  to  Paris,  "Paris"  is  about the  destination that needs to be understood and  BOT services  tailors it's  response  accordingly.

Analyze Customer Language (Deeper Level) :   While  LUIS will help you  with basic understanding and the direction with which the customer  wanted  to  take  the conversation you need to make further analysis  much  like  human  do  in  a conversation.  That is where the  Linguistic Analysis  comes  into  picture.  One  important  aspect  is  to  understand  the  Phrases  within the  conversation. Because  some  times  individual   words  will  convey  a  different  meaning where as the phrases  will  convey  totally different  meaning.  For example  some  one  say to a BOT that  " I wanted to book a luxury hotel in New York".  In  this  case  "luxury hotel" is a  phrase  that  we  need to respond  rather than  just  any other  hotel.  Similarly  there  are  other  techniques  like , "part  of speech tagging", "sentence separation" all  are  important  while  conversing  naturally  with the user.  Most  of these APIs are available  as  part of  Azure "Linguistics Analysis API".

Understand  the  Mood  Of Customer :   If you happen  to  see a  call center  conversation, some times  calls  may  show  customer's  anger, dejection, frustration and other  sentiments.  And  most times human  adjust  their  conversation with respect to the  tone  of the customer. For example  if the customer is  extremely unhappy with the service,  the   call center person  will first  ask for excuses before proceeding. BOTS are expected to behave the same way. That is why  Sentiment Analysis of each part of conversation is  important  and  once the  BOT  determines that the customer is unhappy the direction of the conversation should be different.  Azure  "Text Analysis API" will help with  understanding the sentiments.

Guide The ConversationWith Corrections To Language:   Spelling  makes a huge portion  of language understanding. Also  the world  of  social media  like twitter  have  created a huge set of slang language  that  the  BOT may have to understand. While there is no  exhaustive method  which can correct all the spelling issues  possible in a  language,  integrating  with Azure Spell Check API mitigates most of the problems. This API  recognizes common  name errors,  corrects word breaking issues and recognizes slang  and informal language.  Especially for US-English is the language of communication then this API  provides more advanced  functionality.  When ever the BOT  finds a conversation with a wrong spelling it is better to suggest to user and progress as per the correction.

Make Best Utilization Of Your Existing Support Channels:    Most  organizations  have existing options  to  get support  for their customers  which are  proven  and  working already.  For example  most  organizations in their  web site   generally have a   FAQ (Frequently Asked Questions) section which are trained  over a period  and  normally reflect the best  issues that their customers face. When we build a new automated  BOT  to  respond  to users, we should  not  start  fresh, rather  best utilize the existing  FAQ. Azure Q&A  Maker  is one such cognitive  service  which is  meant to  extract best possible  conversations  from a  existing Q&A content. Q&A  maker  service accepts  the existing Q&A in the form of  TXT,DOC,PDF,HTML files  and uses  Artificial Intelligence and Natural Language processing  to match these questions against  user's  queries  and  match them appropriately. This service  provides  option  to  train  the Q&A sequences as well  as  constantly update the knowledge  base  which makes the service more dynamic in nature.

The  above  are  only  a  indicative  set  of  services  that  can  enrich  the customer  experience,  however  as  we  involve  with  users  we  should  keep on  improving  the  intelligence  behind the BOTs and other  Automated  Assistants  and  should  not only depend  on the past  training  data. Because  the  training  data  may not be available  or may be obsolete.  One  such  option  is also to use the "Reinforcement Learning"   which keep learning  and adapts  itself.

Finally  all  of  the  Automated  Assistants  should  at  some  point  have to  hand over the humans to ensure  that  the situations  which beyond their  ability  are  still  handled. Without  Human intervention  these  Automated  Agents  may  frustrate  users  and  make  them  not interested  in your site  or  app.

Using  the  newer channels  provide  lot  of  options  for the organization  to  serve more  people with less resources  because  humans  have  limitations  and resources are limited.  However immersive and conversational  agents  should  be planned  carefully  and  not  just  be  viewed  as a nice technology add on,  but rather  human centric  usage  has  to be understood  and  designed for. May be these  interface  require  Manual  Testing  than  Automated   testing  to ensure that  whether  Users  are indeed  like the flow  and  gets satisfied  from the service.


Tuesday, October 10, 2017

Implementing Digital Twins Using Azure IoT Hub & BigchainDB

Digital Twins:   Analyst  Gartner  has  recently  released  2018  Technology  Trends.  Along  with  expected  technologies  like   Artificial Intelligence,  Immersive  User Experiences, Blockchain..one import  trend is  about  Digital  Twin.

As  the  name  suggest  is  Digital  Twin  is the  Digital  representation  of a  real  world  entity,  typically  available  in  Cloud  and  maintains  the  current  status  about  the  Device  along  with its  properties.  As  it  reduces  the  need  to  Query  the  Physical  Device   (which is  generally  costly and  subject  to   connectivity  issues),  Digital  Twins  find  lot of  value  in  Asset  Management  of  large  machinery  , especially  in  reducing  the  Maintenance  and  Repair  Operations. Also  Device twins  facilitate   Remote  Management  of  machinery making  them  more  efficient.

Digital Twins  practically  can extend  any industry,  starting  with Smart Cities, Government, Manufacturing,  Healthcare, Retail  and more.

BigchainDB  As Asset Management Solution :     BigchainDB is  a  scalable  database  with Blockchain  characteristics.  As  mentioned  in  my previous  articles,  BigchainDB  while  can be used  for  many situations,  one  of the  important  use  case  being  'Asset Registrations and Transfers'. When you  make a  CREATE transaction  in BigChainDB  it  registers an Asset  and tags it  with  the  respective  metadata.  BigchainDB  subsequently  tracks  the  Asset  ownership  till  its life time.

Azure  Iot Hub :   IoT  hub  is  part  of Azure's  IoT  services  and  provides  secure bi-directional connectivity  to  Devices.  It  provides  Per  Devices  Authentication  and  Secure  Connectivity.  IoT Hub also  provides  options to  send  configuration and maintenance  operations to Device  and  in turn record  the  status  of  Devices after those operations.

So  considering  the  use  cases  of  above  2  products  it  would  be  worth while to  implement  Digital Twins  (Device  Twins)  using   BigChainDB  and  Azure  IoT  Hub.

Scenario :    Consider  a  Scenario  where  a  large  Crane  Manufacturer  ,  leases  cranes  to  be  used  by  various   real  estate builders and other  organizations.  In this scenario BigChainDB  is used to maintain the  larger  Device Specifications  about the  Crane  itself  and  also  maintain the  current  lessee (owner). The  specific  agreements  for  the  usage  and  other legal  and  regulatory  compliance  of the  Crane  can  be  maintained  in  a  blockchain  network  like  BigchainDB. However the crane  is also monitored  for  functional  efficiencies  using  IoT and   status  of  the  crane is   updated in  real  time  to  Azure  IoT  Hub.  Now  the  following  piece  of  implementation  will  link  both   Bigchain DB  and  IoT  Hub  and  will  show  cause the value  of   Digital  Twins.

Register  Device  In BigchainDB :
bdb_root_url = 'http://localhost:9984'  # Use YOUR BigchainDB Root URL here
bdb = BigchainDB(bdb_root_url)
crane_asset = {
            'data': {
                        'crane': {
                            'manufacturer':'crane manufacturer',
                            'model': 'my model',
                            'engine':{
                                 'model':'engine model',
                                 'type':'4 cycle, 6 cylinder',
                                 'pistondisplacement':'12000',
                                 'maxoutput':'100'
                                },
                            'tires':{
                                'front':'12R22',
                                'rear':'12R22'
                                },
                             'tankcapacity':'300L',
                             'performance':{
                                  'maxtravellingspeed':'64km/h',
                                  'gradeability':'65'
                                 },
                             'frontjack':{
                                  'floatsize':'250'
                                 },
                            },
                        },
            }
crane_asset_metadata = {
            'currentlocation': 'new york'
            }
prepared_creation_tx = bdb.transactions.prepare(
            operation='CREATE',
                signers=crane_owner_public,
                    asset=crane_asset,
                        metadata=crane_asset_metadata
                        )
fulfilled_creation_tx = bdb.transactions.fulfill(
            prepared_creation_tx,
                private_keys=crane_owner_private
                )
sent_creation_tx = bdb.transactions.send(fulfilled_creation_tx)

The  above  piece  of  code  creates  the  initial  registration  of  the  Crane.  While  the  set  of  metadata  is  not  an  exhaustive  set  of  attributes  for  a  crane  it  does  provide  an  idea  about  how a  Device's  meta  data  will  be maintained  in the BigchainDB  along  with  the  information about  current  owner.

Now  let  us  assume  that  after  registration,  BigChainDB  creates a   DeviceID  as  follows.

Crane Device Id  In BigchainDB :  9da06f5a07c3d8a3ae27cd9d5bb7019ec276651d0d49fc4275d2771834b344c2

Create Azure Iot Hub:   Azure  IoT  Hub  is  quite  easy  to  create  from  Azure  Portal,  the  following  screen  shot  shows  an  implementation  of  Azure IoT Hub.


The  Important  values  to  look are  the Shared  Access Policies  which  provides  connectivity and authentication  information  for  connecting  to  this IoT  Hub.

Register the  Device Created In BigChainDB  with Azure IoT  Hub;

The  next  step  is  to  register the Device  that  is  created  in BigchainDB  with Azure IoT  Hub, so that  it  provides a  link between the two systems. Such  that  the  Asset ownership and  legal needs can be  tracked  using  BigchainDB  and  the  Device  Telemetry  and  Remote  Monitoring  and  Preventive Maintenance  can  be  tracked  using  Azure  IoT  Services. However due to  linkage of the metadata  both  the  implementations  can be viewed  in  sync.

var iothub = require('azure-iothub');
var connectionString = 'HostName=bigcazureiot.azure-devices.net;SharedAccessKeyName=iothubowner;SharedAccessKey=**********=';
var registry = iothub.Registry.fromConnectionString(connectionString);
var device = {
          deviceId: '9da06f5a07c3d8a3ae27cd9d5bb7019ec276651d0d49fc4275d2771834b344c2'
}
registry.create(device, function(err, deviceInfo, res) {
          if (err) {
                      registry.get(device.deviceId, printDeviceInfo);
                    }
          if (deviceInfo) {
                      printDeviceInfo(err, deviceInfo, res)
                    }
});
function printDeviceInfo(err, deviceInfo, res) {
          if (deviceInfo) {
                      console.log('Device ID: ' + deviceInfo.deviceId);
                      console.log('Device key: ' + deviceInfo.authentication.symmetricKey.primaryKey);
                    }
}

Now  the  above  code  will  create  the  device identity  in  Azure IoT  Hub. While  the  code  is  self explanatory  and  uses  the  connectivity  string  as  obtained  under  the  'shared access policies',  the important  thing  to  look into  is  about  the  Device Id.

Device ID  can be  any  meaningful  identity  for the  Device  which  will  act as a  primary  key for the  device,   However in this  case  we  have  used  the   Asset  ID  that  is  created by BigchainDB  and  thus  the linkage  between the  Asset  representation for legality purposes  and  Device  Representation  from  Telemetry  perspective  are  linked.

After  the  above  program  is  executed, you  will   find  the  Device  is registered in  IoT  Hub  with the  same  ID  as  established by BigchainDB.

Device  Twins  may  provide  much  more  benefits  when  it  comes  to large  machinery  whose  maintenance  and  legal  management  of  compliance  needs  are always  complicated.  This  kind  of  solution  involving  BigchainDB  and Azure  IoT Hub  may be  of interest  to enterprises.

This  solution  not only makes   the  Machinery  Operations  smarter with  Device  Telemetry,  by  linking  with  the  Asset Management  solution  of  BigchainDB,   device ownership  over a  period  and  its  history  can  be  tracked  and  transparently  available.  This will  help  with  lot  of maintenance  issues  and  associated  legal  compliances.

(Please  note  that  in this  post  Device/Digital  and  Asset  have  been  used  interchangeably).