Daanalytics

Summarize Snowflake Earnings for Fiscal Q1-2025 with Cortex

Snowflake recently has reported Snowflake Earnings for Fiscal Q1-2025. Inspired by Nick Akincilar I thought it would be nice to see how Snowflake Cortex AI could assist in summarizing the results. I took Nick’s code and packaged it in a Streamlit app.

“Snowflake Cortex is a fully-managed service that enables access to industry-leading large language models (LLMs) is now Generally Available. If you’re new to Snowflake Cortex, check out the Documentation.

Streamlit Cortex Yahoo Summarizer

Streamlit Cortex Yahoo Summarizer

There are a few steps which need to be followed to create the Streamlit App.

  • Create a Database and a Schema to create your objects
  • Enable the integration with an external site. In this case the Yahoo Finance Site
  • Create a native Python function to scrape HTML code and cleanup & remove HTML using BeautifulSoup library from Anaconda

Now you can execute a query to use Snowflake Cortex and summarize the text scraped from the Yahoo Finance Site:

Snowflake Cortex Query Output

All the code is on Github.

Streamlit App

Having all of the above in place, it’s relatively easy to create the Streamlit Application. There are a few steps and you are ready to go.

  • Create a Schema to store your objects
  • Create the Streamlit Application
  • Select the packages to be used
  • Create the Python code

If the schema is present, you can create the Streamlit Application.

Create the Streamlit Application

Before creating the Python-code, you have to select necessary packages, which will be used in the code.

Streamlit selected Pyton Packages

The code to create the Streamlit Application is also on Github.

Summary

That’s it. This blogpost is an example of how you can use Snowflake Cortex AI, Streamlit and a native Python UDF to scrape text from a website and summarize it all from within Snowflake.

Till next time.

Snowflake Data Superhero. Online also known as; DaAnalytics.

Daan Bakboord

DaAnalytics signature picture with Snowflake Data Superhero avatar.

Bekijk ook:

Amsterdam User Group Meeting October 2024

Snowflake Dutch User Group – October 2024

Last night I had the privilege to organize a Snowflake ❄️ User Group in Snowflake’s Amsterdam Office.

Johan van der Kooij shared his experiences regarding optimizing Snowflake from a cost & performance perspective. He shared practical hints, as well as example queries, that you can use to optimize your Snowflake environment.

Lees verder »
Snowflake Data Cloud Summit - Wrap Up

Snowflake Snowflake Data Cloud Summit — Wrap Up

Snowflake Data Cloud Summit proved that after all this years the core idea remains the same and is still strong. Technology should serve and Snowflake makes things simple. One Single Unified Platform, one product and one engine. Ease of use and Govenance. Maximum efficiency and maximum simplicity.

Bring the processing of data to the data instead of the other way around. Snowflake as a Platform where you build and share your Data, Apps and AI Products. Your data never has to leave the Platform and Snowflake takes care of this Platform.

Lees verder »
Snowflake Data Cloud Summit - Day II

Snowflake Data Cloud Summit – Day II

The second day of Snowflake Summit in the Moscone Center in San Francisco started with Platform Keynote packed with announcements and demo’s. The announcements were not necessarily completely new, but a continuation of things Snowflake was already working on. Lot’s of Developments and Previews have made it to GA status and are now Generally Available to the public. A few announcements were made as wel.

This blogpost a summarization of my notes with were possible a link to Snowflake publications or documentation.

Lees verder »