article by Frank Nimphius, February 2021

 

How do you curate your utterances and message bundles? Well, I use Microsoft Excel, which could cause a problem though. The problem described in this article does not appear to be reproducible on all operating systems and on all versions of Microsoft (MSFT) Excel. However, it does occur on my MAC so I thought it would be best to document it in case anyone else is having this problem. 

What is the problem?

The problem shows for messages in resource bundles or for utterances that contain a comma in them. For example, the resource bundle message shown in the image below contains multiple commas.

Exporting the message bundle to a CSV file shows the following content for the message containing the commas. As you see, the message that contains commas is surrounded by double quotes ("), whereas the message that does not contain a comma does not use surrounding quotes.

At least on my MAC (Catalina) the surrounding quotes are getting lost after importing the CSV file to MSFT Excel and then exporting it to a new CSV file. This is true for resource bundle strings but also CSV I export from the intent panel in skills. As a result, when re-importing the CSV file, the messages are getting cropped at the first comma. Resource bundles shows the part after the comma added to the annotation field. 

The solution

As mentioned, this problem does not reproduce on other computers and does not be a problem with MACs. However, if you experience the problem and want to use MSFT Excel for editing resource bundles and utterances (especially for curating utterances in intents, Excel is a nice too to use), then this is how I got it working. Below images show the process that works for me

  1. Importing the CSV file to MSFT Excel

  2. Choose Delimited as the file format

  3. Set the delimiting character to comma (,)

  4. As you can see, there is no indication that one of the messages is surrounded by a pair of double quotes. And in fact, this got removed by Excel. To bring the double quotes back, you need to add a custom cell format. So, select the fields and choose Format Cells from the context menu

  5. Set the format to custom and add the following format: \"@\"

  6. This brings back the double quotes. Its adding it to all messages, even to those that don't use a comma in their text. But this does not matter or cause harm.

  7. Next, export the Excel worksheet as a CSV file

  8. Because MSFT Excel exports the CSV file with a semicolon as a delimiter, you need to open the CSV file in a text editor and replace the ";" character with a ","
  9. Last but not least, copy a double quote character added by Excel and replace all of them with a double quote character you type. Seems there is a slight difference in the character encoding. 

  10. Now you can import the CSV file and the results in Oracle Digital Assistant looks as before.

Summary

As mentioned, the problem I describe in this article and that I document a solution for may not impact many. But just in case, I added a solution that gets you going. 

Related Content

Training your NLP model – Best Practices In Writing Utterances

Implementing Varying Bot Responses Based on Intent Confidence

TechExchange: Options for Working With Message Bundles in Oracle Intelligent Bots

TechExchange Quick-Tip: How-to Use Resource Bundles Defined In A Skill Within Custom Components Without Tying The Component To A Specific Skill