Skip to content

Instantly share code, notes, and snippets.

View KobaKhit's full-sized avatar
🏀

Koba Khitalishvili KobaKhit

🏀
View GitHub Profile
@KobaKhit
KobaKhit / snowflake-classify-text.md
Last active September 16, 2024 16:06
Text Classification in Snowflake SQL

Classifying Text in Snowflake SQL

With LLMs becoming available in Snowflake as part of their Cortex suite of products in this piece we will explore what the experience is like when classifying text. First of all, Snowflake has native CLASSIFY_TEXT function that does exactly what it says when given a piece of text and an array of possible categories. Second, one could classify text using emebeddings (EMBED_TEXT_768) and similarity to possible categories calculated by one of the distance function like cosine similarity (VECTOR_COSINE_SIMILARITY). Finally, when going the embeddings + similarity route we could use a cross join with a categories table or create a column for each category's similarity score and then assign the greatest one. So we have thre

@KobaKhit
KobaKhit / app.py
Created October 25, 2024 11:58
Plolty Click Events in Streamlit
import plotly.express as px
import streamlit as st
# Sample data
df = px.data.iris()
# Create the Plotly figure
fig = px.scatter(df,
x="sepal_width",
y="sepal_length",
@KobaKhit
KobaKhit / readme.md
Last active January 23, 2025 21:16
A free historical weather API using Python and Open-Meteo.com

In this gist you can see how to obtain historical weather data from Open Meteo api.