id stringlengths 14 16 | text stringlengths 45 2.73k | source stringlengths 49 114 |
|---|---|---|
02b6448ef7a8-0 | .ipynb
.pdf
Apify Dataset
Contents
Prerequisites
An example with question answering
Apify Dataset#
This notebook shows how to load Apify datasets to LangChain.
Apify Dataset is a scaleable append-only storage with sequential access built for storing structured web scraping results, such as a list of products or Googl... | https://python.langchain.com/en/latest/modules/indexes/document_loaders/examples/apify_dataset.html |
02b6448ef7a8-1 | from langchain.docstore.document import Document
from langchain.document_loaders import ApifyDatasetLoader
from langchain.indexes import VectorstoreIndexCreator
loader = ApifyDatasetLoader(
dataset_id="your-dataset-id",
dataset_mapping_function=lambda item: Document(
page_content=item["text"] or "", met... | https://python.langchain.com/en/latest/modules/indexes/document_loaders/examples/apify_dataset.html |
406265ce2f69-0 | .ipynb
.pdf
AZLyrics
AZLyrics#
This covers how to load AZLyrics webpages into a document format that we can use downstream.
from langchain.document_loaders import AZLyricsLoader
loader = AZLyricsLoader("https://www.azlyrics.com/lyrics/mileycyrus/flowers.html")
data = loader.load()
data | https://python.langchain.com/en/latest/modules/indexes/document_loaders/examples/azlyrics.html |
406265ce2f69-1 | [Document(page_content="Miley Cyrus - Flowers Lyrics | AZLyrics.com\n\r\nWe were good, we were gold\nKinda dream that can't be sold\nWe were right till we weren't\nBuilt a home and watched it burn\n\nI didn't wanna leave you\nI didn't wanna lie\nStarted to cry but then remembered I\n\nI can buy myself flowers\nWrite my... | https://python.langchain.com/en/latest/modules/indexes/document_loaders/examples/azlyrics.html |
406265ce2f69-2 | to myself for hours, yeah\nSay things you don't understand\nI can take myself dancing\nAnd I can hold my own hand\nYeah, I can love me better than you can\n\nCan love me better\nI can love me better, baby\nCan love me better\nI can love me better, baby\nCan love me better\nI can love me better, baby\nCan love me better... | https://python.langchain.com/en/latest/modules/indexes/document_loaders/examples/azlyrics.html |
406265ce2f69-3 | love me better\nI\n", lookup_str='', metadata={'source': 'https://www.azlyrics.com/lyrics/mileycyrus/flowers.html'}, lookup_index=0)] | https://python.langchain.com/en/latest/modules/indexes/document_loaders/examples/azlyrics.html |
406265ce2f69-4 | previous
Apify Dataset
next
Azure Blob Storage Container
By Harrison Chase
© Copyright 2023, Harrison Chase.
Last updated on Apr 21, 2023. | https://python.langchain.com/en/latest/modules/indexes/document_loaders/examples/azlyrics.html |
b1ae08708ccf-0 | .ipynb
.pdf
Azure Blob Storage Container
Contents
Specifying a prefix
Azure Blob Storage Container#
This covers how to load document objects from a container on Azure Blob Storage.
from langchain.document_loaders import AzureBlobStorageContainerLoader
#!pip install azure-storage-blob
loader = AzureBlobStorageContaine... | https://python.langchain.com/en/latest/modules/indexes/document_loaders/examples/azure_blob_storage_container.html |
9044f2bde5bb-0 | .ipynb
.pdf
Azure Blob Storage File
Azure Blob Storage File#
This covers how to load document objects from a Azure Blob Storage file.
from langchain.document_loaders import AzureBlobStorageFileLoader
#!pip install azure-storage-blob
loader = AzureBlobStorageFileLoader(conn_str='<connection string>', container='<contain... | https://python.langchain.com/en/latest/modules/indexes/document_loaders/examples/azure_blob_storage_file.html |
f804c51effc3-0 | .ipynb
.pdf
BigQuery Loader
Contents
Basic Usage
Specifying Which Columns are Content vs Metadata
Adding Source to Metadata
BigQuery Loader#
Load a BigQuery query with one document per row.
from langchain.document_loaders import BigQueryLoader
BASE_QUERY = '''
SELECT
id,
dna_sequence,
organism
FROM (
SELECT
... | https://python.langchain.com/en/latest/modules/indexes/document_loaders/examples/bigquery.html |
f804c51effc3-1 | Specifying Which Columns are Content vs Metadata#
loader = BigQueryLoader(BASE_QUERY, page_content_columns=["dna_sequence", "organism"], metadata_columns=["id"])
data = loader.load()
print(data)
[Document(page_content='dna_sequence: ATTCGA\norganism: Lokiarchaeum sp. (strain GC14_75).', lookup_str='', metadata={'id': 1... | https://python.langchain.com/en/latest/modules/indexes/document_loaders/examples/bigquery.html |
f804c51effc3-2 | data = loader.load()
print(data)
[Document(page_content='id: 1\ndna_sequence: ATTCGA\norganism: Lokiarchaeum sp. (strain GC14_75).\nsource: 1', lookup_str='', metadata={'source': 1}, lookup_index=0), Document(page_content='id: 2\ndna_sequence: AGGCGA\norganism: Heimdallarchaeota archaeon (strain LC_2).\nsource: 2', loo... | https://python.langchain.com/en/latest/modules/indexes/document_loaders/examples/bigquery.html |
80697e2b127f-0 | .ipynb
.pdf
Bilibili
Bilibili#
This loader utilizes the bilibili-api to fetch the text transcript from Bilibili, one of the most beloved long-form video sites in China.
With this BiliBiliLoader, users can easily obtain the transcript of their desired video content on the platform.
from langchain.document_loaders.bilibi... | https://python.langchain.com/en/latest/modules/indexes/document_loaders/examples/bilibili.html |
b28e0d0551ee-0 | .ipynb
.pdf
Blackboard
Blackboard#
This covers how to load data from a Blackboard Learn instance.
from langchain.document_loaders import BlackboardLoader
loader = BlackboardLoader(
blackboard_course_url="https://blackboard.example.com/webapps/blackboard/execute/announcement?method=search&context=course_entry&course... | https://python.langchain.com/en/latest/modules/indexes/document_loaders/examples/blackboard.html |
1c71a005cc4f-0 | .ipynb
.pdf
College Confidential
College Confidential#
This covers how to load College Confidential webpages into a document format that we can use downstream.
from langchain.document_loaders import CollegeConfidentialLoader
loader = CollegeConfidentialLoader("https://www.collegeconfidential.com/colleges/brown-universi... | https://python.langchain.com/en/latest/modules/indexes/document_loaders/examples/college_confidential.html |
1c71a005cc4f-1 | [Document(page_content='\n\n\n\n\n\n\n\nA68FEB02-9D19-447C-B8BC-818149FD6EAF\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n Media (2)\n \n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\nE45B8B13-33D4-450E-B7DB-F66EFE8F2097\n\n\n\n\n\n\n\n\n\nE45B8B13-33D4-450E-B7DB-F66EFE8F2097\n\n\n\n\n\n\n\n\n\n\n\n\n\... | https://python.langchain.com/en/latest/modules/indexes/document_loaders/examples/college_confidential.html |
1c71a005cc4f-2 | students to get involved at Brown! \nLove music or performing? Join a campus band, sing in a chorus, or perform with one of the school\'s theater groups.\nInterested in journalism or communications? Brown students can write for the campus newspaper, host a radio show or be a producer for the student-run television chan... | https://python.langchain.com/en/latest/modules/indexes/document_loaders/examples/college_confidential.html |
1c71a005cc4f-3 | "good" school. Some factors that can help you determine what a good school for you might be include admissions criteria, acceptance rate, tuition costs, and more.\nLet\'s take a look at these factors to get a clearer sense of what Brown offers and if it could be the right college for you.\nBrown Acceptance Rate 2022\nI... | https://python.langchain.com/en/latest/modules/indexes/document_loaders/examples/college_confidential.html |
1c71a005cc4f-4 | six-year graduation rate for U.S. colleges and universities is 61% for public schools, and 67% for private, non-profit schools.\nJob Outcomes for Brown Grads\nJob placement stats are a good resource for understanding the value of a degree from Brown by providing a look on how job placement has gone for other grads. \nC... | https://python.langchain.com/en/latest/modules/indexes/document_loaders/examples/college_confidential.html |
1c71a005cc4f-5 | Financial Aid at Brown\nTuition is another important factor when choose a college. Some colleges may have high tuition, but do a better job at meeting students\' financial need.\nBrown meets 100% of the demonstrated financial need for undergraduates. The average financial aid package for a full-time, first-year studen... | https://python.langchain.com/en/latest/modules/indexes/document_loaders/examples/college_confidential.html |
1c71a005cc4f-6 | so be very wary of anyone asking you for money.\nLearn more about Tuition and Financial Aid at Brown.\nBased on this information, does Brown seem like a good fit? Remember, a school that is perfect for one person may be a terrible fit for someone else! So ask yourself: Is Brown a good school for you?\nIf Brown Universi... | https://python.langchain.com/en/latest/modules/indexes/document_loaders/examples/college_confidential.html |
1c71a005cc4f-7 | best way to reach campus is to take Interstate 95 to Providence, or book a flight to the nearest airport, T.F. Green.\nYou can also take a virtual campus tour to get a sense of what Brown and Providence are like without leaving home.\nConsidering Going to School in Rhode Island?\nSee a full list of colleges in Rhode Is... | https://python.langchain.com/en/latest/modules/indexes/document_loaders/examples/college_confidential.html |
1c71a005cc4f-8 | \n\n Virtual Tour\n \n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\nBrown Application Deadline\n\n\n\nFirst-Year Applications are Due\n\nJan 5\n\nTransfer Applications are Due\n\nMar 1\n\n\n\n \n The deadline for Fall first-year applications to Brown is \n ... | https://python.langchain.com/en/latest/modules/indexes/document_loaders/examples/college_confidential.html |
1c71a005cc4f-9 | for more information about deadlines for specific programs or special admissions programs\n \n \n\n\n\n\n\n\nBrown ACT Scores\n\n\n\n\nic_reflect\n\n\n\n\n\n\n\n\nACT Range\n\n\n \n 33 - 35\n \n \n\n\n\nEstimated Chance of Acceptanc... | https://python.langchain.com/en/latest/modules/indexes/document_loaders/examples/college_confidential.html |
1c71a005cc4f-10 | 720 - 770\n \n \n\n\n\nic_reflect\n\n\n\n\n\n\n\n\nMath SAT Range\n\n\n \n Not available\n \n \n\n\n\nic_reflect\n\n\n\n\n\n\n\n\nReading SAT Range\n\n\n \n 740 - 800\n... | https://python.langchain.com/en/latest/modules/indexes/document_loaders/examples/college_confidential.html |
1c71a005cc4f-11 | $82,286\n \nOut-of-State\n\n\n\n\n\n\n\nCost Breakdown\n\n\nIn State\n\n\nOut-of-State\n\n\n\n\nState Tuition\n\n\n\n $62,680\n \n\n\n\n $62,680\n \n\n\n\n\nFees\n\n\n\n $2,4... | https://python.langchain.com/en/latest/modules/indexes/document_loaders/examples/college_confidential.html |
1c71a005cc4f-12 | \n\n\n\n $15,840\n \n\n\n\n\nBooks\n\n\n\n $1,300\n \n\n\n\n $1,300\n \n\n\n\n\n\n Total (Before Financial Aid):\n \n\n\... | https://python.langchain.com/en/latest/modules/indexes/document_loaders/examples/college_confidential.html |
1c71a005cc4f-13 | \n\n\n\n\n\n\n\n\n\n\n\nStudent Life\n\n Wondering what life at Brown is like? There are approximately \n 10,696 students enrolled at \n Brown, \n including 7,349 undergraduate students and \n 3,347 graduate students.\n 96% percent of students attend school \n full-time... | https://python.langchain.com/en/latest/modules/indexes/document_loaders/examples/college_confidential.html |
1c71a005cc4f-14 | 4%\n \nPart Time\n\n\n\n\n\n\n\n 94%\n \n\n\n\n\nResidency\n\n\n\n 6%\n \nIn State\n\n\n\n\n 94%\n \nOut-of-State\n\n\n\n\n\n\n\n Data Source: IPEDs and Peterso... | https://python.langchain.com/en/latest/modules/indexes/document_loaders/examples/college_confidential.html |
1c71a005cc4f-15 | previous
Blackboard
next
Confluence
By Harrison Chase
© Copyright 2023, Harrison Chase.
Last updated on Apr 21, 2023. | https://python.langchain.com/en/latest/modules/indexes/document_loaders/examples/college_confidential.html |
fdb79b892b79-0 | .ipynb
.pdf
Confluence
Confluence#
A loader for Confluence pages.
This currently supports both username/api_key and Oauth2 login.
Specify a list page_ids and/or space_key to load in the corresponding pages into Document objects, if both are specified the union of both sets will be returned.
You can also specify a boole... | https://python.langchain.com/en/latest/modules/indexes/document_loaders/examples/confluence.html |
f39ce3c5e915-0 | .ipynb
.pdf
CoNLL-U
CoNLL-U#
This is an example of how to load a file in CoNLL-U format. The whole file is treated as one document. The example data (conllu.conllu) is based on one of the standard UD/CoNLL-U examples.
from langchain.document_loaders import CoNLLULoader
loader = CoNLLULoader("example_data/conllu.conllu"... | https://python.langchain.com/en/latest/modules/indexes/document_loaders/examples/CoNLL-U.html |
c62b57c52d57-0 | .ipynb
.pdf
Copy Paste
Contents
Metadata
Copy Paste#
This notebook covers how to load a document object from something you just want to copy and paste. In this case, you don’t even need to use a DocumentLoader, but rather can just construct the Document directly.
from langchain.docstore.document import Document
text ... | https://python.langchain.com/en/latest/modules/indexes/document_loaders/examples/copypaste.html |
4b89159f2b95-0 | .ipynb
.pdf
CSV Loader
Contents
Customizing the csv parsing and loading
Specify a column to be used identify the document source
CSV Loader#
Load csv files with a single row per document.
from langchain.document_loaders.csv_loader import CSVLoader
loader = CSVLoader(file_path='./example_data/mlb_teams_2012.csv')
data... | https://python.langchain.com/en/latest/modules/indexes/document_loaders/examples/csv.html |
4b89159f2b95-1 | [Document(page_content='Team: Nationals\n"Payroll (millions)": 81.34\n"Wins": 98', lookup_str='', metadata={'source': './example_data/mlb_teams_2012.csv', 'row': 0}, lookup_index=0), Document(page_content='Team: Reds\n"Payroll (millions)": 82.20\n"Wins": 97', lookup_str='', metadata={'source': './example_data/mlb_teams... | https://python.langchain.com/en/latest/modules/indexes/document_loaders/examples/csv.html |
4b89159f2b95-2 | lookup_index=0), Document(page_content='Team: Rangers\n"Payroll (millions)": 120.51\n"Wins": 93', lookup_str='', metadata={'source': './example_data/mlb_teams_2012.csv', 'row': 6}, lookup_index=0), Document(page_content='Team: Orioles\n"Payroll (millions)": 81.43\n"Wins": 93', lookup_str='', metadata={'source': './exam... | https://python.langchain.com/en/latest/modules/indexes/document_loaders/examples/csv.html |
4b89159f2b95-3 | 'row': 11}, lookup_index=0), Document(page_content='Team: Dodgers\n"Payroll (millions)": 95.14\n"Wins": 86', lookup_str='', metadata={'source': './example_data/mlb_teams_2012.csv', 'row': 12}, lookup_index=0), Document(page_content='Team: White Sox\n"Payroll (millions)": 96.92\n"Wins": 85', lookup_str='', metadata={'so... | https://python.langchain.com/en/latest/modules/indexes/document_loaders/examples/csv.html |
4b89159f2b95-4 | 'row': 17}, lookup_index=0), Document(page_content='Team: Padres\n"Payroll (millions)": 55.24\n"Wins": 76', lookup_str='', metadata={'source': './example_data/mlb_teams_2012.csv', 'row': 18}, lookup_index=0), Document(page_content='Team: Mariners\n"Payroll (millions)": 81.97\n"Wins": 75', lookup_str='', metadata={'sour... | https://python.langchain.com/en/latest/modules/indexes/document_loaders/examples/csv.html |
4b89159f2b95-5 | 'row': 23}, lookup_index=0), Document(page_content='Team: Red Sox\n"Payroll (millions)": 173.18\n"Wins": 69', lookup_str='', metadata={'source': './example_data/mlb_teams_2012.csv', 'row': 24}, lookup_index=0), Document(page_content='Team: Indians\n"Payroll (millions)": 78.43\n"Wins": 68', lookup_str='', metadata={'sou... | https://python.langchain.com/en/latest/modules/indexes/document_loaders/examples/csv.html |
4b89159f2b95-6 | Customizing the csv parsing and loading#
See the csv module documentation for more information of what csv args are supported.
loader = CSVLoader(file_path='./example_data/mlb_teams_2012.csv', csv_args={
'delimiter': ',',
'quotechar': '"',
'fieldnames': ['MLB Team', 'Payroll in millions', 'Wins']
})
data = ... | https://python.langchain.com/en/latest/modules/indexes/document_loaders/examples/csv.html |
4b89159f2b95-7 | [Document(page_content='MLB Team: Team\nPayroll in millions: "Payroll (millions)"\nWins: "Wins"', lookup_str='', metadata={'source': './example_data/mlb_teams_2012.csv', 'row': 0}, lookup_index=0), Document(page_content='MLB Team: Nationals\nPayroll in millions: 81.34\nWins: 98', lookup_str='', metadata={'source': './e... | https://python.langchain.com/en/latest/modules/indexes/document_loaders/examples/csv.html |
4b89159f2b95-8 | './example_data/mlb_teams_2012.csv', 'row': 5}, lookup_index=0), Document(page_content='MLB Team: Athletics\nPayroll in millions: 55.37\nWins: 94', lookup_str='', metadata={'source': './example_data/mlb_teams_2012.csv', 'row': 6}, lookup_index=0), Document(page_content='MLB Team: Rangers\nPayroll in millions: 120.51\nW... | https://python.langchain.com/en/latest/modules/indexes/document_loaders/examples/csv.html |
4b89159f2b95-9 | in millions: 132.30\nWins: 88', lookup_str='', metadata={'source': './example_data/mlb_teams_2012.csv', 'row': 11}, lookup_index=0), Document(page_content='MLB Team: Cardinals\nPayroll in millions: 110.30\nWins: 88', lookup_str='', metadata={'source': './example_data/mlb_teams_2012.csv', 'row': 12}, lookup_index=0), Do... | https://python.langchain.com/en/latest/modules/indexes/document_loaders/examples/csv.html |
4b89159f2b95-10 | 16}, lookup_index=0), Document(page_content='MLB Team: Diamondbacks\nPayroll in millions: 74.28\nWins: 81', lookup_str='', metadata={'source': './example_data/mlb_teams_2012.csv', 'row': 17}, lookup_index=0), Document(page_content='MLB Team: Pirates\nPayroll in millions: 63.43\nWins: 79', lookup_str='', metadata={'sour... | https://python.langchain.com/en/latest/modules/indexes/document_loaders/examples/csv.html |
4b89159f2b95-11 | metadata={'source': './example_data/mlb_teams_2012.csv', 'row': 22}, lookup_index=0), Document(page_content='MLB Team: Royals\nPayroll in millions: 60.91\nWins: 72', lookup_str='', metadata={'source': './example_data/mlb_teams_2012.csv', 'row': 23}, lookup_index=0), Document(page_content='MLB Team: Marlins\nPayroll in ... | https://python.langchain.com/en/latest/modules/indexes/document_loaders/examples/csv.html |
4b89159f2b95-12 | in millions: 78.06\nWins: 64', lookup_str='', metadata={'source': './example_data/mlb_teams_2012.csv', 'row': 28}, lookup_index=0), Document(page_content='MLB Team: Cubs\nPayroll in millions: 88.19\nWins: 61', lookup_str='', metadata={'source': './example_data/mlb_teams_2012.csv', 'row': 29}, lookup_index=0), Document(... | https://python.langchain.com/en/latest/modules/indexes/document_loaders/examples/csv.html |
4b89159f2b95-13 | Specify a column to be used identify the document source#
Use the source_column argument to specify a column to be set as the source for the document created from each row. Otherwise file_path will be used as the source for all documents created from the csv file.
This is useful when using documents loaded from CSV fil... | https://python.langchain.com/en/latest/modules/indexes/document_loaders/examples/csv.html |
4b89159f2b95-14 | [Document(page_content='Team: Nationals\n"Payroll (millions)": 81.34\n"Wins": 98', lookup_str='', metadata={'source': 'Nationals', 'row': 0}, lookup_index=0), Document(page_content='Team: Reds\n"Payroll (millions)": 82.20\n"Wins": 97', lookup_str='', metadata={'source': 'Reds', 'row': 1}, lookup_index=0), Document(page... | https://python.langchain.com/en/latest/modules/indexes/document_loaders/examples/csv.html |
4b89159f2b95-15 | 'row': 6}, lookup_index=0), Document(page_content='Team: Orioles\n"Payroll (millions)": 81.43\n"Wins": 93', lookup_str='', metadata={'source': 'Orioles', 'row': 7}, lookup_index=0), Document(page_content='Team: Rays\n"Payroll (millions)": 64.17\n"Wins": 90', lookup_str='', metadata={'source': 'Rays', 'row': 8}, lookup_... | https://python.langchain.com/en/latest/modules/indexes/document_loaders/examples/csv.html |
4b89159f2b95-16 | lookup_str='', metadata={'source': 'White Sox', 'row': 13}, lookup_index=0), Document(page_content='Team: Brewers\n"Payroll (millions)": 97.65\n"Wins": 83', lookup_str='', metadata={'source': 'Brewers', 'row': 14}, lookup_index=0), Document(page_content='Team: Phillies\n"Payroll (millions)": 174.54\n"Wins": 81', lookup... | https://python.langchain.com/en/latest/modules/indexes/document_loaders/examples/csv.html |
4b89159f2b95-17 | (millions)": 93.35\n"Wins": 74', lookup_str='', metadata={'source': 'Mets', 'row': 20}, lookup_index=0), Document(page_content='Team: Blue Jays\n"Payroll (millions)": 75.48\n"Wins": 73', lookup_str='', metadata={'source': 'Blue Jays', 'row': 21}, lookup_index=0), Document(page_content='Team: Royals\n"Payroll (millions)... | https://python.langchain.com/en/latest/modules/indexes/document_loaders/examples/csv.html |
4b89159f2b95-18 | lookup_index=0), Document(page_content='Team: Rockies\n"Payroll (millions)": 78.06\n"Wins": 64', lookup_str='', metadata={'source': 'Rockies', 'row': 27}, lookup_index=0), Document(page_content='Team: Cubs\n"Payroll (millions)": 88.19\n"Wins": 61', lookup_str='', metadata={'source': 'Cubs', 'row': 28}, lookup_index=0),... | https://python.langchain.com/en/latest/modules/indexes/document_loaders/examples/csv.html |
4b89159f2b95-19 | previous
Copy Paste
next
DataFrame Loader
Contents
Customizing the csv parsing and loading
Specify a column to be used identify the document source
By Harrison Chase
© Copyright 2023, Harrison Chase.
Last updated on Apr 21, 2023. | https://python.langchain.com/en/latest/modules/indexes/document_loaders/examples/csv.html |
3043a4c27cc1-0 | .ipynb
.pdf
DataFrame Loader
DataFrame Loader#
This notebook goes over how to load data from a pandas dataframe
import pandas as pd
df = pd.read_csv('example_data/mlb_teams_2012.csv')
df.head()
Team
"Payroll (millions)"
"Wins"
0
Nationals
81.34
98
1
Reds
82.20
97
2
Yankees
197.96
95
3
Giants
117.62
94
4
Braves
83.31
94... | https://python.langchain.com/en/latest/modules/indexes/document_loaders/examples/dataframe.html |
3043a4c27cc1-1 | Document(page_content='Rays', metadata={' "Payroll (millions)"': 64.17, ' "Wins"': 90}),
Document(page_content='Angels', metadata={' "Payroll (millions)"': 154.49, ' "Wins"': 89}),
Document(page_content='Tigers', metadata={' "Payroll (millions)"': 132.3, ' "Wins"': 88}),
Document(page_content='Cardinals', metadata={... | https://python.langchain.com/en/latest/modules/indexes/document_loaders/examples/dataframe.html |
3043a4c27cc1-2 | Document(page_content='Mets', metadata={' "Payroll (millions)"': 93.35, ' "Wins"': 74}),
Document(page_content='Blue Jays', metadata={' "Payroll (millions)"': 75.48, ' "Wins"': 73}),
Document(page_content='Royals', metadata={' "Payroll (millions)"': 60.91, ' "Wins"': 72}),
Document(page_content='Marlins', metadata={... | https://python.langchain.com/en/latest/modules/indexes/document_loaders/examples/dataframe.html |
156e760c824d-0 | .ipynb
.pdf
Diffbot
Diffbot#
This covers how to extract HTML documents from a list of URLs using the Diffbot extract API, into a document format that we can use downstream.
urls = [
"https://python.langchain.com/en/latest/index.html",
]
The Diffbot Extract API Requires an API token. Once you have it, you can extrac... | https://python.langchain.com/en/latest/modules/indexes/document_loaders/examples/diffbot.html |
156e760c824d-1 | [Document(page_content='LangChain is a framework for developing applications powered by language models. We believe that the most powerful and differentiated applications will not only call out to a language model via an API, but will also:\nBe data-aware: connect a language model to other sources of data\nBe agentic: ... | https://python.langchain.com/en/latest/modules/indexes/document_loaders/examples/diffbot.html |
156e760c824d-2 | This includes prompt management, prompt optimization, and prompt serialization.\nMemory: Memory is the concept of persisting state between calls of a chain/agent. LangChain provides a standard interface for memory, a collection of memory implementations, and examples of chains/agents that use memory.\nIndexes: Language... | https://python.langchain.com/en/latest/modules/indexes/document_loaders/examples/diffbot.html |
156e760c824d-3 | ways. LangChain also provides guidance and assistance in this. Below are some of the common use cases LangChain supports.\nPersonal Assistants: The main LangChain use case. Personal assistants need to take actions, remember interactions, and have knowledge about your data.\nQuestion Answering: The second big LangChain ... | https://python.langchain.com/en/latest/modules/indexes/document_loaders/examples/diffbot.html |
156e760c824d-4 | type of Data Augmented Generation.\nEvaluation: Generative models are notoriously hard to evaluate with traditional metrics. One new way of evaluating them is using language models themselves to do the evaluation. LangChain provides some prompts/chains for assisting in this.\nReference Docs\nAll of LangChain’s referenc... | https://python.langchain.com/en/latest/modules/indexes/document_loaders/examples/diffbot.html |
156e760c824d-5 | 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/diffbot.html |
156e760c824d-6 | previous
DataFrame Loader
next
Directory Loader
By Harrison Chase
© Copyright 2023, Harrison Chase.
Last updated on Apr 21, 2023. | https://python.langchain.com/en/latest/modules/indexes/document_loaders/examples/diffbot.html |
39c2e35259d7-0 | .ipynb
.pdf
Directory Loader
Contents
Change loader class
Directory Loader#
This covers how to use the DirectoryLoader to load all documents in a directory. Under the hood, by default this uses the UnstructuredLoader
from langchain.document_loaders import DirectoryLoader
We can use the glob parameter to control which... | https://python.langchain.com/en/latest/modules/indexes/document_loaders/examples/directory_loader.html |
1e146f84c47d-0 | .ipynb
.pdf
Discord
Discord#
You can follow the below steps to download your Discord data:
Go to your User Settings
Then go to Privacy and Safety
Head over to the Request all of my Data and click on Request Data button
It might take 30 days for you to receive your data. You’ll receive an email at the address which is r... | https://python.langchain.com/en/latest/modules/indexes/document_loaders/examples/discord_loader.html |
1311cfcd2511-0 | .ipynb
.pdf
DuckDB Loader
Contents
Specifying Which Columns are Content vs Metadata
Adding Source to Metadata
DuckDB Loader#
Load a DuckDB query with one document per row.
from langchain.document_loaders import DuckDBLoader
%%file example.csv
Team,Payroll
Nationals,81.34
Reds,82.20
Writing example.csv
loader = DuckDB... | https://python.langchain.com/en/latest/modules/indexes/document_loaders/examples/duckdb.html |
1311cfcd2511-1 | Specifying Which Columns are Content vs Metadata
Adding Source to Metadata
By Harrison Chase
© Copyright 2023, Harrison Chase.
Last updated on Apr 21, 2023. | https://python.langchain.com/en/latest/modules/indexes/document_loaders/examples/duckdb.html |
5b839f54e16b-0 | .ipynb
.pdf
Email
Contents
Using Unstructured
Retain Elements
Using OutlookMessageLoader
Email#
This notebook shows how to load email (.eml) and Microsoft Outlook (.msg) files.
Using Unstructured#
from langchain.document_loaders import UnstructuredEmailLoader
loader = UnstructuredEmailLoader('example_data/fake-email.... | https://python.langchain.com/en/latest/modules/indexes/document_loaders/examples/email.html |
5b839f54e16b-1 | previous
DuckDB Loader
next
EPubs
Contents
Using Unstructured
Retain Elements
Using OutlookMessageLoader
By Harrison Chase
© Copyright 2023, Harrison Chase.
Last updated on Apr 21, 2023. | https://python.langchain.com/en/latest/modules/indexes/document_loaders/examples/email.html |
406a86a6d37a-0 | .ipynb
.pdf
EPubs
Contents
Retain Elements
EPubs#
This covers how to load .epub documents into a document format that we can use downstream. You’ll need to install the pandocs package for this loader to work.
from langchain.document_loaders import UnstructuredEPubLoader
loader = UnstructuredEPubLoader("winter-sports.... | https://python.langchain.com/en/latest/modules/indexes/document_loaders/examples/epub.html |
5b17ebff8f72-0 | .ipynb
.pdf
EverNote
EverNote#
How to load EverNote file from disk.
# !pip install pypandoc
# import pypandoc
# pypandoc.download_pandoc()
from langchain.document_loaders import EverNoteLoader
loader = EverNoteLoader("example_data/testing.enex")
loader.load()
[Document(page_content='testing this\n\nwhat happens?\n\nto ... | https://python.langchain.com/en/latest/modules/indexes/document_loaders/examples/evernote.html |
66afbf542c72-0 | .ipynb
.pdf
Facebook Chat
Facebook Chat#
This notebook covers how to load data from the Facebook Chats into a format that can be ingested into LangChain.
from langchain.document_loaders import FacebookChatLoader
loader = FacebookChatLoader("example_data/facebook_chat.json")
loader.load()
[Document(page_content='User 2 ... | https://python.langchain.com/en/latest/modules/indexes/document_loaders/examples/facebook_chat.html |
66afbf542c72-1 | previous
EverNote
next
Figma
By Harrison Chase
© Copyright 2023, Harrison Chase.
Last updated on Apr 21, 2023. | https://python.langchain.com/en/latest/modules/indexes/document_loaders/examples/facebook_chat.html |
1860662a0b8b-0 | .ipynb
.pdf
Figma
Figma#
This notebook covers how to load data from the Figma REST API into a format that can be ingested into LangChain, along with example usage for code generation.
import os
from langchain.document_loaders.figma import FigmaFileLoader
from langchain.text_splitter import CharacterTextSplitter
from la... | https://python.langchain.com/en/latest/modules/indexes/document_loaders/examples/figma.html |
1860662a0b8b-1 | # See https://python.langchain.com/en/latest/modules/models/chat/getting_started.html for chat info
system_prompt_template = """You are expert coder Jon Carmack. Use the provided design context to create idomatic HTML/CSS code as possible based on the user request.
Everything must be inline in one file and your... | https://python.langchain.com/en/latest/modules/indexes/document_loaders/examples/figma.html |
1860662a0b8b-2 | <!DOCTYPE html>\n<html lang="en">\n<head>\n <meta charset="UTF-8">\n <meta name="viewport" content="width=device-width, initial-scale=1.0">\n <style>\n @import url(\'https://fonts.googleapis.com/css2?family=DM+Sans:wght@500;700&family=Inter:wght@600&display=swap\');\n\n body {\n margin... | https://python.langchain.com/en/latest/modules/indexes/document_loaders/examples/figma.html |
1860662a0b8b-3 | font-weight: 700;\n margin: 0;\n }\n\n .header nav {\n display: flex;\n align-items: center;\n }\n\n .header nav a {\n font-size: 14px;\n font-weight: 500;\n text-decoration: none;\n color: #000;\n margin... | https://python.langchain.com/en/latest/modules/indexes/document_loaders/examples/figma.html |
1860662a0b8b-4 | Ipsum</a>\n <a href="#">Lorem Ipsum</a>\n <a href="#">Lorem Ipsum</a>\n </nav>\n </header>\n</body>\n</html> | https://python.langchain.com/en/latest/modules/indexes/document_loaders/examples/figma.html |
1860662a0b8b-5 | previous
Facebook Chat
next
GCS Directory
By Harrison Chase
© Copyright 2023, Harrison Chase.
Last updated on Apr 21, 2023. | https://python.langchain.com/en/latest/modules/indexes/document_loaders/examples/figma.html |
420a1933ca03-0 | .ipynb
.pdf
GCS Directory
Contents
Specifying a prefix
GCS Directory#
This covers how to load document objects from an Google Cloud Storage (GCS) directory.
from langchain.document_loaders import GCSDirectoryLoader
# !pip install google-cloud-storage
loader = GCSDirectoryLoader(project_name="aist", bucket="testing-hw... | https://python.langchain.com/en/latest/modules/indexes/document_loaders/examples/gcs_directory.html |
420a1933ca03-1 | Specifying a prefix#
You can also specify a prefix for more finegrained control over what files to load.
loader = GCSDirectoryLoader(project_name="aist", bucket="testing-hwc", prefix="fake")
loader.load()
/Users/harrisonchase/workplace/langchain/.venv/lib/python3.10/site-packages/google/auth/_default.py:83: UserWarning... | https://python.langchain.com/en/latest/modules/indexes/document_loaders/examples/gcs_directory.html |
420a1933ca03-2 | By Harrison Chase
© Copyright 2023, Harrison Chase.
Last updated on Apr 21, 2023. | https://python.langchain.com/en/latest/modules/indexes/document_loaders/examples/gcs_directory.html |
f8e82ad52b2a-0 | .ipynb
.pdf
GCS File Storage
GCS File Storage#
This covers how to load document objects from an Google Cloud Storage (GCS) file object.
from langchain.document_loaders import GCSFileLoader
# !pip install google-cloud-storage
loader = GCSFileLoader(project_name="aist", bucket="testing-hwc", blob="fake.docx")
loader.load... | https://python.langchain.com/en/latest/modules/indexes/document_loaders/examples/gcs_file.html |
94ecbfd00264-0 | .ipynb
.pdf
Git
Contents
Load existing repository from disk
Clone repository from url
Filtering files to load
Git#
This notebook shows how to load text files from Git repository.
Load existing repository from disk#
from git import Repo
repo = Repo.clone_from(
"https://github.com/hwchase17/langchain", to_path="./e... | https://python.langchain.com/en/latest/modules/indexes/document_loaders/examples/git.html |
1c5f5155176c-0 | .ipynb
.pdf
GitBook
Contents
Load from single GitBook page
Load from all paths in a given GitBook
GitBook#
How to pull page data from any GitBook.
from langchain.document_loaders import GitbookLoader
loader = GitbookLoader("https://docs.gitbook.com")
Load from single GitBook page#
page_data = loader.load()
page_data
... | https://python.langchain.com/en/latest/modules/indexes/document_loaders/examples/gitbook.html |
1c5f5155176c-1 | 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.gitbook.com/getting-started/git-sync
Fetching text from https://docs.gitbook... | https://python.langchain.com/en/latest/modules/indexes/document_loaders/examples/gitbook.html |
1c5f5155176c-2 | 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://docs.gitbook.com/troubleshooting/support
print(f"fetched {len(all_pa... | https://python.langchain.com/en/latest/modules/indexes/document_loaders/examples/gitbook.html |
1c5f5155176c-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 |
1c5f5155176c-4 | in the page action menu, found in the table of contents:\nImport from the page action menu\nWhen you choose your input source, instructions will explain how to proceed.\nAlthough GitBook supports importing content from different kinds of sources, the end result might be different from your source due to differences in ... | https://python.langchain.com/en/latest/modules/indexes/document_loaders/examples/gitbook.html |
1c5f5155176c-5 | previous
Git
next
Google Drive
Contents
Load from single GitBook page
Load from all paths in a given GitBook
By Harrison Chase
© Copyright 2023, Harrison Chase.
Last updated on Apr 21, 2023. | https://python.langchain.com/en/latest/modules/indexes/document_loaders/examples/gitbook.html |
93ce6a6036e2-0 | .ipynb
.pdf
Google Drive
Contents
Prerequisites
🧑 Instructions for ingesting your Google Docs data
Google Drive#
This notebook covers how to load documents from Google Drive. Currently, only Google Docs are supported.
Prerequisites#
Create a Google Cloud project or use an existing project
Enable the Google Drive API... | https://python.langchain.com/en/latest/modules/indexes/document_loaders/examples/googledrive.html |
93ce6a6036e2-1 | # Optional: configure whether to recursively fetch files from subfolders. Defaults to False.
recursive=False
)
docs = loader.load()
previous
GitBook
next
Gutenberg
Contents
Prerequisites
🧑 Instructions for ingesting your Google Docs data
By Harrison Chase
© Copyright 2023, Harrison Chase.
L... | https://python.langchain.com/en/latest/modules/indexes/document_loaders/examples/googledrive.html |
c2175d0d8227-0 | .ipynb
.pdf
Gutenberg
Gutenberg#
This covers how to load links to Gutenberg e-books into a document format that we can use downstream.
from langchain.document_loaders import GutenbergLoader
loader = GutenbergLoader('https://www.gutenberg.org/cache/epub/69972/pg69972.txt')
data = loader.load()
data
previous
Google Drive... | https://python.langchain.com/en/latest/modules/indexes/document_loaders/examples/gutenberg.html |
0b5fee211c49-0 | .ipynb
.pdf
Hacker News
Hacker News#
How to pull page data and comments from Hacker News
from langchain.document_loaders import HNLoader
loader = HNLoader("https://news.ycombinator.com/item?id=34817881")
data = loader.load()
data
[Document(page_content="delta_p_delta_x 18 hours ago \n | next [–] \n\nAstrop... | https://python.langchain.com/en/latest/modules/indexes/document_loaders/examples/hn.html |
0b5fee211c49-1 | Document(page_content="andrewflnr 19 hours ago \n | prev | next [–] \n\nWhoa. I didn't know the accretion theory of Ia supernovae was dead, much less that it had been since 2011.\n \nreply", lookup_str='', metadata={'source': 'https://news.ycombinator.com/item?id=34817881', 'title': 'What Lights the Univer... | https://python.langchain.com/en/latest/modules/indexes/document_loaders/examples/hn.html |
06be9687e47b-0 | .ipynb
.pdf
HTML
Contents
Loading HTML with BeautifulSoup4
HTML#
This covers how to load HTML documents into a document format that we can use downstream.
from langchain.document_loaders import UnstructuredHTMLLoader
loader = UnstructuredHTMLLoader("example_data/fake-content.html")
data = loader.load()
data
[Document... | https://python.langchain.com/en/latest/modules/indexes/document_loaders/examples/html.html |
836361887c10-0 | .ipynb
.pdf
iFixit
Contents
Searching iFixit using /suggest
iFixit#
iFixit is the largest, open repair community on the web. The site contains nearly 100k repair manuals, 200k Questions & Answers on 42k devices, and all the data is licensed under CC-BY-NC-SA 3.0.
This loader will allow you to download the text of a r... | https://python.langchain.com/en/latest/modules/indexes/document_loaders/examples/ifixit.html |
836361887c10-1 | data = loader.load()
data
[Document(page_content="# Banana Teardown\nIn this teardown, we open a banana to see what's inside. Yellow and delicious, but most importantly, yellow.\n\n\n###Tools Required:\n\n - Fingers\n\n - Teeth\n\n - Thumbs\n\n\n###Parts Required:\n\n - None\n\n\n## Step 1\nTake one banana from the bu... | https://python.langchain.com/en/latest/modules/indexes/document_loaders/examples/ifixit.html |
836361887c10-2 | [Document(page_content='# My iPhone 6 is typing and opening apps by itself\nmy iphone 6 is typing and opening apps by itself. How do i fix this. I just bought it last week.\nI restored as manufactures cleaned up the screen\nthe problem continues\n\n## 27 Answers\n\nFilter by: \n\nMost Helpful\nNewest\nOldest\n\n### Acc... | https://python.langchain.com/en/latest/modules/indexes/document_loaders/examples/ifixit.html |
836361887c10-3 | same issues, screen freezing, opening apps by itself, selecting the screens and typing on it\'s own. I first suspected aliens and then ghosts and then hackers.\niPhone 6 is weak physically and tend to bend on pressure. And my phone had no case or cover.\nI took the phone to apple stores and they said sensors need to be... | https://python.langchain.com/en/latest/modules/indexes/document_loaders/examples/ifixit.html |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.