Back to Browse

Intelligent Text Classification using Snowflake Cortex LLM

1.3K views
Sep 4, 2024
14:41

Large Language Models in Snowflake Cortex are hosted and fully managed by Snowflake and you donโ€™t have to do any prior setup. Now you have model hosted nearer to where your data resides, it gives you the performance, scalability, and governance you look for your Enterprise. In this video we are going to explore, how to use Cortex LLM for Text Classification usecases. Prerequisite: =========== Image Classification with Vector Semantic Search using Pinecone metadata filters https://youtu.be/85czhoo14NE?si=lXJ-UuY14Fbzjf8p Documentation Link: ================= https://docs.snowflake.com/en/user-guide/snowflake-cortex/llm-functions Code: ===== CREATE or replace Database snowflake_llm_poc; use snowflake_llm_poc; CREATE TABLE question_data ( text STRING, category STRING ); --training data INSERT INTO question_data (text, category) VALUES ('What is the capital of France?', 'geography'), ('Name the tallest mountain in the world', 'geography'), ('How does quantum computing work?', 'technology'), ('Best practices for cybersecurity', 'technology'), ('Explain the theory of relativity', 'science'), ('What are the planets in our solar system?', 'science'), ('Who discovered electricity?', 'science'), ('What is the largest desert in the world?', 'geography'), ('Difference between classical and quantum computing?', 'technology'), ('What is the circumference of the Earth?', 'geography'); select * from question_data; --Test Data: What is the largest ocean in the Planet Earth? --vector embedding create or replace table question_data_vector_store as select TEXT,CATEGORY,SNOWFLAKE.CORTEX.EMBED_TEXT_768( 'e5-base-v2', Text) as embedding_vector from question_data; select * from question_data_vector_store; select text,category,VECTOR_L2_DISTANCE(SNOWFLAKE.CORTEX.EMBED_TEXT_768( 'e5-base-v2', 'What is the python programming language?'),embedding_vector) as distance from question_data_vector_store order by VECTOR_L2_DISTANCE(SNOWFLAKE.CORTEX.EMBED_TEXT_768( 'e5-base-v2', 'What is AI,ML & Deep Learning difference?'),embedding_vector) limit 3; Check this playlist for more Data Engineering related videos: https://youtube.com/playlist?list=PLjfRmoYoxpNopPjdACgS5XTfdjyBcuGku Generative AI on AWS & Snowflake: https://youtube.com/playlist?list=PLjfRmoYoxpNrxzmFi9F_yqA7r6kRrBzAH&si=ShtHQ-pUErE_MS32 Apache Kafka form scratch https://youtube.com/playlist?list=PLjfRmoYoxpNrs0VmIq6mOTqXP52RfZdRf Messaging Made Easy: AWS SQS Playlist https://youtube.com/playlist?list=PLjfRmoYoxpNqnWvkg8Ujx6TH6pUcGLseT Snowflake Complete Course from scratch with End-to-End Project with in-depth explanation-- https://doc.clickup.com/37466271/d/h/13qc4z-104/d4346819bd8d510 *Explore our vlog channel:* https://www.youtube.com/@funwithourfam/videos ๐Ÿ™๐Ÿ™๐Ÿ™๐Ÿ™๐Ÿ™๐Ÿ™๐Ÿ™๐Ÿ™ YOU JUST NEED TO DO 3 THINGS to support my channel LIKE SHARE & SUBSCRIBE TO MY YOUTUBE CHANNEL๐Ÿ“บ๐Ÿ”ฅ๐Ÿ’–

Download

0 formats

No download links available.

Intelligent Text Classification using Snowflake Cortex LLM | NatokHD