Skip to main content

         This documentation site is for previous versions. Visit our new documentation site for current releases.      

Enabling training the model based on email attachments

Updated on February 10, 2023

Apart from the content of an email body, you can optionally train the text analytics model for your Pega Email Bot™ with the information in email attachments. As a result, you make the training process in your system more consistent and you improve the accuracy of natural language processing (NLP) analysis.

For example, customers interact with your email bot to apply for a bank loan, during which they attach files describing their financial credit history. You can enhance the training the model in the system by using training data in file attachments that contain sample credit histories. As a result, the email bot can then improve the detection of correct entities and topics from customers in both the body of their emails and in their file attachments.
Before you begin: Create an Email channel and define the Email channel behavior. For more information, see Creating an Email channel and Defining Email channel behavior.
By default, you train the text analytics model in your system by using training data from email bodies. By enabling the training of model based on email attachments, you can also use training data from text files, and image-based files if you are using an external optical character recognition (OCR) component in your system.
  1. In the navigation pane of App Studio, click Channels.
  2. In the Current channel interfaces section, click the icon that represents your existing Email channel.
  3. In the Email channel, click the Behavior tab.
  4. In the Text Analyzer section, select the Record training data checkbox.
  5. Optional: To use an advanced text analyzer configuration, perform the following steps:
    1. In the Text Analyzer section, select the Use advanced configuration checkbox.
    2. Click Add text analyzer, or if the iNLP text analyzer type is already displayed in the list, click the Switch to edit mode icon in the iNLP row.
    3. In the Text analyzer configuration window, in the Text Analyzer type list, select iNLP.
    4. Select the Enable model training check box.
    5. Click Submit.
  6. Click Save.
  7. Switch to Dev Studio.
  8. In the navigation pane of Dev Studio, click App, and then search for the Work-Channel-Triage-Email class.
  9. Expand the Data ModelData Transform section for the Work-Channel-Triage-Email class, and then click pyDefault.
  10. In the pyDefault data transform rule, in the table row for the pyEnableAttachmentTraining target, in the Source column, enter: true
  11. Optional: To increase the limit on the amount of text extracted from file attachments in the system, in the table row for the pyExtractedTextLimit target, in the Source column, enter the maximum number of bytes to extract as text from file attachments.
  12. Save your changes by performing one of the following actions:
    • To save the rule that belongs to a locked ruleset to an isolated sandbox so that you can test your changes, click Private edit.

      For more information, see Performing a private edit.

    • To save the rule to a ruleset, click Save as.
  13. Switch back to App Studio.
For example:

The following figure shows the pyDefault data transform rule in which you enable file attachment training and increase the extracted text limit:

The pyDefault data transform rule for the email bot
The definition tab of the pyDefault data transform rule for the email bot.
What to do next: Train the text analytics model for the Email channel based on training data from both email body and email attachments. For more information, see Training the model for the Email channel.

Have a question? Get answers now.

Visit the Support Center to ask questions, engage in discussions, share ideas, and help others.

Did you find this content helpful?

Want to help us improve this content?

We'd prefer it if you saw us at our best. is not optimized for Internet Explorer. For the optimal experience, please use:

Close Deprecation Notice
Contact us