Skip to main content

Creating a chatbot channel

5 Tasks

15 mins

Visible to: All users
Beginner Pega Customer Decision Hub '23 English

Scenario

U+ Air wants to use a chatbot to handle ticket cancellation requests through all relevant channels to reduce the workload of customer service representatives. The airline first wants to open a chatbot channel to allow their customers to cancel their ticket through a chatbot as an initial step.

As an application developer, create a Digital Messaging channel to implement the chatbot. Then, as a data scientist, use a dataset to train the generated text prediction so that the chatbot correctly recognizes the 'cancel ticket' topic.

Use the following credentials to log in to the exercise system:

Role User name Password
Application Developer ApplicationDeveloper rules
Data Scientist DataScientist rules

Your assignment consists of the following tasks:

Task 1: Create a new digital messaging channel

As an application developer, create a new Digital Messaging channel to respond to service requests received through the U+ Airline chatbot.

Task 2: Test the chatbot

As a data scientist, test the chatbot before training the topic model to observe the current behavior.

Task 3: Train the topic model

Use the Airlines Training Data file that contains classified messages to train a new topic model on three airline-related topics.

Task 4: Test the text prediction

Confirm that the new topic is predicted.

Task 5: Test the U+ Air chatbot

As an application developer, test the topic detection, and then observe the results.

 

You must initiate your own Pega instance to complete this Challenge.

Initialization may take up to 5 minutes so please be patient.

Challenge Walkthrough

Detailed Tasks

1 Create a new digital messaging channel

  1. On the exercise system landing page, click Launch Pega Infinity™ to log in to App Studio.
  2. Log in to App Studio as an application developer:
    1. In the User name field, enter ApplicationDeveloper.
    2. In the Password field, enter rules.
  3. In the navigation pane of App Studio, click Channels to create a new channel interface for Digital Messaging.
  4. In the Create new channel interface section, click Digital Messaging to create a channel.
    channels
  5. In the Configuration tab, in the Details section, complete the details:
    1. In the Channel interface name field, enter Airline.
    2. In the Description text box, enter U+ Air Digital Messaging.
      digital messaging 2
  6. In the Content section, click Add case type.
    1. In the Create command dialog box, in the Case type list, select Cancel a ticket.
      Note: A System Architect already created the Cancel a ticket case type. The case manages ticket cancellations once they are routed to the correct workbasket.
    2. In the Create case command field, enter cancel ticket to enable the chatbot to run the case type after detecting the topic of the message.
      create command
      Note: The cancel ticket create case command represents the name of the topic that the data scientist creates later in the challenge.
    3. Click Submit to create the command.
  1. In the Digital Messaging channel, click the Connection tab.
  2. In the Set up section, configure the migration details:
    1. In the Template Operator field, enter or select ApplicationDeveloper.
      set up window
      Note: The Base URL will vary for your exercise environment.
  1. In the upper-right corner, click Save to save the new channel.

2 Test the chatbot

  1. In the Digital Messaging channel, click the Configuration tab.
  2. In the Preview console on the right, in the Type your message here text box, enter hello! to see if the chatbot detects the message and responds.
  3. Turn on the Show analysis switch to see the details.
    preview console
    Note: The chatbot detects the #greeting topic with 97% confidence. The chatbot is trained to detect simple topics out of the box.
  1. In the Type your message here text box, enter I want to cancel my ticket.
     
    bot 1
    Note: At this point, the text prediction model is not built. The chatbot cannot identify the topic of this message.
  1. In the lower-left corner, click the user icon, and then select Log off to log out of App Studio.

3 Train the topic model

  1. Log in to Prediction Studio as a data scientist:
    1. In the User name field, enter DataScientist.
    2. In the Password field, enter rules.
  2. On the Predictions landing page, click Airline to open the prediction workspace.
    airline preiction
  3. Download the Airlines_training_data.xlsx file.
  4. Open Airlines_training_data.xlsx to inspect it.
    1. Inspect the content column.
    2. Inspect the result column, and then confirm that the training dataset contains three topics:
      • action > book ticket
      • action > cancel ticket
      • action > reschedule.
        excel
    3. Close the file.
  5. In the Airline prediction workspace, in the Topics section, click Import to upload topic information.
    topis import
  6. In the Upload topics dialog box, click Choose file, select Airlines_training_data.xslx file, and then click Open.
  7. Click Upload.
  8. After the upload, in one of the new actions row, in the Total training data column, click 0 to confirm that the new topic has reviewed training data.
    check reviewed training data
  9. In the upper-right corner of the Airline prediction workspace, click Build to build topic models.
  10. In the Build models dialog box, select the Airline row.
    build models
  11. Click Build to build the models.
    Note: The building process might take up to few minutes.
  1. After two minutes, in the upper-right corner of the prediction window, click Actions > Refresh.
  2. Once the build is completed, in the top of the prediction window, click View build report.
    view build report
    1. In the Build report window, review the result.
    2. Click Close to close the Model training report window.

4 Test the text prediction

  1. In the upper-right corner of the Airline prediction workspace, click Test.
    1. In the Test prediction dialog box, in the text box, enter I want to cancel my ticket.
    2. Click Test.
    3. Observe that cancel ticket topic is detected with a confidence score of 0.94
      test prediction 1
      Note: The prediction also detects Others as topic of the message. This result is expected behavior, because both Airline and pySmallTalk models are run on the text. However, the system is configured in such a way that, if pySmallTalk model detects the Others topic, the system uses the Airline business model, even if the Confidence score of the pySmallTalk model is same or higher.
    4. Close the Test prediction dialog box.
  1. In the lower-left corner, click the user icon, and then select Log off to log out of Prediction Studio.

5 Test the U+ Air chatbot

  1. Login to App Studio as an application developer:
    1. In the User name field, enter ApplicationDeveloper.
    2. In the Password field, enter rules.
  2. In the navigation pane of App Studio, click Channels to view the list of current channels.
  3. In the Current channel interfaces section, click the icon that represents your existing Airline Digital Messaging channel.
    click airline
  4. In the Preview console on the right, in the Type your message here text box, enter I want to cancel my ticket to test the chatbot.
  5. Turn on the Show analysis switch to show the details.
  6. Confirm that the chatbot detects a cancel ticket topic and runs a preconfigured Cancel a ticket case type.
    chatbot 1
  7. Click Yes to confirm.
    chatbot 2

This Challenge is to practice what you learned in the following Module:


Available in the following mission:

If you are having problems with your training, please review the Pega Academy Support FAQs.

Did you find this content helpful?

Want to help us improve this content?

We'd prefer it if you saw us at our best.

Pega Academy has detected you are using a browser which may prevent you from experiencing the site as intended. To improve your experience, please update your browser.

Close Deprecation Notice