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](https://daanalytics.nl/wp-content/uploads/2024/05/image-1024x427.png)
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](https://daanalytics.nl/wp-content/uploads/2024/05/image-2-1024x323.png)
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](https://daanalytics.nl/wp-content/uploads/2024/05/image-3-300x220.png)
Before creating the Python-code, you have to select necessary packages, which will be used in the code.
![Streamlit selected Pyton Packages](https://daanalytics.nl/wp-content/uploads/2024/05/image-1-300x269.png)
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.
![DaAnalytics signature picture with Snowflake Data Superhero avatar.](http://daanalytics.nl/wp-content/uploads/2023/10/DaAnalytics-Blog-Signature-Picture.png)