AWS Partner Network (APN) Blog

Breaking Language Boundaries: Multilingual GenAI Solutions with Amazon Bedrock

By Kelvin Kok, Chief Architect & CEO – Axrail
By Cara Lee, Account Manager – Axrail
By Brendan Child, Sr. AI/ML Partner Development Specialist – AWS
By Vasileios Vonikakis, Sr. AI/ML Partner Solution Architect – AWS

Axrail-AWS-Partners-2023
Axrail
Axrail-APN-Blog-CTA-2023

Introduction

Generative AI enhanced solutions, such as virtual assistants and enterprise search, have already demonstrated their potential in transforming businesses through increased productivity and greater customer experience. In regions such as in Southeast Asia, where English is rarely the primary or only language, one of the greatest areas of opportunity is the ability to allow businesses to engage with their customers seamlessly in their chosen language.

In this blogpost, we’ll delve into how the multilingual capabilities of Generative AI are helping remove language barriers when enhancing customer experience and optimizing business processes. Specifically, we will breakdown 2 real-world multilingual Generative AI solutions by Axrail.AI, an AWS Advanced Tier Consulting Partner: a virtual assistant chatbot, and Generative AI-powered intelligent document processing, both developed using Large Language Models (LLMs) in Amazon Bedrock,. We will also shed light on how their multilingual capabilities are adding business value for customers who have adopted them.

Multi-lingual Generative AI Chatbot Assistant

With the increasing engagement of consumers through digital channels, effective customer engagement is a key priority across the B2C landscape. With Generative AI, customer service chatbots can be vastly improved from the traditional rule-based workflows, instead allowing users to interact in their preferred language, using a natural tone. This enhances the customer experience both in terms of functionality and multilingual accessibility.

Unlike traditional AI chatbots, Generative AI chatbots allow for contextualized understanding of user queries. This means an engagement isn’t interrupted due to misspelled words or the use of slang, and generates responses that are customized with the context of each individual customer query.

Offering multilingual capabilities is of paramount importance, especially in regions like ASEAN, where English is often not the customer’s first language. Additionally, by letting the Generative AI models handle the multilingual aspect, the architecture is simplified and decreases the time-to-market and allowing development teams to focus on new features.

High-level architecture

The following figure depicts the high-level architecture of the Multi-lingual Generative AI Chatbot assistant.

Architectural of multilingual genAI chatbot

Fig. 1. High-level architecture flow of Axrail.AI’s multilingual Generative AI chatbot.

The high-level architecture flow of Axrail.AI’s Multi-lingual Generative AI Chatbot assistant solution is as follows:

  1. A collection of documents, such as PDFs containing Frequently Asked Questions (FAQs), are uploaded to an Amazon S3 bucket and ingested to an Amazon Kendra Index. These documents act as the knowledge base for the LLM. The documents can either be only in English, or in one of the supported languages of Amazon Kendra.
  2. A user submits a question through the chatbot interface on WhatsApp.
  3. An AWS Lambda function acts as an orchestrator and sends the incoming question to Amazon Comprehend in order to identify the dominant language of the question. Alternatively, this step could also be accomplished by prompting an LLM.
  4. Optionally, the question can be translated to English using Amazon Translate (more details on the section about multilingualism).
  5. At the same time, the AWS Lambda function sends a retrieve query to the Amazon Kendra index, based on the user’s question (translated to English or not). The Amazon Kendra index returns relevant search results, including excerpts from the uploaded documents.
  6. The AWS Lambda function formulates a prompt for Amazon Bedrock, incorporating the user’s query, the retrieved data as context, as well as the detected language of the question, and prompts the selected LLM on Amazon Bedrock to “return the answer in the same language”.
  7. The LLM generates a concise response to the user’s question, in the respective language, based on the provided context.
  8. The chatbot app sends the generated response back to the user.
  9. Application data, such as conversation logs, is stored in Amazon DynamoDB for future use or analysis.

Multilingualism

In order to handle multilingual queries, the solution utilizes a layered approach.

First, the dominant language of the question is detected using Amazon Comprehend. If the language of the question is found to be different than the languages of the indexed documents, then it is translated to one of them using Amazon Translate. This will allow Amazon Kendra to find relevant context from within the indexed documents.

Then, following a Retrieval Augmented Generation (RAG) approach, the retrieved context, along with the question (original or translated) is passed to Amazon Bedrock, where an LLM will generate an answer to the question, given the retrieved context. More importantly, the LLM is prompted to return the response in the dominant language of the original question (as detected by Amazon Comprehend). As such, the chatbot’s responses are not only contextually accurate but also linguistically coherent.

The Axrail team has found that Anthropic’s Claude LLMs, versions 2, 2.1 and especially 3, exhibit strong multilingual capabilities for the ASEAN languages (e.g. Bahasa Indonesia, Malay, Mandarin, Tagalog, Vietnamese, Tamil, etc.), being able to receive the question and context in one language and generate the correct answer in another.

This layered approach enables the Axrail.AI chatbot to interact effectively with users in multiple languages such as English, Chinese, Bahasa Melayu, and Indonesian to name a few, even if all the documents are indexed in a single language like English. In case the original question is posed in a language that is not supported by the LLM, the chatbot can inform the user that it is not able to answer the question, and it will suggest alternative ways of reaching out to the team (e.g. email, live human agent, etc).

An alternative approach, which can also result in multilingualism, is to use multilingual embeddings (e.g. Amazon Titan Text Embeddings). If you are interesting to know more about this approach, please take a look at this blogpost.

Customer references

In this section we will describe the business impact that Axrail.AI’s multilingual Generative AI chatbot assistant had on 2 customers who have adopted it.

PETRONAS Sepang International Circuit (PETRONAS SIC)
Sepang International Circuit (SIC) is a motorsport race track in Sepang, Selangor, Malaysia. Dubbed as the crown jewel of Malaysian motorsports, SIC is best known for its endless motorsports events and activities, such as the F1 Grand Prix (F1), MotoGP™ and others, as well as corporate, lifestyle, and exhibition events.

Previously, while SIC had utilized a WhatsApp channel to respond to customer inquiries, these queries were responded to manually by a customer service team. The key business challenges faced were the number of agents required to manage customer queries which increased linearly with the volume of inquiries. During peak hours, this resulted in longer waiting times for customers. Moreover, customer service responses were only available when the agent was present, and the language support was limited by their linguistic capabilities.

Axrail.AI adapted their Multi-lingual Generative AI Chatbot assistant to SIC’s needs, using WhatsApp as the interface, to redefine the way fans experience races at the iconic circuit. The choice of WhatsApp as the user interface allows for ease of adoption by users, who largely leverage this application on a daily basis. This solution provides 24/7 availability and makes sure that customer queries can be responded promptly on demand. Axrail.AI’s Generative AI Chatbot, is powered by Amazon Bedrock and offers the following features:

  1. Frequently-Ask-Questions (FAQ): The chatbot can answer multiple questions about upcoming or ongoing racing events within WhatsApp similar to a human agent.
  2. Merchandise Purchases: The chatbot allows audiences to efficiently browse through the available items, add items to their cart and make secure payments.
  3. Multilingual Responses: The chatbot is able to handle multiple local languages, such as English, Mandarin (Chinese), Bahasa Melayu and Tamil, while automatically adjusting to the language of the user’s request.

Fig. 2 depicts various UI snapshots of the SIC Multi-lingual Generative AI Chatbot assistant. You can watch the promotional video, which describes the above features here.

UI snapshots of the SIC Chatbot

Fig 2. UI snapshots of the SIC Multi-lingual Generative AI Chatbot assistant.

Axrail.AI’s Multi-lingual Generative AI Chatbot assistant was introduced 2 months before the Petronas MotoGP race, on 9th-12 th November 2023, which garnered a global audience size of more than 160,000 spectators across 3 days. During that trial period, before and during the racing event, hundreds of users interacted with the chatbot, with an average response time of 9 seconds for all of the features mentioned above. The chatbot handled 60% of English, 20% Malay, and 20% Mandarin queries and automatically generated responses to suit the users’ needs.

During the trial period, SIC tested in parallel their existing chatbot system, based on conversational flow technology and human agents, with Axrail.AI’s Multilingual Generative AI Chatbot assistant. The timeliness and quality of responses of Axrail.AI’s solution was found to be superior compared to the existing approach and helped SIC to migrate from a traditional AI chatbot to a Generative AI based chatbot.

Azhan Shafriman Hanif, Chief Executive Officer of Sepang International Circuit has mentioned:
“The introduction of a MotoGP™ Malaysia Generative AI chatbot, developed by Axrail.AI leveraging Amazon Web Services (AWS) services, offers an unparalleled user journey and effortlessly supports multiple languages, provides pinpoint location services, and simplifies merchandise browsing to a mere touch. This helped us to reduce the need of human agents and traditional AI chatbots, and elevate fans’ experience during the race and better engage fans internationally with the multilingual feature”.

National Library Board of Singapore

The National Library Board (NLB) promotes reading, learning, information literacy and a greater appreciation of Singapore’s heritage and identity by offering a diverse range of programmes and services, resources, and digital innovations.

Axrail.AI worked with NLB in order to adapt their Multi-lingual Generative AI Chatbot assistant technology to allow users to ask questions about the content of specific books, and if interested, borrow them using their NLB account. The Generative Chatbot assistant is called ChatBook and supports Q&A functionality for the content of the book “Seven Hundred Years: A History of Singapore”. In this use case, the chatbot is configured to respond solely in English to all queries, regardless of the query’s language. This decision is specific to NLB’s use case – to uphold the academic standards required to deliver educational content based on the book and learning materials, and to preserve the integrity and authenticity of the author’s original work. Nevertheless, the solution remains highly proficient in understanding and processing queries in a variety of language, while maintaining quality and reliability of the bot’s content. The underlying technology remains flexible and robust, catering to the requirements of various projects.

Fig. 3 depicts ChatBook UI snapshots demonstrating its capability to provide accurate and contextually appropriate responses based on the user’s input, regardless of the language used to pose the question.

UI screenshots of the ChatBook agent

Fig 3. UI screenshots of the ChatBook agent, allowing users to ask questions about the content of specific books, across different languages, and potentially borrow them.

NLB plays a pivotal role in providing access to a vast repository of books and documents that are crucial for educational purposes. However, students and teachers often face challenges in efficiently accessing and retrieving information related to Singapore’s history content. These challenges include navigating through extensive collections to find relevant information such as historical events and figures. Moreover, there may be varied levels of digital literacy among readers, making it difficult for some to leverage the full potential of the book and library resources. To keep on top of trends and continue serving the public in a time when books seem passé, NLB partnered with Axrail to develop ChatBook to draw upon the materials that NLB has, and provide instant, on-demand access to detailed explanations, summaries and reliable responses. This has since garnered more than a thousand users who interacted with ChatBook.

Gene Tan, Chief Innovation Officer of National Library Board, has mentioned:
“In commitment to nurture Readers for Life, Learning Communities and a Knowledgeable Nation across Singapore, NLB has adopted Generative AI solutions to enhance how Singaporeans discover, learn and experience. In this journey, Axrail has partnered with us to test a versatile chatbot – both web-based and WhatsApp, powered by Amazon Bedrock, to
empower the public with quick access to information about books in a conversational manner. The current interactive chatbot prototype, ‘ChatBook’ allows users to input queries and receive comprehensive responses, based on the book, ‘Seven Hundred Years: A History of Singapore’ and NLB’s online resources. User feedback on ChatBook has been positive.”

Intelligent Document Processing powered by Generative AI

Aside from multilingual chatbots which can improve customer experience, Generative AI has the potential to also transform business operations. Currently, many organizations grapple with the burden of manually processing large volumes of various document types in multiple languages. In light of these challenges, many organizations are exploring the adoption of Optical Character Recognition (OCR) and Intelligent Document Processing (IDP) technologies.

Axrail.AI has introduced their SmartEye solution, an Intelligent Document Processor that leverages Amazon Textract as the key AWS service. In combination with Amazon Bedrock, it can leverage the power of LLMs to navigate the intricacies of multiple languages. As such, it can not only enhance the accuracy of data extraction, but also open up new possibilities for business operations at a global scale. Furthermore, it allows for handling of complex data formats such as paragraphs, sentences, keywords, and contextualization of natural language queries. It does not rely on predefined templates and excels at learning on the fly, unlocking barriers and limitations of Robotic Process Automation (RPA) solutions which require manual configuration to adapt to changes in processes or systems. Across Axrail.AI’s customers, SmartEye has helped to increase operational efficiencies – accelerating document processing duration from hours to minutes; a customer reduced the size of the manpower required for this process from 5 to 2 employees. Moreover, it enhances detection accuracy while reducing human errors. Subsequently, it allows business workflows to be streamlined when integrated with existing Enterprise Resource Platform (ERP) and Customer Relationship Management (CRM) systems.

High-level architecture

Architecture of SmartEye solution

Fig. 4. High level architecture of Axrail.AI’s SmartEye IDP solution.

The high-level architecture flow of Axrail.AI’s SmartEye IDP solution is as follows:

  1. A document is uploaded from a Document Management System server to an Amazon Simple Storage Service (Amazon S3) bucket, either manually or automatically as part of a batch process.
  2. The upload to the Amazon S3 bucket triggers an AWS Lambda function, which then invokes Amazon Textract. Amazon Textract extracts text and data from scanned documents without manual intervention.
  3. The information extracted by Amazon Textract is passed to Amazon Bedrock for further processing, including entity extraction (e.g. names, amounts, dates etc.), language detection, translation, and semantic understanding.
  4. After processing with Amazon Textract and Amazon Bedrock, the extracted data is stored in Amazon DynamoDB, a managed NoSQL database service that offers fast and predictable performance with seamless scalability.
  5. A CSV (Comma-Separated Values) file containing the extracted data is generated by the Lambda function and stored in the S3 bucket. This CSV file can be exported to the Document Management System Server through a scheduled batch job.

Multilingualism

To achieve multilingual capabilities in Axrail.AI’s SmartEye solution, both Amazon Textract and Amazon Bedrock are integrated to handle and analyze documents in various languages. Amazon Textract currently supports the following Latin-based languages: English, Spanish, Italian, Portuguese, French, and German (refer here for more information).

Nevertheless, in regions like Southeast Asia, organizations may have documents in various languages that are not natively supported by Amazon Textract (e.g. invoices and purchase orders). Many of these natively unsupported languages, such as Bahasa Indonesian, Malay, and Tagalog, are based on Latin characters. For these cases, the SmartEye solution is using Amazon Textract for extracting only the raw OCRed text. This raw OCRed text is then passed to Amazon Bedrock, where a multilingual LLM can “understand” it, and extract the required information. The Axrail.AI team has found that Anthropic’s Claude v2.1 and v3 LLMs have exhibited great results in understanding and extracting relevant information from raw OCRed text of many local Southeast Asian languages that use Latin characters. If the documents include Excel charts, photos, or diagrams, Anthropic’s Clause v3 LLM is preferred due to its multimodal capabilities.

This combination of Amazon Textract with multilingual LLMs in Amazon Bedrock allows Axrail.AI’s SmartEye solution to support document processing across a wide range of languages, making it highly effective for global business operations.

Customer references

In this section we will describe the business impact that Axrail.AI’s GenAI-powered IDP solution had on 2 customers who adopted it.

Customer Reference: Wilmar International
Wilmar International is a fortune 500 global leading Agri Company in Asia and Africa, ranking amongst the largest listed companies by industry capitalization on the Singapore Exchange (SGX). Wilmar has adopted Axrail.AI’s SmartEye solution for their IDP tasks.

The Wilmar team was looking for a smart OCR solution to address the inefficiencies and error-prone nature of their current manual document processing system. The team handles thousands of documents on a monthly basis which involves (1) scanning of hard copy documents into digital format, and (2) manually extracting data and recording into the company’s internal systems. These manual processes are not only tedious—consuming at least 2 hours daily—but also prone to human error due to the extensive number of fields that need to be captured. Each field has over 20 categories to select from in the internal system, which can lead to inefficiencies and inaccuracies in data handling. Moreover, some documents are in Bahasa Indonesia and consist of watermarks, which makes it difficult for traditional OCR solutions to handle.

By adopting Axrail SmartEye, the team is able to automate extraction and contextualization of data from various document types, significantly reducing the time required for manual input. This potentially allows employees to focus on other critical tasks.

Chew Yin Peng, Director of Wilmar Consultancy has mentioned:
“By leveraging on Axrail’s SmartEye solution, which incorporates Amazon Textract along with Amazon Bedrock and other AWS services, Wilmar can now scan documents and extract data of different languages in a more efficient manner. This has the potential to improve the overall operational efficiency and productivity of the team.”

Customer Reference: Pelangi Publishing Group
Pelangi Publishing Group is a distinguished and dynamic Malaysian educational publishing and printing company renowned for its commitment to deliver high quality educational materials. Pelangi Publishing Group has adopted Axrail.AI’s SmartEye solution for their IDP tasks.

Pelangi was looking for a solution to address the inefficiencies and inaccuracies associated with their existing manual document processing system. The team was looking to streamline the document processing of thousands of documents such as purchase orders and invoices in multiple languages more efficiently, minimize the labor-intensive nature of manual data entry, and reduce occasional human errors. By adopting Axrail.AI’s SmartEye solution, Pelangi was able to move away from their existing manual process to an automated one which was faster and involved less human intervention. This increase in productivity allowed Pelangi to shift employees to other important business functions, achieving more with the same number of human resources.

Sum Lih Kang, Executive Director of Pelangi Publishing Group has mentioned:
“We process over hundreds of thousands of physical documents annually, including purchase orders, credit notes, and invoices to name a few. This process is extremely labor-intensive and time consuming for our sales coordinators, where they have to input and organise the necessary information on our Business Portal. This manual submission process is also susceptible to human errors, especially with unstructured data and multi-language document types. With Axrail SmartEye, a solution that leverages a combination of Amazon Textract and Amazon Bedrock, it has helped to both extract and contextualize data, reducing sales coordinators’ manual work in validating and approving documents, and helped us to reskill 2-3 employees to perform other critical business tasks.”

Conclusion

In this post we saw how the latest state of the art LLMs available in Amazon Bedrock, such as Anthropic Claude 2.1 and 3, can work well with many of the local ASEAN languages, including Mandarin, Malay and Tamil. Built around these models, Axrail.AI’s multilingual Generative AI solutions, i.e. virtual assistant chatbot and Generative AI-powered IDP, have shown to be transformative across various industries in the ASEAN region, such as education, retail and agriculture, improving the consumer experience and increasing efficiencies for the organizations who adopted them.

.

Axrail-APN-Blog-Connect-2023

.


Axrail – AWS Partner Spotlight

Axrail is an AWS Advanced Services Partner that leverages its deep expertise in Cloud, Data and Generative AI, to deliver scalable, real-world applications across industries, from enterprises to startups and public sector.

Contact Axrail | Partner Overview