From ccf7aa827a18e60bce989900c80df2f223d6401d Mon Sep 17 00:00:00 2001 From: Leesunhyoung <0226sun@gmail.com> Date: Mon, 13 Jan 2025 11:17:30 +0900 Subject: [PATCH 1/2] [Team] New content development Team3 [Title] UpstageEmbeddings [Version] initial [Language] ENG [Packages] dotenv, langchain_upstage, numpy - Langchain and UpstageEmbeddings Tutorial - A tutorial on using Langchain's class to access UpstageEmbeddings. --- 08-Embedding/04-UpstageEmbeddings.ipynb | 28 +++++++++++++------------ 1 file changed, 15 insertions(+), 13 deletions(-) diff --git a/08-Embedding/04-UpstageEmbeddings.ipynb b/08-Embedding/04-UpstageEmbeddings.ipynb index 5be7935cc..109c9db99 100644 --- a/08-Embedding/04-UpstageEmbeddings.ipynb +++ b/08-Embedding/04-UpstageEmbeddings.ipynb @@ -9,13 +9,14 @@ "- Author: [Sun Hyoung Lee](https://github.com/LEE1026icarus)\n", "- Design: \n", "- Peer Review : [Pupba](https://github.com/pupba), [DoWoung Kong](https://github.com/krkrong)\n", + "- Proofread:\n", "- This is a part of [LangChain Open Tutorial](https://github.com/LangChain-OpenTutorial/LangChain-OpenTutorial)\n", "\n", "[![Open in Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/github/LangChain-OpenTutorial/LangChain-OpenTutorial/blob/main/08-Embeeding/04-UpstageEmbeddings.ipynb) [![Open in GitHub](https://img.shields.io/badge/Open%20in%20GitHub-181717?style=flat-square&logo=github&logoColor=white)](https://github.com/LangChain-OpenTutorial/LangChain-OpenTutorial/blob/main/08-Embeeding/04-UpstageEmbeddings.ipynb)\n", "\n", "## Overview\n", "\n", - "'Upstage' is a domestic startup specializing in artificial intelligence (AI) technology, particularly in large language models (LLM) and document AI.\n", + "'Upstage' is a Korean startup specializing in artificial intelligence (AI) technology, particularly in large language models (LLM) and document AI.\n", "\n", "### Table of Contents\n", "\n", @@ -26,7 +27,8 @@ "### References\n", "\n", "- [Upstage API docs](https://console.upstage.ai/docs/getting-started/overview)\n", - "- [Upstage Embeddings](https://console.upstage.ai/docs/capabilities/embeddings)\n" + "- [Upstage Embeddings](https://console.upstage.ai/docs/capabilities/embeddings)\n", + "---\n" ] }, { @@ -37,14 +39,14 @@ "\n", "Set up the environment. You may refer to [Environment Setup](https://wikidocs.net/257836) for more details.\n", "\n", - "**[Note]**\n", + " **[Note]** \n", "- `langchain-opentutorial` is a package that provides a set of easy-to-use environment setup, useful functions and utilities for tutorials. \n", "- You can checkout the [`langchain-opentutorial`](https://github.com/LangChain-OpenTutorial/langchain-opentutorial-pypi) for more details.\n", "\n", "### API Key Configuration\n", - "To use `UpstageEmbeddings`, you need to [obtain a Upstage API key](https://console.upstage.ai/api-keys).\n", + "To use `UpstageEmbeddings` , you need to [obtain a Upstage API key](https://console.upstage.ai/api-keys).\n", "\n", - "Once you have your API key, set it as the value for the variable `UPSTAGE_API_KEY`." + "Once you have your API key, set it as the value for the variable `UPSTAGE_API_KEY` ." ] }, { @@ -54,7 +56,7 @@ "outputs": [], "source": [ "%%capture --no-stderr\n", - "!pip install langchain-opentutorial" + "%pip install langchain-opentutorial" ] }, { @@ -105,7 +107,7 @@ "cell_type": "markdown", "metadata": {}, "source": [ - "You can alternatively set `UPSTAGE_API_KEY` in .env file and load it.\n", + "You can alternatively set `UPSTAGE_API_KEY` in `.env` file and load it.\n", "\n", "[Note] This is not necessary if you've already set `UPSTAGE_API_KEY` in previous steps." ] @@ -164,8 +166,8 @@ "\n", "| Model | Release Date | Context Length | Description |\n", "|------------------------------------|--------------|----------------|-----------------------------------------------------------------------------------------------------|\n", - "| solar-embedding-1-large-query | 2024-05-10 | 4000 | A Solar-base Query Embedding model with a 4k context limit. This model is optimized for embedding user queries in information retrieval tasks such as search and re-ranking. |\n", - "| solar-embedding-1-large-passage | 2024-05-10 | 4000 | A Solar-base Passage Embedding model with a 4k context limit. This model is optimized for embedding documents or texts for retrieval purposes. |" + "| embedding-query | 2024-05-10 | 4000 | A Solar-base Query Embedding model with a 4k context limit. This model is optimized for embedding user queries in information retrieval tasks such as search and re-ranking. |\n", + "| embedding-passage | 2024-05-10 | 4000 | A Solar-base Passage Embedding model with a 4k context limit. This model is optimized for embedding documents or texts for retrieval purposes. |" ] }, { @@ -187,7 +189,7 @@ "cell_type": "markdown", "metadata": {}, "source": [ - "`Query` is embedded.\n" + "Embed the `query`" ] }, { @@ -219,7 +221,7 @@ "cell_type": "markdown", "metadata": {}, "source": [ - "The document is embedded." + "Embed the document" ] }, { @@ -282,7 +284,7 @@ ], "metadata": { "kernelspec": { - "display_name": "Python 3 (ipykernel)", + "display_name": "langchain-kr-bpXWMSjn-py3.11", "language": "python", "name": "python3" }, @@ -301,4 +303,4 @@ }, "nbformat": 4, "nbformat_minor": 2 -} \ No newline at end of file +} From a01ce20b99af629f15f6c2434a6663b395ea3197 Mon Sep 17 00:00:00 2001 From: Leesunhyoung <0226sun@gmail.com> Date: Mon, 13 Jan 2025 11:42:12 +0900 Subject: [PATCH 2/2] redo commit the file --- 08-Embedding/04-UpstageEmbeddings.ipynb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/08-Embedding/04-UpstageEmbeddings.ipynb b/08-Embedding/04-UpstageEmbeddings.ipynb index 109c9db99..2065b3919 100644 --- a/08-Embedding/04-UpstageEmbeddings.ipynb +++ b/08-Embedding/04-UpstageEmbeddings.ipynb @@ -211,7 +211,7 @@ "source": [ "# Query Embedding\n", "embedded_query = query_embeddings.embed_query(\n", - " \"Please provide detailed information about LangChain.\"\n", + " \" Please provide detailed information about LangChain. \"\n", ")\n", "# Print embedding dimension\n", "len(embedded_query)"