id stringlengths 14 16 | text stringlengths 29 2.73k | source stringlengths 49 117 |
|---|---|---|
2f876e110efc-0 | .ipynb
.pdf
Hugging Face Hub
Hugging Face Hub#
Let’s load the Hugging Face Embedding class.
from langchain.embeddings import HuggingFaceEmbeddings
embeddings = HuggingFaceEmbeddings()
text = "This is a test document."
query_result = embeddings.embed_query(text)
doc_result = embeddings.embed_documents([text])
previous
G... | https://python.langchain.com/en/latest/modules/models/text_embedding/examples/huggingfacehub.html |
073ca3db5a29-0 | .ipynb
.pdf
SageMaker Endpoint Embeddings
SageMaker Endpoint Embeddings#
Let’s load the SageMaker Endpoints Embeddings class. The class can be used if you host, e.g. your own Hugging Face model on SageMaker.
For instructions on how to do this, please see here. Note: In order to handle batched requests, you will need to... | https://python.langchain.com/en/latest/modules/models/text_embedding/examples/sagemaker-endpoint.html |
073ca3db5a29-1 | query_result = embeddings.embed_query("foo")
doc_results = embeddings.embed_documents(["foo"])
doc_results
previous
OpenAI
next
Self Hosted Embeddings
By Harrison Chase
© Copyright 2023, Harrison Chase.
Last updated on Jun 02, 2023. | https://python.langchain.com/en/latest/modules/models/text_embedding/examples/sagemaker-endpoint.html |
e1825a10127c-0 | .ipynb
.pdf
Elasticsearch
Contents
Testing with from_credentials
Testing with Existing Elasticsearch client connection
Elasticsearch#
Walkthrough of how to generate embeddings using a hosted embedding model in Elasticsearch
The easiest way to instantiate the ElasticsearchEmebddings class it either
using the from_cred... | https://python.langchain.com/en/latest/modules/models/text_embedding/examples/elasticsearch.html |
e1825a10127c-1 | model_id,
es_connection,
)
# Create embeddings for multiple documents
documents = [
'This is an example document.',
'Another example document to generate embeddings for.'
]
document_embeddings = embeddings.embed_documents(documents)
# Print document embeddings
for i, embedding in enumerate(document_embedding... | https://python.langchain.com/en/latest/modules/models/text_embedding/examples/elasticsearch.html |
f0bf260d5fbc-0 | .ipynb
.pdf
Fake Embeddings
Fake Embeddings#
LangChain also provides a fake embedding class. You can use this to test your pipelines.
from langchain.embeddings import FakeEmbeddings
embeddings = FakeEmbeddings(size=1352)
query_result = embeddings.embed_query("foo")
doc_results = embeddings.embed_documents(["foo"])
prev... | https://python.langchain.com/en/latest/modules/models/text_embedding/examples/fake.html |
0ad3e33739ac-0 | .ipynb
.pdf
MosaicML embeddings
MosaicML embeddings#
MosaicML offers a managed inference service. You can either use a variety of open source models, or deploy your own.
This example goes over how to use LangChain to interact with MosaicML Inference for text embedding.
# sign up for an account: https://forms.mosaicml.c... | https://python.langchain.com/en/latest/modules/models/text_embedding/examples/mosaicml.html |
267c5b3f911e-0 | .ipynb
.pdf
InstructEmbeddings
InstructEmbeddings#
Let’s load the HuggingFace instruct Embeddings class.
from langchain.embeddings import HuggingFaceInstructEmbeddings
embeddings = HuggingFaceInstructEmbeddings(
query_instruction="Represent the query for retrieval: "
)
load INSTRUCTOR_Transformer
max_seq_length 51... | https://python.langchain.com/en/latest/modules/models/text_embedding/examples/instruct_embeddings.html |
0b336920af0e-0 | .ipynb
.pdf
Jina
Jina#
Let’s load the Jina Embedding class.
from langchain.embeddings import JinaEmbeddings
embeddings = JinaEmbeddings(jina_auth_token=jina_auth_token, model_name="ViT-B-32::openai")
text = "This is a test document."
query_result = embeddings.embed_query(text)
doc_result = embeddings.embed_documents([t... | https://python.langchain.com/en/latest/modules/models/text_embedding/examples/jina.html |
af2f8cb2bc7e-0 | .rst
.pdf
Retrievers
Retrievers#
Note
Conceptual Guide
The retriever interface is a generic interface that makes it easy to combine documents with
language models. This interface exposes a get_relevant_documents method which takes in a query
(a string) and returns a list of documents.
Please see below for a list of all... | https://python.langchain.com/en/latest/modules/indexes/retrievers.html |
4ab8ad096232-0 | .rst
.pdf
Vectorstores
Vectorstores#
Note
Conceptual Guide
Vectorstores are one of the most important components of building indexes.
For an introduction to vectorstores and generic functionality see:
Getting Started
We also have documentation for all the types of vectorstores that are supported.
Please see below for t... | https://python.langchain.com/en/latest/modules/indexes/vectorstores.html |
e3665f35b9cc-0 | .rst
.pdf
Text Splitters
Text Splitters#
Note
Conceptual Guide
When you want to deal with long pieces of text, it is necessary to split up that text into chunks.
As simple as this sounds, there is a lot of potential complexity here. Ideally, you want to keep the semantically related pieces of text together. What “seman... | https://python.langchain.com/en/latest/modules/indexes/text_splitters.html |
e3665f35b9cc-1 | Getting Started
By Harrison Chase
© Copyright 2023, Harrison Chase.
Last updated on Jun 02, 2023. | https://python.langchain.com/en/latest/modules/indexes/text_splitters.html |
34ba2656710e-0 | .rst
.pdf
Document Loaders
Contents
Transform loaders
Public dataset or service loaders
Proprietary dataset or service loaders
Document Loaders#
Note
Conceptual Guide
Combining language models with your own text data is a powerful way to differentiate them.
The first step in doing this is to load the data into “Docum... | https://python.langchain.com/en/latest/modules/indexes/document_loaders.html |
34ba2656710e-1 | iFixit
IMSDb
MediaWikiDump
Wikipedia
YouTube transcripts
Proprietary dataset or service loaders#
These datasets and services are not from the public domain.
These loaders mostly transform data from specific formats of applications or cloud services,
for example Google Drive.
We need access tokens and sometime other par... | https://python.langchain.com/en/latest/modules/indexes/document_loaders.html |
2ec0d7d30348-0 | .ipynb
.pdf
Getting Started
Contents
One Line Index Creation
Walkthrough
Getting Started#
LangChain primarily focuses on constructing indexes with the goal of using them as a Retriever. In order to best understand what this means, it’s worth highlighting what the base Retriever interface is. The BaseRetriever class i... | https://python.langchain.com/en/latest/modules/indexes/getting_started.html |
2ec0d7d30348-1 | Create a Retriever from that index
Create a question answering chain
Ask questions!
Each of the steps has multiple sub steps and potential configurations. In this notebook we will primarily focus on (1). We will start by showing the one-liner for doing so, but then break down what is actually going on.
First, let’s imp... | https://python.langchain.com/en/latest/modules/indexes/getting_started.html |
2ec0d7d30348-2 | index.query_with_sources(query)
{'question': 'What did the president say about Ketanji Brown Jackson',
'answer': " The president said that he nominated Circuit Court of Appeals Judge Ketanji Brown Jackson, one of the nation's top legal minds, to continue Justice Breyer's legacy of excellence, and that she has received... | https://python.langchain.com/en/latest/modules/indexes/getting_started.html |
2ec0d7d30348-3 | We will then select which embeddings we want to use.
from langchain.embeddings import OpenAIEmbeddings
embeddings = OpenAIEmbeddings()
We now create the vectorstore to use as the index.
from langchain.vectorstores import Chroma
db = Chroma.from_documents(texts, embeddings)
Running Chroma using direct local API.
Using D... | https://python.langchain.com/en/latest/modules/indexes/getting_started.html |
2ec0d7d30348-4 | )
Hopefully this highlights what is going on under the hood of VectorstoreIndexCreator. While we think it’s important to have a simple way to create indexes, we also think it’s important to understand what’s going on under the hood.
previous
Indexes
next
Document Loaders
Contents
One Line Index Creation
Walkthrough... | https://python.langchain.com/en/latest/modules/indexes/getting_started.html |
0804652b1893-0 | .ipynb
.pdf
GitBook
Contents
Load from single GitBook page
Load from all paths in a given GitBook
GitBook#
GitBook is a modern documentation platform where teams can document everything from products to internal knowledge bases and APIs.
This notebook shows how to pull page data from any GitBook.
from langchain.docum... | https://python.langchain.com/en/latest/modules/indexes/document_loaders/examples/gitbook.html |
0804652b1893-1 | loader = GitbookLoader("https://docs.gitbook.com", load_all_paths=True)
all_pages_data = loader.load()
Fetching text from https://docs.gitbook.com/
Fetching text from https://docs.gitbook.com/getting-started/overview
Fetching text from https://docs.gitbook.com/getting-started/import
Fetching text from https://docs.gitb... | https://python.langchain.com/en/latest/modules/indexes/document_loaders/examples/gitbook.html |
0804652b1893-2 | Fetching text from https://docs.gitbook.com/troubleshooting/faqs
Fetching text from https://docs.gitbook.com/troubleshooting/hard-refresh
Fetching text from https://docs.gitbook.com/troubleshooting/report-bugs
Fetching text from https://docs.gitbook.com/troubleshooting/connectivity-issues
Fetching text from https://doc... | https://python.langchain.com/en/latest/modules/indexes/document_loaders/examples/gitbook.html |
0804652b1893-3 | Document(page_content="Import\nFind out how to easily migrate your existing documentation and which formats are supported.\nThe import function allows you to migrate and unify existing documentation in GitBook. You can choose to import single or multiple pages although limits apply. \nPermissions\nAll members with edit... | https://python.langchain.com/en/latest/modules/indexes/document_loaders/examples/gitbook.html |
0804652b1893-4 | started\nGit Sync\nLast modified \n4mo ago", lookup_str='', metadata={'source': 'https://docs.gitbook.com/getting-started/import', 'title': 'Import'}, lookup_index=0) | https://python.langchain.com/en/latest/modules/indexes/document_loaders/examples/gitbook.html |
0804652b1893-5 | previous
Figma
next
Git
Contents
Load from single GitBook page
Load from all paths in a given GitBook
By Harrison Chase
© Copyright 2023, Harrison Chase.
Last updated on Jun 02, 2023. | https://python.langchain.com/en/latest/modules/indexes/document_loaders/examples/gitbook.html |
cf5390df720b-0 | .ipynb
.pdf
BiliBili
BiliBili#
Bilibili is one of the most beloved long-form video sites in China.
This loader utilizes the bilibili-api to fetch the text transcript from Bilibili.
With this BiliBiliLoader, users can easily obtain the transcript of their desired video content on the platform.
#!pip install bilibili-api... | https://python.langchain.com/en/latest/modules/indexes/document_loaders/examples/bilibili.html |
6953cfa6dad0-0 | .ipynb
.pdf
Hacker News
Hacker News#
Hacker News (sometimes abbreviated as HN) is a social news website focusing on computer science and entrepreneurship. It is run by the investment fund and startup incubator Y Combinator. In general, content that can be submitted is defined as “anything that gratifies one’s intellect... | https://python.langchain.com/en/latest/modules/indexes/document_loaders/examples/hacker_news.html |
88594934936e-0 | .ipynb
.pdf
Twitter
Twitter#
Twitter is an online social media and social networking service.
This loader fetches the text from the Tweets of a list of Twitter users, using the tweepy Python package.
You must initialize the loader with your Twitter API token, and you need to pass in the Twitter username you want to ext... | https://python.langchain.com/en/latest/modules/indexes/document_loaders/examples/twitter.html |
88594934936e-1 | [Document(page_content='@MrAndyNgo @REI One store after another shutting down', metadata={'created_at': 'Tue Apr 18 03:45:50 +0000 2023', 'user_info': {'id': 44196397, 'id_str': '44196397', 'name': 'Elon Musk', 'screen_name': 'elonmusk', 'location': 'A Shortfall of Gravitas', 'profile_location': None, 'description': 'n... | https://python.langchain.com/en/latest/modules/indexes/document_loaders/examples/twitter.html |
88594934936e-2 | 'id': 16583846, 'id_str': '16583846', 'indices': [11, 15]}], 'urls': []}, 'source': '<a href="http://twitter.com/download/iphone" rel="nofollow">Twitter for iPhone</a>', 'in_reply_to_status_id': 1648134341678051328, 'in_reply_to_status_id_str': '1648134341678051328', 'in_reply_to_user_id': 2835451658, 'in_reply_to_user... | https://python.langchain.com/en/latest/modules/indexes/document_loaders/examples/twitter.html |
88594934936e-3 | 'DDEEF6', 'profile_text_color': '333333', 'profile_use_background_image': True, 'has_extended_profile': True, 'default_profile': False, 'default_profile_image': False, 'following': None, 'follow_request_sent': None, 'notifications': None, 'translator_type': 'none', 'withheld_in_countries': []}}), | https://python.langchain.com/en/latest/modules/indexes/document_loaders/examples/twitter.html |
88594934936e-4 | Document(page_content='@KanekoaTheGreat @joshrogin @glennbeck Large ships are fundamentally vulnerable to ballistic (hypersonic) missiles', metadata={'created_at': 'Tue Apr 18 03:43:25 +0000 2023', 'user_info': {'id': 44196397, 'id_str': '44196397', 'name': 'Elon Musk', 'screen_name': 'elonmusk', 'location': 'A Shortfa... | https://python.langchain.com/en/latest/modules/indexes/document_loaders/examples/twitter.html |
88594934936e-5 | 'REI', 'name': 'REI', 'id': 16583846, 'id_str': '16583846', 'indices': [11, 15]}], 'urls': []}, 'source': '<a href="http://twitter.com/download/iphone" rel="nofollow">Twitter for iPhone</a>', 'in_reply_to_status_id': 1648134341678051328, 'in_reply_to_status_id_str': '1648134341678051328', 'in_reply_to_user_id': 2835451... | https://python.langchain.com/en/latest/modules/indexes/document_loaders/examples/twitter.html |
88594934936e-6 | 'C0DEED', 'profile_sidebar_fill_color': 'DDEEF6', 'profile_text_color': '333333', 'profile_use_background_image': True, 'has_extended_profile': True, 'default_profile': False, 'default_profile_image': False, 'following': None, 'follow_request_sent': None, 'notifications': None, 'translator_type': 'none', 'withheld_in_c... | https://python.langchain.com/en/latest/modules/indexes/document_loaders/examples/twitter.html |
88594934936e-7 | Document(page_content='@KanekoaTheGreat The Golden Rule', metadata={'created_at': 'Tue Apr 18 03:37:17 +0000 2023', 'user_info': {'id': 44196397, 'id_str': '44196397', 'name': 'Elon Musk', 'screen_name': 'elonmusk', 'location': 'A Shortfall of Gravitas', 'profile_location': None, 'description': 'nothing', 'url': None, ... | https://python.langchain.com/en/latest/modules/indexes/document_loaders/examples/twitter.html |
88594934936e-8 | 16583846, 'id_str': '16583846', 'indices': [11, 15]}], 'urls': []}, 'source': '<a href="http://twitter.com/download/iphone" rel="nofollow">Twitter for iPhone</a>', 'in_reply_to_status_id': 1648134341678051328, 'in_reply_to_status_id_str': '1648134341678051328', 'in_reply_to_user_id': 2835451658, 'in_reply_to_user_id_st... | https://python.langchain.com/en/latest/modules/indexes/document_loaders/examples/twitter.html |
88594934936e-9 | 'DDEEF6', 'profile_text_color': '333333', 'profile_use_background_image': True, 'has_extended_profile': True, 'default_profile': False, 'default_profile_image': False, 'following': None, 'follow_request_sent': None, 'notifications': None, 'translator_type': 'none', 'withheld_in_countries': []}}), | https://python.langchain.com/en/latest/modules/indexes/document_loaders/examples/twitter.html |
88594934936e-10 | Document(page_content='@KanekoaTheGreat 🧐', metadata={'created_at': 'Tue Apr 18 03:35:48 +0000 2023', 'user_info': {'id': 44196397, 'id_str': '44196397', 'name': 'Elon Musk', 'screen_name': 'elonmusk', 'location': 'A Shortfall of Gravitas', 'profile_location': None, 'description': 'nothing', 'url': None, 'entities': {... | https://python.langchain.com/en/latest/modules/indexes/document_loaders/examples/twitter.html |
88594934936e-11 | 16583846, 'id_str': '16583846', 'indices': [11, 15]}], 'urls': []}, 'source': '<a href="http://twitter.com/download/iphone" rel="nofollow">Twitter for iPhone</a>', 'in_reply_to_status_id': 1648134341678051328, 'in_reply_to_status_id_str': '1648134341678051328', 'in_reply_to_user_id': 2835451658, 'in_reply_to_user_id_st... | https://python.langchain.com/en/latest/modules/indexes/document_loaders/examples/twitter.html |
88594934936e-12 | 'DDEEF6', 'profile_text_color': '333333', 'profile_use_background_image': True, 'has_extended_profile': True, 'default_profile': False, 'default_profile_image': False, 'following': None, 'follow_request_sent': None, 'notifications': None, 'translator_type': 'none', 'withheld_in_countries': []}}), | https://python.langchain.com/en/latest/modules/indexes/document_loaders/examples/twitter.html |
88594934936e-13 | Document(page_content='@TRHLofficial What’s he talking about and why is it sponsored by Erik’s son?', metadata={'created_at': 'Tue Apr 18 03:32:17 +0000 2023', 'user_info': {'id': 44196397, 'id_str': '44196397', 'name': 'Elon Musk', 'screen_name': 'elonmusk', 'location': 'A Shortfall of Gravitas', 'profile_location': N... | https://python.langchain.com/en/latest/modules/indexes/document_loaders/examples/twitter.html |
88594934936e-14 | 'id': 16583846, 'id_str': '16583846', 'indices': [11, 15]}], 'urls': []}, 'source': '<a href="http://twitter.com/download/iphone" rel="nofollow">Twitter for iPhone</a>', 'in_reply_to_status_id': 1648134341678051328, 'in_reply_to_status_id_str': '1648134341678051328', 'in_reply_to_user_id': 2835451658, 'in_reply_to_user... | https://python.langchain.com/en/latest/modules/indexes/document_loaders/examples/twitter.html |
88594934936e-15 | 'DDEEF6', 'profile_text_color': '333333', 'profile_use_background_image': True, 'has_extended_profile': True, 'default_profile': False, 'default_profile_image': False, 'following': None, 'follow_request_sent': None, 'notifications': None, 'translator_type': 'none', 'withheld_in_countries': []}})] | https://python.langchain.com/en/latest/modules/indexes/document_loaders/examples/twitter.html |
88594934936e-16 | previous
2Markdown
next
Text Splitters
By Harrison Chase
© Copyright 2023, Harrison Chase.
Last updated on Jun 02, 2023. | https://python.langchain.com/en/latest/modules/indexes/document_loaders/examples/twitter.html |
d9ce9027a1a2-0 | .ipynb
.pdf
Notion DB 2/2
Contents
Requirements
Setup
1. Create a Notion Table Database
2. Create a Notion Integration
3. Connect the Integration to the Database
4. Get the Database ID
Usage
Notion DB 2/2#
Notion is a collaboration platform with modified Markdown support that integrates kanban boards, tasks, wikis an... | https://python.langchain.com/en/latest/modules/indexes/document_loaders/examples/notiondb.html |
d9ce9027a1a2-1 | Click the “Submit” button to create the integration.
Once the integration is created, you’ll be provided with an Integration Token (API key). Copy this token and keep it safe, as you’ll need it to use the NotionDBLoader.
3. Connect the Integration to the Database#
To connect your integration to the database, follow the... | https://python.langchain.com/en/latest/modules/indexes/document_loaders/examples/notiondb.html |
d9ce9027a1a2-2 | ········
from langchain.document_loaders import NotionDBLoader
loader = NotionDBLoader(
integration_token=NOTION_TOKEN,
database_id=DATABASE_ID,
request_timeout_sec=30 # optional, defaults to 10
)
docs = loader.load()
print(docs)
previous
Modern Treasury
next
Notion DB 1/2
Contents
Requirements
Setup
1... | https://python.langchain.com/en/latest/modules/indexes/document_loaders/examples/notiondb.html |
20e981bc2607-0 | .ipynb
.pdf
Airbyte JSON
Airbyte JSON#
Airbyte is a data integration platform for ELT pipelines from APIs, databases & files to warehouses & lakes. It has the largest catalog of ELT connectors to data warehouses and databases.
This covers how to load any source from Airbyte into a local JSON file that can be read in as... | https://python.langchain.com/en/latest/modules/indexes/document_loaders/examples/airbyte_json.html |
20e981bc2607-1 | is_hidden: True
slot: 3
base_experience: 267
forms:
name: charizard
url: https://pokeapi.co/api/v2/pokemon-form/6/
game_indices:
game_index: 180
version:
name: red
url: https://pokeapi.co/api/v2/version/1/
game_index: 180
version:
name: blue
url: https://pokeapi.co/api/v2/version/2/
game_index: 180
version:
n
prev... | https://python.langchain.com/en/latest/modules/indexes/document_loaders/examples/airbyte_json.html |
3248ccf80db7-0 | .ipynb
.pdf
IMSDb
IMSDb#
IMSDb is the Internet Movie Script Database.
This covers how to load IMSDb webpages into a document format that we can use downstream.
from langchain.document_loaders import IMSDbLoader
loader = IMSDbLoader("https://imsdb.com/scripts/BlacKkKlansman.html")
data = loader.load()
data[0].page_conte... | https://python.langchain.com/en/latest/modules/indexes/document_loaders/examples/imsdb.html |
584eda2c2941-0 | .ipynb
.pdf
Jupyter Notebook
Jupyter Notebook#
Jupyter Notebook (formerly IPython Notebook) is a web-based interactive computational environment for creating notebook documents.
This notebook covers how to load data from a Jupyter notebook (.ipynb) into a format suitable by LangChain.
from langchain.document_loaders im... | https://python.langchain.com/en/latest/modules/indexes/document_loaders/examples/jupyter_notebook.html |
584eda2c2941-1 | traceback (bool): whether to include full traceback (default is False).
loader.load()
[Document(page_content='\'markdown\' cell: \'[\'# Notebook\', \'\', \'This notebook covers how to load data from an .ipynb notebook into a format suitable by LangChain.\']\'\n\n \'code\' cell: \'[\'from langchain.document_loaders impo... | https://python.langchain.com/en/latest/modules/indexes/document_loaders/examples/jupyter_notebook.html |
21b312da3a6b-0 | .ipynb
.pdf
Image captions
Contents
Prepare a list of image urls from Wikimedia
Create the loader
Create the index
Query
Image captions#
By default, the loader utilizes the pre-trained Salesforce BLIP image captioning model.
This notebook shows how to use the ImageCaptionLoader to generate a query-able index of image... | https://python.langchain.com/en/latest/modules/indexes/document_loaders/examples/image_captions.html |
21b312da3a6b-1 | 'https://upload.wikimedia.org/wikipedia/commons/thumb/5/5e/Messier83_-_Heic1403a.jpg/277px-Messier83_-_Heic1403a.jpg',
'https://upload.wikimedia.org/wikipedia/commons/thumb/b/b6/2022-01-22_Men%27s_World_Cup_at_2021-22_St._Moritz%E2%80%93Celerina_Luge_World_Cup_and_European_Championships_by_Sandro_Halank%E2%80%93257... | https://python.langchain.com/en/latest/modules/indexes/document_loaders/examples/image_captions.html |
21b312da3a6b-2 | warnings.warn(
[Document(page_content='an image of a frog on a flower [SEP]', metadata={'image_path': 'https://upload.wikimedia.org/wikipedia/commons/thumb/5/5a/Hyla_japonica_sep01.jpg/260px-Hyla_japonica_sep01.jpg'}),
Document(page_content='an image of a shark swimming in the ocean [SEP]', metadata={'image_path': 'ht... | https://python.langchain.com/en/latest/modules/indexes/document_loaders/examples/image_captions.html |
21b312da3a6b-3 | Document(page_content='an image of the spiral galaxy [SEP]', metadata={'image_path': 'https://upload.wikimedia.org/wikipedia/commons/thumb/5/5e/Messier83_-_Heic1403a.jpg/277px-Messier83_-_Heic1403a.jpg'}),
Document(page_content='an image of a man on skis in the snow [SEP]', metadata={'image_path': 'https://upload.wiki... | https://python.langchain.com/en/latest/modules/indexes/document_loaders/examples/image_captions.html |
21b312da3a6b-4 | index = VectorstoreIndexCreator().from_loaders([loader])
/Users/saitosean/dev/langchain/.venv/lib/python3.10/site-packages/tqdm/auto.py:21: TqdmWarning: IProgress not found. Please update jupyter and ipywidgets. See https://ipywidgets.readthedocs.io/en/stable/user_install.html
from .autonotebook import tqdm as notebo... | https://python.langchain.com/en/latest/modules/indexes/document_loaders/examples/image_captions.html |
9cc014eaf58e-0 | .ipynb
.pdf
AWS S3 File
AWS S3 File#
Amazon Simple Storage Service (Amazon S3) is an object storage service.
AWS S3 Buckets
This covers how to load document objects from an AWS S3 File object.
from langchain.document_loaders import S3FileLoader
#!pip install boto3
loader = S3FileLoader("testing-hwc", "fake.docx")
loade... | https://python.langchain.com/en/latest/modules/indexes/document_loaders/examples/aws_s3_file.html |
6b4b01271522-0 | .ipynb
.pdf
Obsidian
Obsidian#
Obsidian is a powerful and extensible knowledge base
that works on top of your local folder of plain text files.
This notebook covers how to load documents from an Obsidian database.
Since Obsidian is just stored on disk as a folder of Markdown files, the loader just takes a path to this ... | https://python.langchain.com/en/latest/modules/indexes/document_loaders/examples/obsidian.html |
bdf636a2307f-0 | .ipynb
.pdf
Notion DB 1/2
Contents
🧑 Instructions for ingesting your own dataset
Notion DB 1/2#
Notion is a collaboration platform with modified Markdown support that integrates kanban boards, tasks, wikis and databases. It is an all-in-one workspace for notetaking, knowledge and data management, and project and tas... | https://python.langchain.com/en/latest/modules/indexes/document_loaders/examples/notion.html |
5957676b2e9b-0 | .ipynb
.pdf
Facebook Chat
Facebook Chat#
Messenger is an American proprietary instant messaging app and platform developed by Meta Platforms. Originally developed as Facebook Chat in 2008, the company revamped its messaging service in 2010.
This notebook covers how to load data from the Facebook Chats into a format tha... | https://python.langchain.com/en/latest/modules/indexes/document_loaders/examples/facebook_chat.html |
5957676b2e9b-1 | loader = FacebookChatLoader("example_data/facebook_chat.json")
loader.load()
[Document(page_content='User 2 on 2023-02-05 03:46:11: Bye!\n\nUser 1 on 2023-02-05 03:43:55: Oh no worries! Bye\n\nUser 2 on 2023-02-05 03:24:37: No Im sorry it was my mistake, the blue one is not for sale\n\nUser 1 on 2023-02-05 03:05:40: I ... | https://python.langchain.com/en/latest/modules/indexes/document_loaders/examples/facebook_chat.html |
3c2481bc8e45-0 | .ipynb
.pdf
Sitemap
Contents
Filtering sitemap URLs
Local Sitemap
Sitemap#
Extends from the WebBaseLoader, SitemapLoader loads a sitemap from a given URL, and then scrape and load all pages in the sitemap, returning each page as a Document.
The scraping is done concurrently. There are reasonable limits to concurrent... | https://python.langchain.com/en/latest/modules/indexes/document_loaders/examples/sitemap.html |
3c2481bc8e45-1 | Document(page_content='\n\n\n\n\n\nWelcome to LangChain — 🦜🔗 LangChain 0.0.123\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\nSkip to main content\n\n\n\n\n\n\n\n\n\n\nCtrl+K\n\n\n\n\n\n\n\n\n\n\n\n\n🦜🔗 LangChain 0.0.123\n\n\n\nGetting Started\n\nQuickstart Guide\n\nMod... | https://python.langchain.com/en/latest/modules/indexes/document_loaders/examples/sitemap.html |
3c2481bc8e45-2 | JSON\nAZLyrics\nBlackboard\nCollege Confidential\nCopy Paste\nCSV Loader\nDirectory Loader\nEmail\nEverNote\nFacebook Chat\nFigma\nGCS Directory\nGCS File Storage\nGitBook\nGoogle Drive\nGutenberg\nHacker News\nHTML\niFixit\nImages\nIMSDb\nMarkdown\nNotebook\nNotion\nObsidian\nPDF\nPowerPoint\nReadTheDocs Documentation... | https://python.langchain.com/en/latest/modules/indexes/document_loaders/examples/sitemap.html |
3c2481bc8e45-3 | Chain\n\n\nUtility Chains\nAPI Chains\nSelf-Critique Chain with Constitutional AI\nBashChain\nLLMCheckerChain\nLLM Math\nLLMRequestsChain\nLLMSummarizationCheckerChain\nModeration\nPAL\nSQLite example\n\n\nAsync API for Chain\n\n\nKey Concepts\nReference\n\n\nAgents\nGetting Started\nKey Concepts\nHow-To Guides\nAgents... | https://python.langchain.com/en/latest/modules/indexes/document_loaders/examples/sitemap.html |
3c2481bc8e45-4 | Benchmarking: Search + Calculator\nAgent VectorDB Question Answering Benchmarking\nBenchmarking Template\nData Augmented Question Answering\nUsing Hugging Face Datasets\nLLM Math\nQuestion Answering Benchmarking: Paul Graham Essay\nQuestion Answering Benchmarking: State of the Union Address\nQA Generation\nQuestion Ans... | https://python.langchain.com/en/latest/modules/indexes/document_loaders/examples/sitemap.html |
3c2481bc8e45-5 | to LangChain\n\n\n\n\n Contents \n\n\n\nGetting Started\nModules\nUse Cases\nReference Docs\nLangChain Ecosystem\nAdditional Resources\n\n\n\n\n\n\n\n\nWelcome to LangChain#\nLarge language models (LLMs) are emerging as a transformative technology, enabling\ndevelopers to build applications that they previously could n... | https://python.langchain.com/en/latest/modules/indexes/document_loaders/examples/sitemap.html |
3c2481bc8e45-6 | of knowledge or computation. This can include Python REPLs, embeddings, search engines, and more. LangChain provides a large collection of common utils to use in your application.\nChains: Chains go beyond just a single LLM call, and are sequences of calls (whether to an LLM or a different utility). LangChain provides ... | https://python.langchain.com/en/latest/modules/indexes/document_loaders/examples/sitemap.html |
3c2481bc8e45-7 | Generation involves specific types of chains that first interact with an external datasource to fetch data to use in the generation step. Examples of this include summarization of long pieces of text and question/answering over specific data sources.\nQuestion Answering: Answering questions over specific documents, onl... | https://python.langchain.com/en/latest/modules/indexes/document_loaders/examples/sitemap.html |
3c2481bc8e45-8 | and explore other prompts, chains, and agents.\nGlossary: A glossary of all related terms, papers, methods, etc. Whether implemented in LangChain or not!\nGallery: A collection of our favorite projects that use LangChain. Useful for finding inspiration or seeing how things were done in other applications.\nDeployments:... | https://python.langchain.com/en/latest/modules/indexes/document_loaders/examples/sitemap.html |
3c2481bc8e45-9 | Filtering sitemap URLs#
Sitemaps can be massive files, with thousands of URLs. Often you don’t need every single one of them. You can filter the URLs by passing a list of strings or regex patterns to the url_filter parameter. Only URLs that match one of the patterns will be loaded.
loader = SitemapLoader(
"https... | https://python.langchain.com/en/latest/modules/indexes/document_loaders/examples/sitemap.html |
3c2481bc8e45-10 | Document(page_content='\n\n\n\n\n\nWelcome to LangChain — 🦜🔗 LangChain 0.0.123\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\nSkip to main content\n\n\n\n\n\n\n\n\n\n\nCtrl+K\n\n\n\n\n\n\n\n\n\n\n\n\n🦜🔗 LangChain 0.0.123\n\n\n\nGetting Started\n\nQuickstart Guide\n\nMod... | https://python.langchain.com/en/latest/modules/indexes/document_loaders/examples/sitemap.html |
3c2481bc8e45-11 | Face Hub\nInstructEmbeddings\nOpenAI\nSageMaker Endpoint Embeddings\nSelf Hosted Embeddings\nTensorflowHub\n\n\n\n\nPrompts\nPrompt Templates\nGetting Started\nHow-To Guides\nHow to create a custom prompt template\nHow to create a prompt template that uses few shot examples\nHow to work with partial Prompt Templates\nH... | https://python.langchain.com/en/latest/modules/indexes/document_loaders/examples/sitemap.html |
3c2481bc8e45-12 | Splitter\n\n\nVectorstores\nGetting Started\nAtlasDB\nChroma\nDeep Lake\nElasticSearch\nFAISS\nMilvus\nOpenSearch\nPGVector\nPinecone\nQdrant\nRedis\nWeaviate\n\n\nRetrievers\nChatGPT Plugin Retriever\nVectorStore Retriever\n\n\n\n\nMemory\nGetting Started\nHow-To Guides\nConversationBufferMemory\nConversationBufferWin... | https://python.langchain.com/en/latest/modules/indexes/document_loaders/examples/sitemap.html |
3c2481bc8e45-13 | Search API\nSerpAPI\nWolfram Alpha\nZapier Natural Language Actions API\n\n\nAgents\nAgent Types\nCustom Agent\nConversation Agent (for Chat Models)\nConversation Agent\nMRKL\nMRKL Chat\nReAct\nSelf Ask With Search\n\n\nToolkits\nCSV Agent\nJSON Agent\nOpenAPI Agent\nPandas Dataframe Agent\nPython Agent\nSQL Database A... | https://python.langchain.com/en/latest/modules/indexes/document_loaders/examples/sitemap.html |
3c2481bc8e45-14 | Serper Wrapper\nGooseAI\nGraphsignal\nHazy Research\nHelicone\nHugging Face\nMilvus\nModal\nNLPCloud\nOpenAI\nOpenSearch\nPetals\nPGVector\nPinecone\nPromptLayer\nQdrant\nRunhouse\nSearxNG Search API\nSerpAPI\nStochasticAI\nUnstructured\nWeights & Biases\nWeaviate\nWolfram Alpha Wrapper\nWriter\n\n\n\nAdditional Resour... | https://python.langchain.com/en/latest/modules/indexes/document_loaders/examples/sitemap.html |
3c2481bc8e45-15 | an Language Model application.\n\nGetting Started Documentation\n\n\n\n\n\nModules#\nThere are several main modules that LangChain provides support for.\nFor each module we provide some examples to get started, how-to guides, reference docs, and conceptual guides.\nThese modules are, in increasing order of complexity:\... | https://python.langchain.com/en/latest/modules/indexes/document_loaders/examples/sitemap.html |
3c2481bc8e45-16 | construct an answer.\nChatbots: Since language models are good at producing text, that makes them ideal for creating chatbots.\nQuerying Tabular Data: If you want to understand how to use LLMs to query data that is stored in a tabular format (csvs, SQL, dataframes, etc) you should read this page.\nInteracting with APIs... | https://python.langchain.com/en/latest/modules/indexes/document_loaders/examples/sitemap.html |
3c2481bc8e45-17 | template repositories for deploying LangChain apps.\nTracing: A guide on using tracing in LangChain to visualize the execution of chains and agents.\nModel Laboratory: Experimenting with different prompts, models, and chains is a big part of developing the best possible application. The ModelLaboratory makes it easy to... | https://python.langchain.com/en/latest/modules/indexes/document_loaders/examples/sitemap.html |
3c2481bc8e45-18 | Local Sitemap#
The sitemap loader can also be used to load local files.
sitemap_loader = SitemapLoader(web_path="example_data/sitemap.xml", is_local=True)
docs = sitemap_loader.load()
Fetching pages: 100%|###################################################################################################################... | https://python.langchain.com/en/latest/modules/indexes/document_loaders/examples/sitemap.html |
6eab9dd4e8b9-0 | .ipynb
.pdf
Images
Contents
Using Unstructured
Retain Elements
Images#
This covers how to load images such as JPG or PNG into a document format that we can use downstream.
Using Unstructured#
#!pip install pdfminer
from langchain.document_loaders.image import UnstructuredImageLoader
loader = UnstructuredImageLoader("... | https://python.langchain.com/en/latest/modules/indexes/document_loaders/examples/image.html |
6eab9dd4e8b9-1 | Document(page_content="LayoutParser: A Unified Toolkit for Deep\nLearning Based Document Image Analysis\n\n\n‘Zxjiang Shen' (F3}, Ruochen Zhang”, Melissa Dell*, Benjamin Charles Germain\nLeet, Jacob Carlson, and Weining LiF\n\n\nsugehen\n\nshangthrows, et\n\n“Abstract. Recent advanocs in document image analysis (DIA) h... | https://python.langchain.com/en/latest/modules/indexes/document_loaders/examples/image.html |
6eab9dd4e8b9-2 | Image Analysis» Deep Learning Layout Analysis\n‘Character Renguition - Open Serres dary « Tol\n\n\nIntroduction\n\n\n‘Deep Learning(DL)-based approaches are the state-of-the-art for a wide range of\ndoctiment image analysis (DIA) tea including document image clasiffeation [I]\n", lookup_str='', metadata={'source': 'lay... | https://python.langchain.com/en/latest/modules/indexes/document_loaders/examples/image.html |
6eab9dd4e8b9-3 | Retain Elements#
Under the hood, Unstructured creates different “elements” for different chunks of text. By default we combine those together, but you can easily keep that separation by specifying mode="elements".
loader = UnstructuredImageLoader("layout-parser-paper-fast.jpg", mode="elements")
data = loader.load()
dat... | https://python.langchain.com/en/latest/modules/indexes/document_loaders/examples/image.html |
47f11e6dbbda-0 | .ipynb
.pdf
Modern Treasury
Modern Treasury#
Modern Treasury simplifies complex payment operations. It is a unified platform to power products and processes that move money.
Connect to banks and payment systems
Track transactions and balances in real-time
Automate payment operations for scale
This notebook covers how t... | https://python.langchain.com/en/latest/modules/indexes/document_loaders/examples/modern_treasury.html |
67bacbbdb7bf-0 | .ipynb
.pdf
HuggingFace dataset
Contents
Example
HuggingFace dataset#
The Hugging Face Hub is home to over 5,000 datasets in more than 100 languages that can be used for a broad range of tasks across NLP, Computer Vision, and Audio. They used for a diverse range of tasks such as translation,
automatic speech recognit... | https://python.langchain.com/en/latest/modules/indexes/document_loaders/examples/hugging_face_dataset.html |
67bacbbdb7bf-1 | data = loader.load()
data[:15]
[Document(page_content='I rented I AM CURIOUS-YELLOW from my video store because of all the controversy that surrounded it when it was first released in 1967. I also heard that at first it was seized by U.S. customs if it ever tried to enter this country, therefore being a fan of films co... | https://python.langchain.com/en/latest/modules/indexes/document_loaders/examples/hugging_face_dataset.html |
67bacbbdb7bf-2 | Document(page_content='"I Am Curious: Yellow" is a risible and pretentious steaming pile. It doesn\'t matter what one\'s political views are because this film can hardly be taken seriously on any level. As for the claim that frontal male nudity is an automatic NC-17, that isn\'t true. I\'ve seen R-rated films with male... | https://python.langchain.com/en/latest/modules/indexes/document_loaders/examples/hugging_face_dataset.html |
67bacbbdb7bf-3 | Document(page_content="If only to avoid making this type of film in the future. This film is interesting as an experiment but tells no cogent story.<br /><br />One might feel virtuous for sitting thru it because it touches on so many IMPORTANT issues but it does so without any discernable motive. The viewer comes away ... | https://python.langchain.com/en/latest/modules/indexes/document_loaders/examples/hugging_face_dataset.html |
67bacbbdb7bf-4 | Document(page_content='Oh, brother...after hearing about this ridiculous film for umpteen years all I can think of is that old Peggy Lee song..<br /><br />"Is that all there is??" ...I was just an early teen when this smoked fish hit the U.S. I was too young to get in the theater (although I did manage to sneak into "G... | https://python.langchain.com/en/latest/modules/indexes/document_loaders/examples/hugging_face_dataset.html |
67bacbbdb7bf-5 | new generation of suckers who want to see that "naughty sex film" that "revolutionized the film industry"...<br /><br />Yeesh, avoid like the plague..Or if you MUST see it - rent the video and fast forward to the "dirty" parts, just to get it over with.<br /><br />', metadata={'label': 0}), | https://python.langchain.com/en/latest/modules/indexes/document_loaders/examples/hugging_face_dataset.html |
67bacbbdb7bf-6 | Document(page_content="I would put this at the top of my list of films in the category of unwatchable trash! There are films that are bad, but the worst kind are the ones that are unwatchable but you are suppose to like them because they are supposed to be good for you! The sex sequences, so shocking in its day, couldn... | https://python.langchain.com/en/latest/modules/indexes/document_loaders/examples/hugging_face_dataset.html |
67bacbbdb7bf-7 | Document(page_content='When I first saw a glimpse of this movie, I quickly noticed the actress who was playing the role of Lucille Ball. Rachel York\'s portrayal of Lucy is absolutely awful. Lucille Ball was an astounding comedian with incredible talent. To think about a legend like Lucille Ball being portrayed the way... | https://python.langchain.com/en/latest/modules/indexes/document_loaders/examples/hugging_face_dataset.html |
67bacbbdb7bf-8 | Document(page_content='Who are these "They"- the actors? the filmmakers? Certainly couldn\'t be the audience- this is among the most air-puffed productions in existence. It\'s the kind of movie that looks like it was a lot of fun to shoot\x97 TOO much fun, nobody is getting any actual work done, and that almost always ... | https://python.langchain.com/en/latest/modules/indexes/document_loaders/examples/hugging_face_dataset.html |
67bacbbdb7bf-9 | NOT what Gershwin (who wrote the song from which the movie\'s title is derived) had in mind; his stage musicals of the 20\'s may have been slight, but at least they were long on charm. "They All Laughed" tries to coast on its good intentions, but nobody- least of all Peter Bogdanovich - has the good sense to put on the... | https://python.langchain.com/en/latest/modules/indexes/document_loaders/examples/hugging_face_dataset.html |
67bacbbdb7bf-10 | Document(page_content="This is said to be a personal film for Peter Bogdonavitch. He based it on his life but changed things around to fit the characters, who are detectives. These detectives date beautiful models and have no problem getting them. Sounds more like a millionaire playboy filmmaker than a detective, doesn... | https://python.langchain.com/en/latest/modules/indexes/document_loaders/examples/hugging_face_dataset.html |
67bacbbdb7bf-11 | Document(page_content='It was great to see some of my favorite stars of 30 years ago including John Ritter, Ben Gazarra and Audrey Hepburn. They looked quite wonderful. But that was it. They were not given any characters or good lines to work with. I neither understood or cared what the characters were doing.<br /><br ... | https://python.langchain.com/en/latest/modules/indexes/document_loaders/examples/hugging_face_dataset.html |
67bacbbdb7bf-12 | Document(page_content="I can't believe that those praising this movie herein aren't thinking of some other film. I was prepared for the possibility that this would be awful, but the script (or lack thereof) makes for a film that's also pointless. On the plus side, the general level of craft on the part of the actors an... | https://python.langchain.com/en/latest/modules/indexes/document_loaders/examples/hugging_face_dataset.html |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.