Visit Matillion AI Playground at Snowflake Data Cloud Summit 24

Find out more

Suite Success: Transform Multilingual Reviews into Actionable Insights with Snowflake Cortex and Matillion

Data engineers looking to process and distill insights from large, unstructured datasets can now leverage Snowflake Cortex's generative AI capabilities directly within their low-code data pipelines, made possible through Matillion's Data Productivity Cloud.

I'll bring this to life with a scenario in which a travel company has collected hotel stay reviews, and wishes to take advantage of this data operationally and analytically.

Here's the first review:

Hotel review example - cell sample review 

Your company may receive reviews or comments in many different languages. They provide little value without bilingual individuals and a lengthy process to get them all interpreted and reviewed. But this is where Snowflake Cortex can step in…

Transcending Language Barriers

While working with diverse datasets, in this case, a text segment written in a language other than the company's standard language of operation, the TRANSLATE function addresses the problem by translating text from the source language to the target language.

Cortex Translate in the Matillion Data Productivity Cloud

The above screenshot shows a data sample of the initial dataset consisting of hotel reviews in French being converted into English, thus making it accessible for downstream analysis.

Summarizing Free Text in SQL

Upon translation, the next step is to understand and analyze these reviews. The powerful SUMMARIZE Cortex function returns a language-based summary of the given English text, converting a potentially wordy excerpt into a short, digestible briefing.

Cortex Summarize in the Matillion Data Productivity Cloud

You can see the new summary_en_COMMENT field in the screenshot above, showing how the Matillion component summarizes text inline, into a new column containing short recaps of the translated review data.

Sentiment Analysis for Data Engineers

Sentiment analysis is used to detect positive or negative emotional sentiment. In this case, I'll extend this to a series of numeric values; the higher the number, the happier the person is feeling. So in technical terms, sentiment analysis means converting a freehand piece of text into a number. Numbers are simple to use in transformation logic, so it's easy to filter out very happy and very unhappy people, for example.

With English text, Matillion's implementation of the Cortex SENTIMENT function enables data engineers to perform sentiment analysis quickly and easily.

Here's how it looks in the Matillion Data Productivity Cloud. Note the range of sentiment, from very positive to very negative.

Cortex Sentiment Analysis in the Matillion Data Productivity Cloud

This component produces a score from -1 to 1 to measure feelings in the text. This is extremely valuable operationally since it enables you to identify reviews that require urgent attention by applying simple numeric filters.

How to Ask a Natural Language Question in a Data Pipeline

A quick reminder of the problem at hand: negative reviews. What went wrong? The Cortex EXTRACT_ANSWER function can be employed here to evaluate the comment and extract the cause of dissatisfaction.

With Matillion's Cortex Extract Answer component, this really is as easy as nominating the free text column and asking the question:

Asking a Natural Language Question in a Data Pipeline

In common with all Matillion data transformation components, a data sample shows exactly what went wrong with this guest's stay:

Matillion's Cortex Extract Answer component in a data pipeline

Personalization with Generative AI

After understanding why the guest was upset, the Cortex COMPLETE function can be used to write an apology. This is a powerful and sophisticated function, bringing opportunities for automation that have never existed until now. It's a relatively demanding task that benefits from an advanced language model such as mistral-large.

The Matillion component requires broad instruction, such as: "You are a hotel manager dealing with complaints".

It also needs specific instruction, which in this case is: "Write an apology to the guest based on their comment".

The Cortex Completions component in a Matillion data transformation pipeline

As you can see from the screenshot, this component is easily capable of creating a genuinely apologetic response, in the original language – French in this case. This responds to the specific complaints and issues mentioned in the original comment.

Building Stronger Customer Relationships with Matillion and Snowflake

Matillion works alongside Snowflake to give businesses an edge over its customer relationship management. Matillion's data integration pipeline platform helps data teams to build and manage efficient pipelines at scale, integrating data for AI use cases. This not only improves productivity but also fosters collaboration between teams.

Leveraging models from Snowflake Cortex fused with the ease of use of Matillion's data productivity platform means you can quickly and easily translate, summarize, analyze, and respond to customer feedback. The value of this working model is evident in the possibility of drafting personalized apologies, mending relationships, and potentially turning negative experiences into future positive interactions.

Matillion simplifies the process of integrating Snowflake Cortex's generative AI and machine learning capabilities into data pipelines, making it accessible to data engineers without requiring extensive AI expertise. With Matillion's no-code Cortex components, users can quickly incorporate AI functions like sentiment analysis, text summarization, and language translation into their data transformation workflows. This allows data engineers to easily enrich their datasets and extract valuable insights from unstructured data sources, enabling use cases such as analyzing customer sentiment from reviews, generating concise summaries of lengthy reports, and tailoring content for global audiences.

Want to see this in action on video? Check it out here:


Discover more about our joint capabilities at the Snowflake Summit, and get ready to unlock the full potential of your data engineering capabilities.

Ian Funnell
Ian Funnell

Data Alchemist

Ian Funnell, Data Alchemist at Matillion, curates The Data Geek weekly newsletter and manages the Matillion Exchange.