Multiple languages for Smart Analytics Image Server


Recently i have stumbled upon following task: to have Smart Analytics to recognise and fill out interaction data from images that have two languages (in my case it was Russian and English). It was required due to the fact, that customers have a lot of issues when, for example, the error description for a software is shown in two languages. I haven't found any information on the issue within this forum, so decided it would be reasonable to post what i came up with in order to deal with the task,

The thing is that in the OOB version Smart Analytics would only recognise one language, "language setting specified in the contact record of a user in Service Manager" as per the Smart Analytics Manual. The problem is that when you have multiple languages it would not even skip the letters from other languages, it would rather just have them replaced by the best match, which makes the resulting article almost impossible to read.

I've dug a bit into the whole process and the actual solution was pretty simple. The function that, calls another function, that end up sending an XML request to the Image Server is called "processOCR", and is located in "IDOL_Utilities" library, which can be accessed via the Service Manager script library.  The function recieves three parameters: record (which contains interaction invoked by SCFile), targetField (which contains text with the field name, like "description", which is going to be populated with the image contents) and language (which contains language code). The thing is that in OOB case the "language" variable is populated with a single language code (the language setting specified in the contact record of a user in Service Manager). If you replace that fied contents with an array, for example with something like ["en", "ru", "ar"], for English, Russian and Arabic respectively, instead of the original "en", you'd have your image analyzed for the best match for every language in the list. It worked for me like a charm. And as for how exactly to replace it: to change the original script, to create your own and have user-interface buttons to start yours instead, to have or not to have user to pre-configure the list of languages prior to sending new interaction info, etc. - is pretty much up to you.