A robot sitting on a bench using a tablet

Did you know that you can use an AI chatbot to check the text shown on an Intelligent Advisor interview or in an interactive advice flow? You can use the chatbot to check for spelling mistakes, consistent capitalization, question phrasing, punctuation…anything grammatical really.

At a high-level, it’s a two step process…get the interview text from the project into a file, and then copy that in to your AI chatbot asking it to identify any errors.

Checking interview text in a Policy Modeling project

To get a list of all the interview text in a Policy Modeling project, you can use a translation (Excel) file.

  1. Open your project in OPM, go to the Projects tab and open then Language subtab.
  2. Add a translation document. Tip: It doesn’t matter what you choose for the Locale. I selected English (United Kingdom).
  3. Open the translation file in Excel.
  4. Go to the Screens worksheet and copy the text in the Original Text column.

Now you just need to copy this text into your AI chatbot along with a suitable prompt. Open your choice of AI chatbot and type a prompt followed by your copied text. For example:

Identify any spelling mistakes or grammatical improvements in the following list of values:
START LIST
<pasted list of copied values>
END LIST

Your AI chatbot should provide you with a list of corrections and suggestions for improved spelling, phrasing and capitalization. For example:

Spelling mistakes:
  • “Inconsitent readings” should be corrected to “Inconsistent readings”
  • “Adminstration” should be corrected to “Administration”

Inconsistent capitalization:

  • “Ok” should be capitalized consistently as “OK”
  • “the issue is not covered by warranty” should capitalize the first letter: “The issue is not covered by warranty.”

Missing or incorrect punctuation:

  • “What was the outcome” should end with a question mark: “What was the outcome?”
  • “Please provide a description of the event” should also end with a colon for consistency with other questions’ punctuation style: “Please provide a description of the event:”
  • “Is the phone network experiencing outages ?” Remove the space before the question mark: “Is the phone network experiencing outages?”

Awkward phrasing:

  • “We do take cases of electric shock very seriously.” Could be revised to sound more formal: “We take cases of electric shock very seriously.”
  • “Have you checked whether a fuse has blown?” change to “Have you checked if a fuse has blown?” for a more common phrasing.
  • “Click next if you would like to raise a Service Request to follow-up this issue further.” Suggested correction from noun to verb: “Click Next if you would like to raise a Service Request to follow up on this issue further.”

Make the necessary corrections to the text in your interview (on the Interview tab in OPM), then go back to the translation document on the Project/Language tab and click Update all. Then re-open the translation document and repeat the steps above to re-check your interview text in your AI chatbot.

Checking attribute text in a Policy Modeling project

You could use a similar process to check the attribute text in an interview. This could be useful for checking the attribute parses that will be used in explanations.

To get a list of attributes in the project, you can use the data model file.

  1. Open your project in OPM, go to the Data tab and click the Export button. This creates a csv file.
  2. Open the CSV file in Excel and copy the relevant columns of data.

Now paste this text into your AI chatbot along with a suitable prompt. For example, if I wanted to check my sentences forms were all grammatical, I could copy the text in the Question, Sentence, Negative, Uncertain and Unknown columns and then use a prompt like this:

In the following list of values, identify any that are not grammatical sentences:
START LIST
<pasted list of copied values>
END LIST

Your AI chatbot should provide you with a list of sentences that are not grammatical. For example:

  • “Do the return result screen should be displayed?” – The sentence is incorrect because of the improper structure. It should be: “Should the return result screen be displayed?”
  • “Did the item being return came with a bonus gift?” – This sentence has grammatical issues. It should be: “Did the item being returned come with a bonus gift?”
  • “Has The clothing been worn, damaged, washed, or altered?” – “The” should not be capitalized, as it is part of the sentence rather than a proper noun. The corrected sentence is: “Has the clothing been worn, damaged, washed, or altered?”
  • “Who is the item type?” – This is incorrect because “Who” refers to a person, but “item type” is not a person. A correct version would be: “What is the item type?”

Checking screen text in a flow project

To get a list of all the screen text in a flow project, you can use the file of translatable strings.

  1. Open your flow project in your Hub and open the flow.
  2. In the Actions menu, select Export translatable strings. A JSON file of the flow strings is downloaded.
  3. Open this file in a text editor such as Notepad and copy the text.

Now you need to copy this text into your AI chatbot along with a couple of prompts, the first to extract a list of values from the code and the second to check the text.

Open your choice of AI chatbot and type a prompt followed by your copied text. For example:

Extract a list of values from the following JSON:
<pasted JSON>

Once the list of values is shown, follow it up with a prompt like:

In the list above, identify any spelling mistakes, inconsistent capitalization, or grammatical improvements

Your AI chatbot should provide you with a list of corrections and suggestions for improved spelling, phrasing and capitalization. For example:

Spelling mistakes:

  • “inspecion” should be “inspection”

Inconsistent capitalization:

  • “name” in “Inspector name” should be capitalized for consistency with other items like “Inspection Date”: “Inspector Name”

Grammatical improvements:

  • “Choose Asset” Suggested improvement to make it more natural: “Choose an Asset”
  • “Steps Performed” Suggested improvement to match the style of other items that introduce a list: “Steps Performed:”
  • “Step Evidence” might benefit from more context, for example, “Evidence of Step Completion” if appropriate.

Tips

  • Remember that your AI chatbot is not perfect so there will sometimes be corrections and suggestions that it provides that you need to ignore. Also, AI chatbots can vary considerably in what they detect so be prepared to finesse your prompts accordingly or try using different AI chatbots for different results.
  • The Intelligent Advisor Documentation provides a list of general principles for the writing of attribute text. You can copy these into your AI chatbot along with your list of attributes to check if they conform with the guidelines. For example:

In the following list of Boolean attribute values, identify any that do not comply with these basic principles:

PRINCIPLES

1. Boolean attributes should be complete grammatical sentences

2. Boolean attributes should be written in the present tense

3. Boolean attributes should be written in the third person

4. Boolean attributes must be able to be negated

5. Boolean attributes should represent a single concept

LIST OF BOOLEAN ATTRIBUTES
<pasted list of boolean attribute text>

  • If you have attribute naming conventions for your project (highly recommended!), you can also use the AI chatbot to check your attribute names follow the conventions. For example, if you wanted to ensure that all your attribute names use UpperCamelCase, you could copy the values in the Name column into your AI chatbot with a prompt like:

In the following list of values, identify which values do not use upper camel case:
<pasted list of attribute names>

  • If your AI chatbot replaces your list with a new/corrected list, you can politely say something like:

I want you to tell me what changes I need to make, not make them.

Further information

If you would like further information on any of the concepts covered in this post, check out these topics in the Intelligent Advisor Documentation Library.

OPM projects:

Flow projects:

Title image credit: Andrea De Santis via Unsplash