id stringlengths 14 16 | text stringlengths 31 3.14k | source stringlengths 58 124 |
|---|---|---|
056f81721b80-4 | Document(page_content='an image of a man on skis in the snow [SEP]', metadata={'image_path': '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.jpg/288px-2022-01-22_Men%27s_... | /content/https://python.langchain.com/en/latest/modules/indexes/document_loaders/examples/image_captions.html |
056f81721b80-5 | /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 notebook_tqdm
/Users/saitosean/dev/langchain/.venv/lib/python3.... | /content/https://python.langchain.com/en/latest/modules/indexes/document_loaders/examples/image_captions.html |
b5b79dcb1263-0 | .ipynb
.pdf
URL
Contents
URL
Selenium URL Loader
Setup
Playwright URL Loader
Setup
URL#
This covers how to load HTML documents from a list of URLs into a document format that we can use downstream.
from langchain.document_loaders import UnstructuredURLLoader
urls = [
"https://www.understandingwar.org/backgrounde... | /content/https://python.langchain.com/en/latest/modules/indexes/document_loaders/examples/url.html |
b5b79dcb1263-1 | Setup#
To use the PlaywrightURLLoader, you will need to install playwright and unstructured. Additionally, you will need to install the Playwright Chromium browser:
# Install playwright
!pip install "playwright"
!pip install "unstructured"
!playwright install
from langchain.document_loaders import PlaywrightURLLoader
u... | /content/https://python.langchain.com/en/latest/modules/indexes/document_loaders/examples/url.html |
a6eafc41ab63-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... | /content/https://python.langchain.com/en/latest/modules/indexes/document_loaders/examples/gcs_file.html |
24b96315d140-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... | /content/https://python.langchain.com/en/latest/modules/indexes/document_loaders/examples/college_confidential.html |
24b96315d140-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\... | /content/https://python.langchain.com/en/latest/modules/indexes/document_loaders/examples/college_confidential.html |
24b96315d140-2 | 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 channel.\nInterested in joining a fraternity or sorority? Brown has fraternities and sororities.\nPlannin... | /content/https://python.langchain.com/en/latest/modules/indexes/document_loaders/examples/college_confidential.html |
24b96315d140-3 | is extremely difficult to get into Brown. Around 6% of applicants get into Brown each year. In 2022, just 2,568 out of the 46,568 students who applied were accepted.\nRetention and Graduation Rates at Brown\nRetention refers to the number of students that stay enrolled at a school over time. This is a way to get a sens... | /content/https://python.langchain.com/en/latest/modules/indexes/document_loaders/examples/college_confidential.html |
24b96315d140-4 | each full-time student enrolled. \nTuition and 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... | /content/https://python.langchain.com/en/latest/modules/indexes/document_loaders/examples/college_confidential.html |
24b96315d140-5 | Life\nAcademics\nTuition & Aid\nBrown Community Forums\nThen use the college admissions predictor to take a data science look at your chances of getting into some of the best colleges and universities in the U.S.\nWhere is Brown?\nBrown is located in the urban setting of Providence, Rhode Island, less than an hour fro... | /content/https://python.langchain.com/en/latest/modules/indexes/document_loaders/examples/college_confidential.html |
24b96315d140-6 | \n The deadline for Fall first-year applications to Brown is \n Jan 5. \n \n \n \n\n \n The deadline for Fall transfer applications to Brown is \n Mar 1. \n \n \n \n\n ... | /content/https://python.langchain.com/en/latest/modules/indexes/document_loaders/examples/college_confidential.html |
24b96315d140-7 | SAT Range\n\n\n \n 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... | /content/https://python.langchain.com/en/latest/modules/indexes/document_loaders/examples/college_confidential.html |
24b96315d140-8 | $1,300\n \n\n\n\n $1,300\n \n\n\n\n\n\n Total (Before Financial Aid):\n \n\n\n\n $82,286\n \n\n\n\n $82,286\n ... | /content/https://python.langchain.com/en/latest/modules/indexes/document_loaders/examples/college_confidential.html |
24b96315d140-9 | \n', lookup_str='', metadata={'source': 'https://www.collegeconfidential.com/colleges/brown-university/'}, lookup_index=0)] | /content/https://python.langchain.com/en/latest/modules/indexes/document_loaders/examples/college_confidential.html |
24b96315d140-10 | previous
ChatGPT Data Loader
next
Confluence
By Harrison Chase
© Copyright 2023, Harrison Chase.
Last updated on Apr 26, 2023. | /content/https://python.langchain.com/en/latest/modules/indexes/document_loaders/examples/college_confidential.html |
a676c0beeb81-0 | .ipynb
.pdf
WhatsApp Chat
WhatsApp Chat#
This notebook covers how to load data from the WhatsApp Chats into a format that can be ingested into LangChain.
from langchain.document_loaders import WhatsAppChatLoader
loader = WhatsAppChatLoader("example_data/whatsapp_chat.txt")
loader.load()
previous
Web Base
next
Word Docu... | /content/https://python.langchain.com/en/latest/modules/indexes/document_loaders/examples/whatsapp_chat.html |
462dd74204d0-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
... | /content/https://python.langchain.com/en/latest/modules/indexes/document_loaders/examples/bigquery.html |
462dd74204d0-1 | data = loader.load()
print(data)
[Document(page_content='id: 1\ndna_sequence: ATTCGA\norganism: Lokiarchaeum sp. (strain GC14_75).', lookup_str='', metadata={}, lookup_index=0), Document(page_content='id: 2\ndna_sequence: AGGCGA\norganism: Heimdallarchaeota archaeon (strain LC_2).', lookup_str='', metadata={}, lookup_i... | /content/https://python.langchain.com/en/latest/modules/indexes/document_loaders/examples/bigquery.html |
462dd74204d0-2 | data = loader.load()
print(data)
[Document(page_content='dna_sequence: ATTCGA\norganism: Lokiarchaeum sp. (strain GC14_75).', lookup_str='', metadata={'id': 1}, lookup_index=0), Document(page_content='dna_sequence: AGGCGA\norganism: Heimdallarchaeota archaeon (strain LC_2).', lookup_str='', metadata={'id': 2}, lookup_i... | /content/https://python.langchain.com/en/latest/modules/indexes/document_loaders/examples/bigquery.html |
462dd74204d0-3 | UNNEST(new_array)
'''
loader = BigQueryLoader(ALIASED_QUERY, metadata_columns=["source"])
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\n... | /content/https://python.langchain.com/en/latest/modules/indexes/document_loaders/examples/bigquery.html |
29467bea6fa7-0 | .ipynb
.pdf
Notebook
Notebook#
This notebook covers how to load data from an .ipynb notebook into a format suitable by LangChain.
from langchain.document_loaders import NotebookLoader
loader = NotebookLoader("example_data/notebook.ipynb", include_outputs=True, max_output_length=20, remove_newline=True)
NotebookLoader.l... | /content/https://python.langchain.com/en/latest/modules/indexes/document_loaders/examples/notebook.html |
29467bea6fa7-1 | [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 import NotebookLoader\']\'\n\n \'code\' cell: \'[\'loader = NotebookLoader("example_data/n... | /content/https://python.langchain.com/en/latest/modules/indexes/document_loaders/examples/notebook.html |
29467bea6fa7-2 | max_output_length=20, remove_newline=True)\']\'\n\n', lookup_str='', metadata={'source': 'example_data/notebook.ipynb'}, lookup_index=0)] | /content/https://python.langchain.com/en/latest/modules/indexes/document_loaders/examples/notebook.html |
29467bea6fa7-3 | previous
Markdown
next
Notion
By Harrison Chase
© Copyright 2023, Harrison Chase.
Last updated on Apr 26, 2023. | /content/https://python.langchain.com/en/latest/modules/indexes/document_loaders/examples/notebook.html |
f09a2289f095-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... | /content/https://python.langchain.com/en/latest/modules/indexes/document_loaders/examples/apify_dataset.html |
f09a2289f095-1 | dataset_mapping_function=lambda dataset_item: Document(
page_content=dataset_item["text"], metadata={"source": dataset_item["url"]}
),
)
data = loader.load()
An example with question answering#
In this example, we use data from a dataset to answer a question.
from langchain.docstore.document import Document... | /content/https://python.langchain.com/en/latest/modules/indexes/document_loaders/examples/apify_dataset.html |
f09a2289f095-2 | AZLyrics
Contents
Prerequisites
An example with question answering
By Harrison Chase
© Copyright 2023, Harrison Chase.
Last updated on Apr 26, 2023. | /content/https://python.langchain.com/en/latest/modules/indexes/document_loaders/examples/apify_dataset.html |
43a519c0c443-0 | .ipynb
.pdf
Airbyte JSON
Airbyte JSON#
This covers how to load any source from Airbyte into a local JSON file that can be read in as a document
Prereqs:
Have docker desktop installed
Steps:
Clone Airbyte from GitHub - git clone https://github.com/airbytehq/airbyte.git
Switch into Airbyte directory - cd airbyte
Start Ai... | /content/https://python.langchain.com/en/latest/modules/indexes/document_loaders/examples/airbyte_json.html |
43a519c0c443-1 | url: https://pokeapi.co/api/v2/ability/94/
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/... | /content/https://python.langchain.com/en/latest/modules/indexes/document_loaders/examples/airbyte_json.html |
70ddc445f2c0-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.... | /content/https://python.langchain.com/en/latest/modules/indexes/document_loaders/examples/email.html |
70ddc445f2c0-1 | data = loader.load()
data[0]
Document(page_content='This is a test email to experiment with the MS Outlook MSG Extractor\r\n\r\n\r\n-- \r\n\r\n\r\nKind regards\r\n\r\n\r\n\r\n\r\nBrian Zhou\r\n\r\n', metadata={'subject': 'Test for TIF files', 'sender': 'Brian Zhou <brizhou@gmail.com>', 'date': 'Mon, 18 Nov 2013 16:26:2... | /content/https://python.langchain.com/en/latest/modules/indexes/document_loaders/examples/email.html |
f5b0c2fc6828-0 | .ipynb
.pdf
Subtitle Files
Subtitle Files#
How to load data from subtitle (.srt) files
from langchain.document_loaders import SRTLoader
loader = SRTLoader("example_data/Star_Wars_The_Clone_Wars_S06E07_Crisis_at_the_Heart.srt")
docs = loader.load()
docs[0].page_content[:100]
'<i>Corruption discovered\nat the core of the... | /content/https://python.langchain.com/en/latest/modules/indexes/document_loaders/examples/srt.html |
004e104e80f8-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.... | /content/https://python.langchain.com/en/latest/modules/indexes/document_loaders/examples/epub.html |
10a1a51c55a1-0 | .ipynb
.pdf
HuggingFace dataset loader
Contents
Example
HuggingFace dataset loader#
This notebook shows how to load Hugging Face Hub datasets to LangChain.
The Hugging Face Hub hosts a large number of community-curated datasets for a diverse range of tasks such as translation, automatic speech recognition, and image ... | /content/https://python.langchain.com/en/latest/modules/indexes/document_loaders/examples/hugging_face_dataset.html |
10a1a51c55a1-1 | [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 considered "controversial" I real... | /content/https://python.langchain.com/en/latest/modules/indexes/document_loaders/examples/hugging_face_dataset.html |
10a1a51c55a1-2 | (no pun intended) of Swedish cinema. But really, this film doesn\'t have much of a plot.', metadata={'label': 0}), | /content/https://python.langchain.com/en/latest/modules/indexes/document_loaders/examples/hugging_face_dataset.html |
10a1a51c55a1-3 | 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... | /content/https://python.langchain.com/en/latest/modules/indexes/document_loaders/examples/hugging_face_dataset.html |
10a1a51c55a1-4 | 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 ... | /content/https://python.langchain.com/en/latest/modules/indexes/document_loaders/examples/hugging_face_dataset.html |
10a1a51c55a1-5 | 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... | /content/https://python.langchain.com/en/latest/modules/indexes/document_loaders/examples/hugging_face_dataset.html |
10a1a51c55a1-6 | for years as a titilation for porno films (I am Curious, Lavender - for gay films, I Am Curious, Black - for blaxploitation films, etc..) and every ten years or so the thing rises from the dead, to be viewed by a new generation of suckers who want to see that "naughty sex film" that "revolutionized the film industry"..... | /content/https://python.langchain.com/en/latest/modules/indexes/document_loaders/examples/hugging_face_dataset.html |
10a1a51c55a1-7 | 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... | /content/https://python.langchain.com/en/latest/modules/indexes/document_loaders/examples/hugging_face_dataset.html |
10a1a51c55a1-8 | 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... | /content/https://python.langchain.com/en/latest/modules/indexes/document_loaders/examples/hugging_face_dataset.html |
10a1a51c55a1-9 | Laughter" would be a better choice. The casting of Lucille Ball and Desi Arnaz in "Before the Laughter" is much better compared to this. At least, a similar aspect is shown rather than nothing.', metadata={'label': 0}), | /content/https://python.langchain.com/en/latest/modules/indexes/document_loaders/examples/hugging_face_dataset.html |
10a1a51c55a1-10 | 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 ... | /content/https://python.langchain.com/en/latest/modules/indexes/document_loaders/examples/hugging_face_dataset.html |
10a1a51c55a1-11 | Vogue.<br /><br />Oh- and it has to be mentioned that Colleen Camp thoroughly annoys, even apart from her singing, which, while competent, is wholly unconvincing... the country and western numbers are woefully mismatched with the standards on the soundtrack. Surely this is NOT what Gershwin (who wrote the song from whi... | /content/https://python.langchain.com/en/latest/modules/indexes/document_loaders/examples/hugging_face_dataset.html |
10a1a51c55a1-12 | good time, I\'ll go to the park on a sunny day. For filmic expressions of joy and love, I\'ll stick to Ernest Lubitsch and Jaques Demy...', metadata={'label': 0}), | /content/https://python.langchain.com/en/latest/modules/indexes/document_loaders/examples/hugging_face_dataset.html |
10a1a51c55a1-13 | 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... | /content/https://python.langchain.com/en/latest/modules/indexes/document_loaders/examples/hugging_face_dataset.html |
10a1a51c55a1-14 | 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 ... | /content/https://python.langchain.com/en/latest/modules/indexes/document_loaders/examples/hugging_face_dataset.html |
10a1a51c55a1-15 | Moon" and only a very pale version of "What\'s Up, Doc".', metadata={'label': 0}), | /content/https://python.langchain.com/en/latest/modules/indexes/document_loaders/examples/hugging_face_dataset.html |
10a1a51c55a1-16 | 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... | /content/https://python.langchain.com/en/latest/modules/indexes/document_loaders/examples/hugging_face_dataset.html |
10a1a51c55a1-17 | Document(page_content='Never cast models and Playboy bunnies in your films! Bob Fosse\'s "Star 80" about Dorothy Stratten, of whom Bogdanovich was obsessed enough to have married her SISTER after her murder at the hands of her low-life husband, is a zillion times more interesting than Dorothy herself on the silver scre... | /content/https://python.langchain.com/en/latest/modules/indexes/document_loaders/examples/hugging_face_dataset.html |
10a1a51c55a1-18 | Document(page_content="Its not the cast. A finer group of actors, you could not find. Its not the setting. The director is in love with New York City, and by the end of the film, so are we all! Woody Allen could not improve upon what Bogdonovich has done here. If you are going to fall in love, or find love, Manhattan i... | /content/https://python.langchain.com/en/latest/modules/indexes/document_loaders/examples/hugging_face_dataset.html |
10a1a51c55a1-19 | Document(page_content='Today I found "They All Laughed" on VHS on sale in a rental. It was a really old and very used VHS, I had no information about this movie, but I liked the references listed on its cover: the names of Peter Bogdanovich, Audrey Hepburn, John Ritter and specially Dorothy Stratten attracted me, the p... | /content/https://python.langchain.com/en/latest/modules/indexes/document_loaders/examples/hugging_face_dataset.html |
10a1a51c55a1-20 | the sexy Patti Hansen, the future Mrs. Keith Richards; the always wonderful, even being fifty-two years old, Audrey Hepburn; and the song "Amigo", from Roberto Carlos. Although I do not like him, Roberto Carlos has been the most popular Brazilian singer since the end of the 60\'s and is called by his fans as "The King"... | /content/https://python.langchain.com/en/latest/modules/indexes/document_loaders/examples/hugging_face_dataset.html |
10a1a51c55a1-21 | Example#
In this example, we use data from a dataset to answer a question
from langchain.indexes import VectorstoreIndexCreator
from langchain.document_loaders.hugging_face_dataset import HuggingFaceDatasetLoader
dataset_name="tweet_eval"
page_content_column="text"
name="stance_climate"
loader=HuggingFaceDatasetLoader(... | /content/https://python.langchain.com/en/latest/modules/indexes/document_loaders/examples/hugging_face_dataset.html |
1f3698edfe7f-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... | /content/https://python.langchain.com/en/latest/modules/indexes/document_loaders/examples/bilibili.html |
789f24728403-0 | .ipynb
.pdf
ReadTheDocs Documentation
ReadTheDocs Documentation#
This notebook covers how to load content from html that was generated as part of a Read-The-Docs build.
For an example of this in the wild, see here.
This assumes that the html has already been scraped into a folder. This can be done by uncommenting and r... | /content/https://python.langchain.com/en/latest/modules/indexes/document_loaders/examples/readthedocs_documentation.html |
7c65be76b555-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... | /content/https://python.langchain.com/en/latest/modules/indexes/document_loaders/examples/blackboard.html |
63a338214ea8-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... | /content/https://python.langchain.com/en/latest/modules/indexes/document_loaders/examples/git.html |
63a338214ea8-1 | # eg. loading only python files
loader = GitLoader(repo_path="./example_data/test_repo1/", file_filter=lambda file_path: file_path.endswith(".py"))
previous
GCS File Storage
next
GitBook
Contents
Load existing repository from disk
Clone repository from url
Filtering files to load
By Harrison Chase
© Copy... | /content/https://python.langchain.com/en/latest/modules/indexes/document_loaders/examples/git.html |
07aaa59c86da-0 | .ipynb
.pdf
Blockchain Document Loader
Contents
Overview
Setup
Create a Blockchain Document Loader
Option 1: Ethereum Mainnet (default BlockchainType)
Option 2: Polygon Mainnet
(Optional) Using the Blockchain Document Loader
Setup Splitter and Index
Setup Models and Chains
Retrieval Chain
Blockchain Document Loader#
... | /content/https://python.langchain.com/en/latest/modules/indexes/document_loaders/examples/blockchain.html |
07aaa59c86da-1 | blockchainType = BlockchainType.ETH_MAINNET #default value, optional parameter
blockchainLoader = BlockchainDocumentLoader(contractAddress)
nfts = blockchainLoader.load()
nfts[:2] | /content/https://python.langchain.com/en/latest/modules/indexes/document_loaders/examples/blockchain.html |
07aaa59c86da-2 | [Document(page_content="{'contract': {'address': '0xbc4ca0eda7647a8ab7c2061c2e118a18a936f13d'}, 'id': {'tokenId': '0x0000000000000000000000000000000000000000000000000000000000000000', 'tokenMetadata': {'tokenType': 'ERC721'}}, 'title': '', 'description': '', 'tokenUri': {'gateway': 'https://alchemy.mypinata.cloud/ipfs/... | /content/https://python.langchain.com/en/latest/modules/indexes/document_loaders/examples/blockchain.html |
07aaa59c86da-3 | 'format': 'png', 'bytes': 133270}], 'metadata': {'image': 'ipfs://QmRRPWG96cmgTn2qSzjwr2qvfNEuhunv6FNeMFGa9bx6mQ', 'attributes': [{'value': 'Silver Hoop', 'trait_type': 'Earring'}, {'value': 'Orange', 'trait_type': 'Background'}, {'value': 'Robot', 'trait_type': 'Fur'}, {'value': 'Striped Tee', 'trait_type': 'Clothes'}... | /content/https://python.langchain.com/en/latest/modules/indexes/document_loaders/examples/blockchain.html |
07aaa59c86da-4 | 'Bored Ape Yacht Club', 'safelistRequestStatus': 'verified', 'imageUrl': 'https://i.seadn.io/gae/Ju9CkWtV-1Okvf45wo8UctR-M9He2PjILP0oOvxE89AyiPPGtrR3gysu1Zgy0hjd2xKIgjJJtWIc0ybj4Vd7wv8t3pxDGHoJBzDB?w=500&auto=format', 'description': 'The Bored Ape Yacht Club is a collection of 10,000 unique Bored Ape NFTs— unique digit... | /content/https://python.langchain.com/en/latest/modules/indexes/document_loaders/examples/blockchain.html |
07aaa59c86da-5 | Document(page_content="{'contract': {'address': '0xbc4ca0eda7647a8ab7c2061c2e118a18a936f13d'}, 'id': {'tokenId': '0x0000000000000000000000000000000000000000000000000000000000000001', 'tokenMetadata': {'tokenType': 'ERC721'}}, 'title': '', 'description': '', 'tokenUri': {'gateway': 'https://alchemy.mypinata.cloud/ipfs/Q... | /content/https://python.langchain.com/en/latest/modules/indexes/document_loaders/examples/blockchain.html |
07aaa59c86da-6 | 'format': 'png', 'bytes': 171425}], 'metadata': {'image': 'ipfs://QmPbxeGcXhYQQNgsC6a36dDyYUcHgMLnGKnF8pVFmGsvqi', 'attributes': [{'value': 'Grin', 'trait_type': 'Mouth'}, {'value': 'Vietnam Jacket', 'trait_type': 'Clothes'}, {'value': 'Orange', 'trait_type': 'Background'}, {'value': 'Blue Beams', 'trait_type': 'Eyes'}... | /content/https://python.langchain.com/en/latest/modules/indexes/document_loaders/examples/blockchain.html |
07aaa59c86da-7 | 'safelistRequestStatus': 'verified', 'imageUrl': 'https://i.seadn.io/gae/Ju9CkWtV-1Okvf45wo8UctR-M9He2PjILP0oOvxE89AyiPPGtrR3gysu1Zgy0hjd2xKIgjJJtWIc0ybj4Vd7wv8t3pxDGHoJBzDB?w=500&auto=format', 'description': 'The Bored Ape Yacht Club is a collection of 10,000 unique Bored Ape NFTs— unique digital collectibles living o... | /content/https://python.langchain.com/en/latest/modules/indexes/document_loaders/examples/blockchain.html |
07aaa59c86da-8 | Option 2: Polygon Mainnet#
contractAddress = "0x448676ffCd0aDf2D85C1f0565e8dde6924A9A7D9" # Polygon Mainnet contract address
blockchainType = BlockchainType.POLYGON_MAINNET
blockchainLoader = BlockchainDocumentLoader(contractAddress, blockchainType)
nfts = blockchainLoader.load()
nfts[:2] | /content/https://python.langchain.com/en/latest/modules/indexes/document_loaders/examples/blockchain.html |
07aaa59c86da-9 | [Document(page_content="{'contract': {'address': '0x448676ffcd0adf2d85c1f0565e8dde6924a9a7d9'}, 'id': {'tokenId': '0x01', 'tokenMetadata': {'tokenType': 'ERC1155'}}, 'title': 'Wyatt Horton #0001', 'description': 'A sleepy capybara', 'tokenUri': {'gateway': 'https://storage.googleapis.com/minted-nfts/smoothstack/avatars... | /content/https://python.langchain.com/en/latest/modules/indexes/document_loaders/examples/blockchain.html |
07aaa59c86da-10 | 'metadata': {'name': 'Wyatt Horton #0001', 'description': 'A sleepy capybara', 'image': 'https://storage.googleapis.com/minted-nfts/smoothstack/avatars/images/1.png', 'attributes': [{'value': 'Avatar', 'trait_type': 'Type'}, {'value': 'Animal', 'trait_type': 'Category'}, {'value': 'Capybara', 'trait_type': 'Class'}, {'... | /content/https://python.langchain.com/en/latest/modules/indexes/document_loaders/examples/blockchain.html |
07aaa59c86da-11 | Document(page_content="{'contract': {'address': '0x448676ffcd0adf2d85c1f0565e8dde6924a9a7d9'}, 'id': {'tokenId': '0x02', 'tokenMetadata': {'tokenType': 'ERC1155'}}, 'title': 'Dylan Leisler #0002', 'description': 'A chipper cat with a big, red bowtie', 'tokenUri': {'gateway': 'https://storage.googleapis.com/minted-nfts/... | /content/https://python.langchain.com/en/latest/modules/indexes/document_loaders/examples/blockchain.html |
07aaa59c86da-12 | 'metadata': {'name': 'Dylan Leisler #0002', 'description': 'A chipper cat with a big, red bowtie', 'image': 'https://storage.googleapis.com/minted-nfts/smoothstack/avatars/images/2.png', 'attributes': [{'value': 'Avatar', 'trait_type': 'Type'}, {'value': 'Animal', 'trait_type': 'Category'}, {'value': 'Cat', 'trait_type... | /content/https://python.langchain.com/en/latest/modules/indexes/document_loaders/examples/blockchain.html |
07aaa59c86da-13 | (Optional) Using the Blockchain Document Loader#
Setup Splitter and Index#
%pip install sentence_transformers chromadb openai tiktoken -q
Note: you may need to restart the kernel to use updated packages.
from langchain.indexes import VectorstoreIndexCreator
from langchain.embeddings import HuggingFaceEmbeddings
from la... | /content/https://python.langchain.com/en/latest/modules/indexes/document_loaders/examples/blockchain.html |
07aaa59c86da-14 | chainQA.run("What are some of the popular attributes?")
> Entering new RetrievalQA chain...
> Finished chain.
' Popular attributes include "Avatar" (Type), "Character" (Category), and "Human" or "Wizard" (Class).'
chainQA.run("How many NFTs are there?")
> Entering new RetrievalQA chain...
> Finished chain.
' There are ... | /content/https://python.langchain.com/en/latest/modules/indexes/document_loaders/examples/blockchain.html |
454db5f613e8-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 ... | /content/https://python.langchain.com/en/latest/modules/indexes/document_loaders/examples/facebook_chat.html |
454db5f613e8-1 | previous
EverNote
next
Figma
By Harrison Chase
© Copyright 2023, Harrison Chase.
Last updated on Apr 26, 2023. | /content/https://python.langchain.com/en/latest/modules/indexes/document_loaders/examples/facebook_chat.html |
914928f18f02-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... | /content/https://python.langchain.com/en/latest/modules/indexes/document_loaders/examples/diffbot.html |
914928f18f02-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: ... | /content/https://python.langchain.com/en/latest/modules/indexes/document_loaders/examples/diffbot.html |
914928f18f02-2 | of calls (whether to an LLM or a different utility). LangChain provides a standard interface for chains, lots of integrations with other tools, and end-to-end chains for common applications.\nAgents: Agents involve an LLM making decisions about which Actions to take, taking that Action, seeing an Observation, and repea... | /content/https://python.langchain.com/en/latest/modules/indexes/document_loaders/examples/diffbot.html |
914928f18f02-3 | chunks of information. A 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\nAl... | /content/https://python.langchain.com/en/latest/modules/indexes/document_loaders/examples/diffbot.html |
914928f18f02-4 | Join us on our Discord to discuss all things LangChain!\nProduction Support: As you move your LangChains into production, we’d love to offer more comprehensive support. Please fill out this form and we’ll set up a dedicated support Slack channel.', metadata={'source': 'https://python.langchain.com/en/latest/index.html'... | /content/https://python.langchain.com/en/latest/modules/indexes/document_loaders/examples/diffbot.html |
914928f18f02-5 | previous
DataFrame Loader
next
Directory Loader
By Harrison Chase
© Copyright 2023, Harrison Chase.
Last updated on Apr 26, 2023. | /content/https://python.langchain.com/en/latest/modules/indexes/document_loaders/examples/diffbot.html |
9a2be0bc8dc7-0 | .ipynb
.pdf
Images
Contents
Using Unstructured
Retain Elements
Images#
This covers how to load images such as JPGs PNGs into a document format that we can use downstream.
Using Unstructured#
from langchain.document_loaders.image import UnstructuredImageLoader
loader = UnstructuredImageLoader("layout-parser-paper-fast... | /content/https://python.langchain.com/en/latest/modules/indexes/document_loaders/examples/image.html |
9a2be0bc8dc7-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... | /content/https://python.langchain.com/en/latest/modules/indexes/document_loaders/examples/image.html |
9a2be0bc8dc7-2 | fal document dist\n{ation pipeline We demonutate that LayootPareer shea fr both\nlightweight and lrgeseledgtieation pipelines in eal-word uae ces\nThe leary pblely smal at Btspe://layost-pareergsthab So\n\n\n\n‘Keywords: Document Image Analysis» Deep Learning Layout Analysis\n‘Character Renguition - Open Serres dary « ... | /content/https://python.langchain.com/en/latest/modules/indexes/document_loaders/examples/image.html |
9a2be0bc8dc7-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... | /content/https://python.langchain.com/en/latest/modules/indexes/document_loaders/examples/image.html |
c33cd1cf311e-0 | .ipynb
.pdf
Notion
Contents
🧑 Instructions for ingesting your own dataset
Notion#
This notebook covers how to load documents from a Notion database dump.
In order to get this notion dump, follow these instructions:
🧑 Instructions for ingesting your own dataset#
Export your dataset from Notion. You can do this by cl... | /content/https://python.langchain.com/en/latest/modules/indexes/document_loaders/examples/notion.html |
5966a575cff6-0 | .ipynb
.pdf
Unstructured File Loader
Contents
Retain Elements
Define a Partitioning Strategy
PDF Example
Unstructured File Loader#
This notebook covers how to use Unstructured to load files of many types. Unstructured currently supports loading of text files, powerpoints, html, pdfs, images, and more.
# # Install pac... | /content/https://python.langchain.com/en/latest/modules/indexes/document_loaders/examples/unstructured_file.html |
5966a575cff6-1 | docs[0].page_content[:400]
'Madam Speaker, Madam Vice President, our First Lady and Second Gentleman. Members of Congress and the Cabinet. Justices of the Supreme Court. My fellow Americans.\n\nLast year COVID-19 kept us apart. This year we are finally together again.\n\nTonight, we meet as Democrats Republicans and In... | /content/https://python.langchain.com/en/latest/modules/indexes/document_loaders/examples/unstructured_file.html |
5966a575cff6-2 | Document(page_content='Tonight, we meet as Democrats Republicans and Independents. But most importantly as Americans.', lookup_str='', metadata={'source': '../../state_of_the_union.txt'}, lookup_index=0),
Document(page_content='With a duty to one another to the American people to the Constitution.', lookup_str='', met... | /content/https://python.langchain.com/en/latest/modules/indexes/document_loaders/examples/unstructured_file.html |
5966a575cff6-3 | from langchain.document_loaders import UnstructuredFileLoader
loader = UnstructuredFileLoader("layout-parser-paper-fast.pdf", strategy="fast", mode="elements")
docs = loader.load()
docs[:5]
[Document(page_content='1', lookup_str='', metadata={'source': 'layout-parser-paper-fast.pdf', 'filename': 'layout-parser-paper-fa... | /content/https://python.langchain.com/en/latest/modules/indexes/document_loaders/examples/unstructured_file.html |
5966a575cff6-4 | Document(page_content='2', lookup_str='', metadata={'source': 'layout-parser-paper-fast.pdf', 'filename': 'layout-parser-paper-fast.pdf', 'page_number': 1, 'category': 'UncategorizedText'}, lookup_index=0),
Document(page_content='n', lookup_str='', metadata={'source': 'layout-parser-paper-fast.pdf', 'filename': 'layou... | /content/https://python.langchain.com/en/latest/modules/indexes/document_loaders/examples/unstructured_file.html |
5966a575cff6-5 | Document(page_content='Zejiang Shen 1 ( (ea)\n ), Ruochen Zhang 2 , Melissa Dell 3 , Benjamin Charles Germain Lee 4 , Jacob Carlson 3 , and Weining Li 5', lookup_str='', metadata={'source': '../../layout-parser-paper.pdf'}, lookup_index=0),
Document(page_content='Allen Institute for AI shannons@allenai.org', lookup_st... | /content/https://python.langchain.com/en/latest/modules/indexes/document_loaders/examples/unstructured_file.html |
bd2369e780fe-0 | .ipynb
.pdf
Obsidian
Obsidian#
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 directory.
Obsidian files also sometimes contain metadata which is a YAML block at the top of the file. These val... | /content/https://python.langchain.com/en/latest/modules/indexes/document_loaders/examples/obsidian.html |
a0369b010890-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... | /content/https://python.langchain.com/en/latest/modules/indexes/document_loaders/examples/azure_blob_storage_file.html |
146c8962c704-0 | .ipynb
.pdf
Twitter
Twitter#
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 extract.
from langchain.document_loaders import TwitterTweetLoader
#... | /content/https://python.langchain.com/en/latest/modules/indexes/document_loaders/examples/twitter.html |
146c8962c704-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... | /content/https://python.langchain.com/en/latest/modules/indexes/document_loaders/examples/twitter.html |
146c8962c704-2 | {'hashtags': [], 'symbols': [], 'user_mentions': [{'screen_name': 'MrAndyNgo', 'name': 'Andy Ngô 🏳️\u200d🌈', 'id': 2835451658, 'id_str': '2835451658', 'indices': [0, 10]}, {'screen_name': 'REI', 'name': 'REI', 'id': 16583846, 'id_str': '16583846', 'indices': [11, 15]}], 'urls': []}, 'source': '<a href="http://twitter... | /content/https://python.langchain.com/en/latest/modules/indexes/document_loaders/examples/twitter.html |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.