7 Augmenting data with outputs from large language models
This chapter covers
- Understanding external network access
- Configuring external network access
- Calling API endpoints from Snowpark
- Retrieving customer reviews from websites like Yelp
- Deriving customer review sentiments
- Interpreting emails using large language models to save time
Snowflake’s external network access functionality enables data engineers to access network locations external to Snowflake. This opens countless opportunities to access data by calling API endpoints from Snowflake stored procedures or user-defined functions (UDFs). For example, data engineers can retrieve external data that augments the data already stored in Snowflake. With the proliferation of generative AI capabilities and large language models (LLMs), data engineers can incorporate the outputs of such models by calling the Snowflake Cortex LLM functions.
In this chapter, we will learn how to retrieve customer reviews from an external website and store them in Snowflake tables for further analysis. We will call an LLM to help us understand the reviews and classify their sentiment. We will also use an LLM to help us interpret unstructured text from the body of an email and derive structured information from it.