Atlas는 Nomic에서 만든 플랫폼으로, 소규모 및 인터넷 규모의 비정형 데이터셋과 상호작용하기 위한 플랫폼입니다. 누구나 브라우저에서 대규모 데이터셋을 시각화하고, 검색하고, 공유할 수 있습니다.
이 integration을 사용하려면 pip install -qU langchain-communitylangchain-community를 설치해야 합니다 이 notebook은 AtlasDB vectorstore와 관련된 기능을 사용하는 방법을 보여줍니다.
pip install -qU  spacy
!python3 -m spacy download en_core_web_sm
pip install -qU  nomic

Package 로드하기

import time

from langchain_community.document_loaders import TextLoader
from langchain_community.vectorstores import AtlasDB
from langchain_text_splitters import SpacyTextSplitter
ATLAS_TEST_API_KEY = "7xDPkYXSYDc1_ErdTPIcoAR9RNd8YDlkS3nVNXcVoIMZ6"

데이터 준비하기

loader = TextLoader("../../how_to/state_of_the_union.txt")
documents = loader.load()
text_splitter = SpacyTextSplitter(separator="|")
texts = []
for doc in text_splitter.split_documents(documents):
    texts.extend(doc.page_content.split("|"))

texts = [e.strip() for e in texts]

Nomic의 Atlas를 사용하여 데이터 매핑하기

db = AtlasDB.from_texts(
    texts=texts,
    name="test_index_" + str(time.time()),  # unique name for your vector store
    description="test_index",  # a description for your vector store
    api_key=ATLAS_TEST_API_KEY,
    index_kwargs={"build_topic_model": True},
)
db.project.wait_for_project_lock()
db.project
다음은 이 코드의 결과를 보여주는 map입니다. 이 map은 State of the Union의 텍스트를 표시합니다. atlas.nomic.ai/map/3e4de075-89ff-486a-845c-36c23f30bb67/d8ce2284-8edb-4050-8b9b-9bb543d7f647
Connect these docs programmatically to Claude, VSCode, and more via MCP for real-time answers.
I