id stringlengths 14 16 | text stringlengths 36 2.73k | source stringlengths 49 117 |
|---|---|---|
745009f27e5e-9 | Common JSON structures with jq schema#
The list below provides a reference to the possible jq_schema the user can use to extract content from the JSON data depending on the structure.
JSON -> [{"text": ...}, {"text": ...}, {"text": ...}]
jq_schema -> ".[].text"
JSON -> {"key": [{"text": ...}, {... | https://python.langchain.com/en/latest/modules/indexes/document_loaders/examples/json.html |
57010ecebaa9-0 | .ipynb
.pdf
Gutenberg
Gutenberg#
Project Gutenberg is an online library of free eBooks.
This notebook 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/699... | https://python.langchain.com/en/latest/modules/indexes/document_loaders/examples/gutenberg.html |
ad04c7c8f02d-0 | .ipynb
.pdf
Subtitle
Subtitle#
The SubRip file format is described on the Matroska multimedia container format website as “perhaps the most basic of all subtitle formats.” SubRip (SubRip Text) files are named with the extension .srt, and contain formatted lines of plain text in groups separated by a blank line. Subtitl... | https://python.langchain.com/en/latest/modules/indexes/document_loaders/examples/subtitle.html |
2c1c30244073-0 | .ipynb
.pdf
Psychic
Contents
Prerequisites
Loading documents
Converting the docs to embeddings
Psychic#
This notebook covers how to load documents from Psychic. See here for more details.
Prerequisites#
Follow the Quick Start section in this document
Log into the Psychic dashboard and get your secret key
Install the ... | https://python.langchain.com/en/latest/modules/indexes/document_loaders/examples/psychic.html |
2c1c30244073-1 | from langchain.vectorstores import Chroma
from langchain.text_splitter import CharacterTextSplitter
from langchain.llms import OpenAI
from langchain.chains import RetrievalQAWithSourcesChain
text_splitter = CharacterTextSplitter(chunk_size=1000, chunk_overlap=0)
texts = text_splitter.split_documents(documents)
embeddin... | https://python.langchain.com/en/latest/modules/indexes/document_loaders/examples/psychic.html |
c6634d7b92c7-0 | .ipynb
.pdf
Slack
Contents
🧑 Instructions for ingesting your own dataset
Slack#
Slack is an instant messaging program.
This notebook covers how to load documents from a Zipfile generated from a Slack export.
In order to get this Slack export, follow these instructions:
🧑 Instructions for ingesting your own dataset#... | https://python.langchain.com/en/latest/modules/indexes/document_loaders/examples/slack.html |
08f31b83d756-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 |
520116e8cff2-0 | .ipynb
.pdf
PDF
Contents
Using PyPDF
Using MathPix
Using Unstructured
Retain Elements
Fetching remote PDFs using Unstructured
Using PyPDFium2
Using PDFMiner
Using PDFMiner to generate HTML text
Using PyMuPDF
PyPDF Directory
Using pdfplumber
PDF#
Portable Document Format (PDF), standardized as ISO 32000, is a file for... | https://python.langchain.com/en/latest/modules/indexes/document_loaders/examples/pdf.html |
520116e8cff2-1 | Document(page_content='LayoutParser : A Uni\x0ced Toolkit for Deep\nLearning Based Document Image Analysis\nZejiang Shen1( \x00), Ruochen Zhang2, Melissa Dell3, Benjamin Charles Germain\nLee4, Jacob Carlson3, and Weining Li5\n1Allen Institute for AI\nshannons@allenai.org\n2Brown University\nruochen zhang@brown.edu\n3Ha... | https://python.langchain.com/en/latest/modules/indexes/document_loaders/examples/pdf.html |
520116e8cff2-2 | processing and computer\nvision, none of them are optimized for challenges in the domain of DIA.\nThis represents a major gap in the existing toolkit, as DIA is central to\nacademic research across a wide range of disciplines in the social sciences\nand humanities. This paper introduces LayoutParser , an open-source\nl... | https://python.langchain.com/en/latest/modules/indexes/document_loaders/examples/pdf.html |
520116e8cff2-3 | Learning(DL)-based approaches are the state-of-the-art for a wide range of\ndocument image analysis (DIA) tasks including document image classi\x0ccation [ 11,arXiv:2103.15348v2 [cs.CV] 21 Jun 2021', metadata={'source': 'example_data/layout-parser-paper.pdf', 'page': 0}) | https://python.langchain.com/en/latest/modules/indexes/document_loaders/examples/pdf.html |
520116e8cff2-4 | An advantage of this approach is that documents can be retrieved with page numbers.
We want to use OpenAIEmbeddings so we have to get the OpenAI API Key.
import os
import getpass
os.environ['OPENAI_API_KEY'] = getpass.getpass('OpenAI API Key:')
OpenAI API Key: ········
from langchain.vectorstores import FAISS
from lang... | https://python.langchain.com/en/latest/modules/indexes/document_loaders/examples/pdf.html |
520116e8cff2-5 | loader = MathpixPDFLoader("example_data/layout-parser-paper.pdf")
data = loader.load()
Using Unstructured#
from langchain.document_loaders import UnstructuredPDFLoader
loader = UnstructuredPDFLoader("example_data/layout-parser-paper.pdf")
data = loader.load()
Retain Elements#
Under the hood, Unstructured creates differ... | https://python.langchain.com/en/latest/modules/indexes/document_loaders/examples/pdf.html |
520116e8cff2-6 | Document(page_content='LayoutParser: A Unified Toolkit for Deep\nLearning Based Document Image Analysis\nZejiang Shen1 (�), Ruochen Zhang2, Melissa Dell3, Benjamin Charles Germain\nLee4, Jacob Carlson3, and Weining Li5\n1 Allen Institute for AI\nshannons@allenai.org\n2 Brown University\nruochen zhang@brown.edu\n3 Harvar... | https://python.langchain.com/en/latest/modules/indexes/document_loaders/examples/pdf.html |
520116e8cff2-7 | processing and computer\nvision, none of them are optimized for challenges in the domain of DIA.\nThis represents a major gap in the existing toolkit, as DIA is central to\nacademic research across a wide range of disciplines in the social sciences\nand humanities. This paper introduces LayoutParser, an open-source\nli... | https://python.langchain.com/en/latest/modules/indexes/document_loaders/examples/pdf.html |
520116e8cff2-8 | Learning(DL)-based approaches are the state-of-the-art for a wide range of\ndocument image analysis (DIA) tasks including document image classification [11,\narXiv:2103.15348v2 [cs.CV] 21 Jun 2021\n', lookup_str='', metadata={'file_path': 'example_data/layout-parser-paper.pdf', 'page_number': 1, 'total_pages': 16, 'fo... | https://python.langchain.com/en/latest/modules/indexes/document_loaders/examples/pdf.html |
520116e8cff2-9 | Fetching remote PDFs using Unstructured#
This covers how to load online pdfs into a document format that we can use downstream. This can be used for various online pdf sites such as https://open.umn.edu/opentextbooks/textbooks/ and https://arxiv.org/archive/
Note: all other pdf loaders can also be used to fetch remote ... | https://python.langchain.com/en/latest/modules/indexes/document_loaders/examples/pdf.html |
520116e8cff2-10 | [Document(page_content='A WEAK ( k, k ) -LEFSCHETZ THEOREM FOR PROJECTIVE TORIC ORBIFOLDS\n\nWilliam D. Montoya\n\nInstituto de Matem´atica, Estat´ıstica e Computa¸c˜ao Cient´ıfica,\n\nIn [3] we proved that, under suitable conditions, on a very general codimension s quasi- smooth intersection subvariety X in a projectiv... | https://python.langchain.com/en/latest/modules/indexes/document_loaders/examples/pdf.html |
520116e8cff2-11 | theorem for projective orbifolds ([11]). When p = d + 1 − s the proof relies on the Cayley trick, a trick which associates to X a quasi-smooth hypersurface Y in a projective vector bundle, and the Cayley Proposition (4.3) which gives an isomorphism of some primitive cohomologies (4.2) of X and Y . The Cayley trick, fol... | https://python.langchain.com/en/latest/modules/indexes/document_loaders/examples/pdf.html |
520116e8cff2-12 | N ⊗ Z R .\n\nif there exist k linearly independent primitive elements e\n\n, . . . , e k ∈ N such that σ = { µ\n\ne\n\n+ ⋯ + µ k e k } . • The generators e i are integral if for every i and any nonnegative rational number µ the product µe i is in N only if µ is an integer. • Given two rational simplicial cones σ , σ ′ ... | https://python.langchain.com/en/latest/modules/indexes/document_loaders/examples/pdf.html |
520116e8cff2-13 | < σ and σ ∩ σ ′ < σ ′ ;\n\nN R = σ\n\n∪ ⋅ ⋅ ⋅ ∪ σ t .\n\nA rational simplicial complete d -dimensional fan Σ defines a d -dimensional toric variety P d Σ having only orbifold singularities which we assume to be projective. Moreover, T ∶ = N ⊗ Z C ∗ ≃ ( C ∗ ) d is the torus action on P d Σ . We denote by Σ ( i ) the i -d... | https://python.langchain.com/en/latest/modules/indexes/document_loaders/examples/pdf.html |
520116e8cff2-14 | locus Z ( Σ ) ∶ = V ( B Σ ) in the affine space A d ∶ = Spec ( S ) is the irrelevant locus.\n\nProposition 2.3 (Theorem 5.1.11 [5]) . The toric variety P d Σ is a categorical quotient A d ∖ Z ( Σ ) by the group Hom ( Cl ( Σ ) , C ∗ ) and the group action is induced by the Cl ( Σ ) - grading of S .\n\nNow we give a brief ... | https://python.langchain.com/en/latest/modules/indexes/document_loaders/examples/pdf.html |
520116e8cff2-15 | A differential form on a complex orbifold Z is defined locally at z ∈ Z as a G -invariant differential form on C d where G ⊂ Gl ( d, C ) and Z is locally isomorphic to d\n\nRoughly speaking the local geometry of orbifolds reduces to local G -invariant geometry.\n\nWe have a complex of differential forms ( A ● ( Z ) , d ) a... | https://python.langchain.com/en/latest/modules/indexes/document_loaders/examples/pdf.html |
520116e8cff2-16 | . Quasi-smooth hypersurfaces or more generally quasi-smooth intersection sub-\n\nExample 3.2 . Quasi-smooth hypersurfaces or more generally quasi-smooth intersection sub- varieties are quasi-smooth subvarieties (see [2] or [7] for more details).\n\nRemark 3.3 . Quasi-smooth subvarieties are suborbifolds of P d Σ in the... | https://python.langchain.com/en/latest/modules/indexes/document_loaders/examples/pdf.html |
520116e8cff2-17 | / H 2 ( X, O X ) ≃ Dolbeault H 2 ( X, C ) deRham ≃ H 2 dR ( X, C ) / / H 0 , 2 ¯ ∂ ( X )\n\nof the proof follows as the ( 1 , 1 ) -Lefschetz theorem in [6].\n\nRemark 3.5 . For k = 1 and P d Σ as the projective space, we recover the classical ( 1 , 1 ) - Lefschetz theorem.\n\nBy the Hard Lefschetz Theorem for projectiv... | https://python.langchain.com/en/latest/modules/indexes/document_loaders/examples/pdf.html |
520116e8cff2-18 | If the dimension of X is 1 , 2 or 3 . The Hodge conjecture holds on X\n\nProof. If the dim C X = 1 the result is clear by the Hard Lefschetz theorem for projective orbifolds. The dimension 2 and 3 cases are covered by Theorem 3.5 and the Hard Lefschetz.\n\nCayley trick and Cayley proposition\n\nThe Cayley trick is a wa... | https://python.langchain.com/en/latest/modules/indexes/document_loaders/examples/pdf.html |
520116e8cff2-19 | Cox ring, without considering the grading, of P d Σ is C [ x 1 , . . . , x m ] then the Cox ring of P ( E ) is\n\nMoreover for X a quasi-smooth intersection subvariety cut off by f 1 , . . . , f s with deg ( f i ) = [ L i ] we relate the hypersurface Y cut off by F = y 1 f 1 + ⋅ ⋅ ⋅ + y s f s which turns out to be quasi-... | https://python.langchain.com/en/latest/modules/indexes/document_loaders/examples/pdf.html |
520116e8cff2-20 | y ) ∈ Y with y ≠ 0 has a preimage. Hence for any subvariety W = V ( I W ) ⊂ X ⊂ P d Σ there exists W ′ ⊂ Y ⊂ P d + s − 1 Σ ,X such that π ( W ′ ) = W , i.e., W ′ = { z = ( x, y ) ∣ x ∈ W } .\n\nFor X ⊂ P d Σ a quasi-smooth intersection variety the morphism in cohomology induced by the inclusion i ∗ ∶ H d − s ( P d Σ , ... | https://python.langchain.com/en/latest/modules/indexes/document_loaders/examples/pdf.html |
520116e8cff2-21 | − s prim ( X, Q ) with rational coefficients.\n\nH d − s ( P d Σ , C ) and H d − s ( X, C ) have pure Hodge structures, and the morphism i ∗ is com- patible with them, so that H d − s prim ( X ) gets a pure Hodge structure.\n\nThe next Proposition is the Cayley proposition.\n\nProposition 4.3. [Proposition 2.3 in [3] ] L... | https://python.langchain.com/en/latest/modules/indexes/document_loaders/examples/pdf.html |
520116e8cff2-22 | C . See the beginning of Section 7.1 in [10] for more details.\n\nTheorem 5.1. Let Y = { F = y 1 f 1 + ⋯ + y k f k = 0 } ⊂ P 2 k + 1 Σ ,X be the quasi-smooth hypersurface associated to the quasi-smooth intersection surface X = X f 1 ∩ ⋅ ⋅ ⋅ ∩ X f k ⊂ P k + 2 Σ . Then on Y the Hodge conjecture holds.\n\nthe Hodge conjec... | https://python.langchain.com/en/latest/modules/indexes/document_loaders/examples/pdf.html |
520116e8cff2-23 | 1 , . . . , λ C n with rational coefficients of H 1 , 1 prim ( X, Q ) , that is, there are n ∶ = h 1 , 1 prim ( X, Q ) algebraic curves C 1 , . . . , C n in X such that under the Poincar´e duality the class in homology [ C i ] goes to λ C i , [ C i ] ↦ λ C i . Recall that the Cox ring of P k + 2 is contained in the Cox r... | https://python.langchain.com/en/latest/modules/indexes/document_loaders/examples/pdf.html |
520116e8cff2-24 | degree. Moreover, by Remark 4.1 each C i is contained in Y = { F = y 1 f 1 + ⋯ + y k f k = 0 } and\n\nfurthermore it has codimension k .\n\nClaim: { C i } ni = 1 is a basis of prim ( ) . It is enough to prove that λ C i is different from zero in H k,k prim ( Y, Q ) or equivalently that the cohomology classes { λ C i } n... | https://python.langchain.com/en/latest/modules/indexes/document_loaders/examples/pdf.html |
520116e8cff2-25 | ,X such that V ∩ Y = C j so they are equal as a homology class of P 2 k + 1 Σ ,X ,i.e., [ V ∩ Y ] = [ C j ] . It is easy to check that π ( V ) ∩ X = C j as a subvariety of P k + 2 Σ where π ∶ ( x, y ) ↦ x . Hence [ π ( V ) ∩ X ] = [ C j ] which is equivalent to say that λ C j comes from P k + 2 Σ which contradicts the ... | https://python.langchain.com/en/latest/modules/indexes/document_loaders/examples/pdf.html |
520116e8cff2-26 | 0 } ⊂ P 2 k + 1 Σ ,X be the quasi-smooth hypersurface associated to a quasi-smooth intersection subvariety X = X f 1 ∩ ⋅ ⋅ ⋅ ∩ X f s ⊂ P d Σ such that d + s = 2 ( k + 1 ) . If the Hodge conjecture holds on X then it holds as well on Y .\n\nCorollary 5.4. If the dimension of Y is 2 s − 1 , 2 s or 2 s + 1 then the Hodge ... | https://python.langchain.com/en/latest/modules/indexes/document_loaders/examples/pdf.html |
520116e8cff2-27 | U., and Montoya, W. On the Hodge conjecture for quasi-smooth in- tersections in toric varieties. S˜ao Paulo J. Math. Sci. Special Section: Geometry in Algebra and Algebra in Geometry (\n\n). [\n\n] Caramello Jr, F. C. Introduction to orbifolds. a\n\niv:\n\nv\n\n(\n\n). [\n\n] Cox, D., Little, J., and Schenck, H. Toric ... | https://python.langchain.com/en/latest/modules/indexes/document_loaders/examples/pdf.html |
520116e8cff2-28 | Steenbrink, J. H. M. Intersection form for quasi-homogeneous singularities. Com- positio Mathematica\n\n,\n\n(\n\n),\n\n–\n\n[\n\n] Voisin, C. Hodge Theory and Complex Algebraic Geometry I, vol.\n\nof Cambridge Studies in Advanced Mathematics . Cambridge University Press,\n\n[\n\n] Wang, Z. Z., and Zaffran, D. A remark... | https://python.langchain.com/en/latest/modules/indexes/document_loaders/examples/pdf.html |
520116e8cff2-29 | U., and Montoya, W. On the Hodge conjecture for quasi-smooth in- tersections in toric varieties. S˜ao Paulo J. Math. Sci. Special Section: Geometry in Algebra and Algebra in Geometry (2021).\n\nA. R. Cohomology of complete intersections in toric varieties. Pub-', lookup_str='', metadata={'source': '/var/folders/ph/hhm7... | https://python.langchain.com/en/latest/modules/indexes/document_loaders/examples/pdf.html |
520116e8cff2-30 | Using PyPDFium2#
from langchain.document_loaders import PyPDFium2Loader
loader = PyPDFium2Loader("example_data/layout-parser-paper.pdf")
data = loader.load()
Using PDFMiner#
from langchain.document_loaders import PDFMinerLoader
loader = PDFMinerLoader("example_data/layout-parser-paper.pdf")
data = loader.load()
Using P... | https://python.langchain.com/en/latest/modules/indexes/document_loaders/examples/pdf.html |
520116e8cff2-31 | cur_text = c.text
snippets.append((cur_text,cur_fs))
# Note: The above logic is very straightforward. One can also add more strategies such as removing duplicate snippets (as
# headers/footers in a PDF appear on multiple pages so if we find duplicatess safe to assume that it is redundant info)
from langchain.docstore.d... | https://python.langchain.com/en/latest/modules/indexes/document_loaders/examples/pdf.html |
520116e8cff2-32 | # section (e.g. title of a pdf will have the highest font size but we don't want it to subsume all sections)
metadata={'heading':s[0], 'content_font': 0, 'heading_font': s[1]}
metadata.update(data.metadata)
semantic_snippets.append(Document(page_content='',metadata=metadata))
cur_idx += 1
semantic_snipp... | https://python.langchain.com/en/latest/modules/indexes/document_loaders/examples/pdf.html |
520116e8cff2-33 | Document(page_content='Recently, various DL models and datasets have been developed for layout analysis\ntasks. The dhSegment [22] utilizes fully convolutional networks [20] for segmen-\ntation tasks on historical documents. Object detection-based methods like Faster\nR-CNN [28] and Mask R-CNN [12] are used for identif... | https://python.langchain.com/en/latest/modules/indexes/document_loaders/examples/pdf.html |
520116e8cff2-34 | by Neudecker et al. [21], it is designed for\nanalyzing historical documents, and provides no supports for recent DL models.\nThe DocumentLayoutAnalysis project8 focuses on processing born-digital PDF\ndocuments via analyzing the stored PDF data. Repositories like DeepLayout9\nand Detectron2-PubLayNet10 are individual ... | https://python.langchain.com/en/latest/modules/indexes/document_loaders/examples/pdf.html |
520116e8cff2-35 | type as ‘code’.\n7 https://ocr-d.de/en/about\n8 https://github.com/BobLd/DocumentLayoutAnalysis\n9 https://github.com/leonlulu/DeepLayout\n10 https://github.com/hpanwar08/detectron2\n11 https://github.com/JaidedAI/EasyOCR\n12 https://github.com/PaddlePaddle/PaddleOCR\n4\nZ. Shen et al.\nFig. 1: The overall architecture... | https://python.langchain.com/en/latest/modules/indexes/document_loaders/examples/pdf.html |
520116e8cff2-36 | and deploying models for general computer\nvision and natural language processing problems. LayoutParser, on the other\nhand, specializes specifically in DIA tasks. LayoutParser is also equipped with a\ncommunity platform inspired by established model hubs such as Torch Hub [23]\nand TensorFlow Hub [1]. It enables the s... | https://python.langchain.com/en/latest/modules/indexes/document_loaders/examples/pdf.html |
520116e8cff2-37 | Using PyMuPDF#
This is the fastest of the PDF parsing options, and contains detailed metadata about the PDF and its pages, as well as returns one document per page.
from langchain.document_loaders import PyMuPDFLoader
loader = PyMuPDFLoader("example_data/layout-parser-paper.pdf")
data = loader.load()
data[0] | https://python.langchain.com/en/latest/modules/indexes/document_loaders/examples/pdf.html |
520116e8cff2-38 | Document(page_content='LayoutParser: A Unified Toolkit for Deep\nLearning Based Document Image Analysis\nZejiang Shen1 (�), Ruochen Zhang2, Melissa Dell3, Benjamin Charles Germain\nLee4, Jacob Carlson3, and Weining Li5\n1 Allen Institute for AI\nshannons@allenai.org\n2 Brown University\nruochen zhang@brown.edu\n3 Harvar... | https://python.langchain.com/en/latest/modules/indexes/document_loaders/examples/pdf.html |
520116e8cff2-39 | processing and computer\nvision, none of them are optimized for challenges in the domain of DIA.\nThis represents a major gap in the existing toolkit, as DIA is central to\nacademic research across a wide range of disciplines in the social sciences\nand humanities. This paper introduces LayoutParser, an open-source\nli... | https://python.langchain.com/en/latest/modules/indexes/document_loaders/examples/pdf.html |
520116e8cff2-40 | Learning(DL)-based approaches are the state-of-the-art for a wide range of\ndocument image analysis (DIA) tasks including document image classification [11,\narXiv:2103.15348v2 [cs.CV] 21 Jun 2021\n', lookup_str='', metadata={'file_path': 'example_data/layout-parser-paper.pdf', 'page_number': 1, 'total_pages': 16, 'fo... | https://python.langchain.com/en/latest/modules/indexes/document_loaders/examples/pdf.html |
520116e8cff2-41 | Additionally, you can pass along any of the options from the PyMuPDF documentation as keyword arguments in the load call, and it will be pass along to the get_text() call.
PyPDF Directory#
Load PDFs from directory
from langchain.document_loaders import PyPDFDirectoryLoader
loader = PyPDFDirectoryLoader("example_data/")... | https://python.langchain.com/en/latest/modules/indexes/document_loaders/examples/pdf.html |
520116e8cff2-42 | Document(page_content='LayoutParser: A Unified Toolkit for Deep\nLearning Based Document Image Analysis\nZejiang Shen1 ((cid:0)), Ruochen Zhang2, Melissa Dell3, Benjamin Charles Germain\nLee4, Jacob Carlson3, and Weining Li5\n1 Allen Institute for AI\n1202 shannons@allenai.org\n2 Brown University\nruochen zhang@brown.e... | https://python.langchain.com/en/latest/modules/indexes/document_loaders/examples/pdf.html |
520116e8cff2-43 | of them are optimized for challenges in the domain of DIA.\nThis represents a major gap in the existing toolkit, as DIA is central to\nacademicresearchacross awiderangeof disciplinesinthesocialsciences\nand humanities. This paper introduces LayoutParser, an open-source\nlibrary for streamlining the usage of DL in DIA r... | https://python.langchain.com/en/latest/modules/indexes/document_loaders/examples/pdf.html |
520116e8cff2-44 | metadata={'source': 'example_data/layout-parser-paper.pdf', 'file_path': 'example_data/layout-parser-paper.pdf', 'page': 1, 'total_pages': 16, 'Author': '', 'CreationDate': 'D:20210622012710Z', 'Creator': 'LaTeX with hyperref', 'Keywords': '', 'ModDate': 'D:20210622012710Z', 'PTEX.Fullbanner': 'This is pdfTeX, Version ... | https://python.langchain.com/en/latest/modules/indexes/document_loaders/examples/pdf.html |
520116e8cff2-45 | previous
Pandas DataFrame
next
Sitemap
Contents
Using PyPDF
Using MathPix
Using Unstructured
Retain Elements
Fetching remote PDFs using Unstructured
Using PyPDFium2
Using PDFMiner
Using PDFMiner to generate HTML text
Using PyMuPDF
PyPDF Directory
Using pdfplumber
By Harrison Chase
© Copyright 2023, Harri... | https://python.langchain.com/en/latest/modules/indexes/document_loaders/examples/pdf.html |
653129c2ed4b-0 | .ipynb
.pdf
HTML
Contents
Loading HTML with BeautifulSoup4
HTML#
The HyperText Markup Language or HTML is the standard markup language for documents designed to be displayed in a web browser.
This covers how to load HTML documents into a document format that we can use downstream.
from langchain.document_loaders impo... | https://python.langchain.com/en/latest/modules/indexes/document_loaders/examples/html.html |
e51fb3b0364e-0 | .ipynb
.pdf
File Directory
Contents
Show a progress bar
Use multithreading
Change loader class
Auto detect file encodings with TextLoader
A. Default Behavior
B. Silent fail
C. Auto detect encodings
File Directory#
This covers how to use the DirectoryLoader to load all documents in a directory. Under the hood, by defa... | https://python.langchain.com/en/latest/modules/indexes/document_loaders/examples/file_directory.html |
e51fb3b0364e-1 | docs = loader.load()
len(docs)
1
If you need to load Python source code files, use the PythonLoader.
from langchain.document_loaders import PythonLoader
loader = DirectoryLoader('../../../../../', glob="**/*.py", loader_cls=PythonLoader)
docs = loader.load()
len(docs)
691
Auto detect file encodings with TextLoader#
In ... | https://python.langchain.com/en/latest/modules/indexes/document_loaders/examples/file_directory.html |
e51fb3b0364e-2 | │ │
│ 319 │ def decode(self, input, final=False): │
│ 320 │ │ # decode input (taking the buffer into account) │
│ 321 │ │ ... | https://python.langchain.com/en/latest/modules/indexes/document_loaders/examples/file_directory.html |
e51fb3b0364e-3 | │ 85 │ │ │ │ │ finally: │
│ 86 │ │ │ │ │ │ if pbar: │
│ 87 │ │ │ │ │ │ │ pbar.update(1) │
│ ... | https://python.langchain.com/en/latest/modules/indexes/document_loaders/examples/file_directory.html |
e51fb3b0364e-4 | │ 45 │ │ │ except Exception as e: │
│ 46 │ │ │ │ raise RuntimeError(f"Error loading {self.file_path}") from e │
│ 47 │
╰────────────────... | https://python.langchain.com/en/latest/modules/indexes/document_loaders/examples/file_directory.html |
e51fb3b0364e-5 | '../../../../../tests/integration_tests/examples/whatsapp_chat.txt',
'../../../../../tests/integration_tests/examples/example-utf8.txt']
previous
Facebook Chat
next
HTML
Contents
Show a progress bar
Use multithreading
Change loader class
Auto detect file encodings with TextLoader
A. Default Behavior
B. Silent fail... | https://python.langchain.com/en/latest/modules/indexes/document_loaders/examples/file_directory.html |
4a6c84483d36-0 | .ipynb
.pdf
Apify Dataset
Contents
Prerequisites
An example with question answering
Apify Dataset#
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 Google SERPs, and then export them to various formats like JSON, C... | https://python.langchain.com/en/latest/modules/indexes/document_loaders/examples/apify_dataset.html |
4a6c84483d36-1 | In this example, we use data from a dataset to answer a question.
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=l... | https://python.langchain.com/en/latest/modules/indexes/document_loaders/examples/apify_dataset.html |
1b84f1792c19-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 |
c98c00ccdf08-0 | .ipynb
.pdf
Diffbot
Diffbot#
Unlike traditional web scraping tools, Diffbot doesn’t require any rules to read the content on a page.
It starts with computer vision, which classifies a page into one of 20 possible types. Content is then interpreted by a machine learning model trained to identify the key attributes on a ... | https://python.langchain.com/en/latest/modules/indexes/document_loaders/examples/diffbot.html |
c98c00ccdf08-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 |
c98c00ccdf08-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 |
c98c00ccdf08-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 |
c98c00ccdf08-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 |
c98c00ccdf08-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 |
c98c00ccdf08-6 | previous
Confluence
next
Discord
By Harrison Chase
© Copyright 2023, Harrison Chase.
Last updated on May 28, 2023. | https://python.langchain.com/en/latest/modules/indexes/document_loaders/examples/diffbot.html |
35782919206e-0 | .ipynb
.pdf
Open Document Format (ODT)
Open Document Format (ODT)#
The Open Document Format for Office Applications (ODF), also known as OpenDocument, is an open file format for word processing documents, spreadsheets, presentations and graphics and using ZIP-compressed XML files. It was developed with the aim of provi... | https://python.langchain.com/en/latest/modules/indexes/document_loaders/examples/odt.html |
73e37599e647-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 |
73e37599e647-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 |
73e37599e647-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 |
73e37599e647-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 |
73e37599e647-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 |
73e37599e647-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 May 28, 2023. | https://python.langchain.com/en/latest/modules/indexes/document_loaders/examples/gitbook.html |
5d83a92f590a-0 | .ipynb
.pdf
MediaWikiDump
MediaWikiDump#
MediaWiki XML Dumps contain the content of a wiki (wiki pages with all their revisions), without the site-related data. A XML dump does not create a full backup of the wiki database, the dump does not contain user accounts, images, edit logs, etc.
This covers how to load a Media... | https://python.langchain.com/en/latest/modules/indexes/document_loaders/examples/mediawikidump.html |
5d83a92f590a-1 | Document(page_content='{| class="article-table plainlinks" style="width:100%;"\n|- style="font-size:18px;"\n! style="padding:0px;" | Template documentation\n|-\n| Note: portions of the template sample may not be visible without values provided.\n|-\n| View or edit this documentation. (About template documentation)\n|-\... | https://python.langchain.com/en/latest/modules/indexes/document_loaders/examples/mediawikidump.html |
5d83a92f590a-2 | Document(page_content='Description\nThis template is used to insert descriptions on template pages.\n\nSyntax\nAdd <noinclude></noinclude> at the end of the template page.\n\nAdd <noinclude></noinclude> to transclude an alternative page from the /doc subpage.\n\nUsage\n\nOn the Template page\nThis is the normal format ... | https://python.langchain.com/en/latest/modules/indexes/document_loaders/examples/mediawikidump.html |
5d83a92f590a-3 | template is used to do something.\n\n==Syntax==\nType <code>{{t|templatename}}</code> somewhere.\n\n==Samples==\n<code><nowiki>{{templatename|input}}</nowiki></code> \n\nresults in...\n\n{{templatename|input}}\n\n<includeonly>Any categories for the template itself</includeonly>\n<noinclude>[[Category:Template documenta... | https://python.langchain.com/en/latest/modules/indexes/document_loaders/examples/mediawikidump.html |
5d83a92f590a-4 | Document(page_content='Description\nA template link with a variable number of parameters (0-20).\n\nSyntax\n \n\nSource\nImproved version not needing t/piece subtemplate developed on Templates wiki see the list of authors. Copied here via CC-By-SA 3.0 license.\n\nExample\n\nCategory:General wiki templates\nCategory:Tem... | https://python.langchain.com/en/latest/modules/indexes/document_loaders/examples/mediawikidump.html |
fa9966fe664b-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 |
3abb8f664c95-0 | .ipynb
.pdf
Iugu
Iugu#
Iugu is a Brazilian services and software as a service (SaaS) company. It offers payment-processing software and application programming interfaces for e-commerce websites and mobile applications.
This notebook covers how to load data from the Iugu REST API into a format that can be ingested into... | https://python.langchain.com/en/latest/modules/indexes/document_loaders/examples/iugu.html |
1f013e9740be-0 | .ipynb
.pdf
ChatGPT Data
ChatGPT Data#
ChatGPT is an artificial intelligence (AI) chatbot developed by OpenAI.
This notebook covers how to load conversations.json from your ChatGPT data export folder.
You can get your data export by email by going to: https://chat.openai.com/ -> (Profile) - Settings -> Export data -> C... | https://python.langchain.com/en/latest/modules/indexes/document_loaders/examples/chatgpt_loader.html |
f8fe90f9eb1d-0 | .ipynb
.pdf
Google Drive
Contents
Prerequisites
🧑 Instructions for ingesting your Google Docs data
Google Drive#
Google Drive is a file storage and synchronization service developed by Google.
This notebook covers how to load documents from Google Drive. Currently, only Google Docs are supported.
Prerequisites#
Crea... | https://python.langchain.com/en/latest/modules/indexes/document_loaders/examples/google_drive.html |
f8fe90f9eb1d-1 | from langchain.document_loaders import GoogleDriveLoader
loader = GoogleDriveLoader(
folder_id="1yucgL9WGgWZdM1TOuKkeghlPizuzMYb5",
# Optional: configure whether to recursively fetch files from subfolders. Defaults to False.
recursive=False
)
docs = loader.load()
When you pass a folder_id by default all fil... | https://python.langchain.com/en/latest/modules/indexes/document_loaders/examples/google_drive.html |
ec2532110b86-0 | .ipynb
.pdf
Pandas DataFrame
Pandas DataFrame#
This notebook goes over how to load data from a pandas DataFrame.
#!pip install pandas
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.6... | https://python.langchain.com/en/latest/modules/indexes/document_loaders/examples/pandas_dataframe.html |
ec2532110b86-1 | Document(page_content='Orioles', metadata={' "Payroll (millions)"': 81.43, ' "Wins"': 93}),
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={' ... | https://python.langchain.com/en/latest/modules/indexes/document_loaders/examples/pandas_dataframe.html |
ec2532110b86-2 | Document(page_content='Mariners', metadata={' "Payroll (millions)"': 81.97, ' "Wins"': 75}),
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=... | https://python.langchain.com/en/latest/modules/indexes/document_loaders/examples/pandas_dataframe.html |
ad32445f3814-0 | .ipynb
.pdf
Git
Contents
Load existing repository from disk
Clone repository from url
Filtering files to load
Git#
Git is a distributed version control system that tracks changes in any set of computer files, usually used for coordinating work among programmers collaboratively developing source code during software d... | https://python.langchain.com/en/latest/modules/indexes/document_loaders/examples/git.html |
ad32445f3814-1 | By Harrison Chase
© Copyright 2023, Harrison Chase.
Last updated on May 28, 2023. | https://python.langchain.com/en/latest/modules/indexes/document_loaders/examples/git.html |
50991973afdb-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 |
50991973afdb-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 |
50991973afdb-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 |
50991973afdb-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 |
50991973afdb-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 |
50991973afdb-5 | pretension...and feeble who-cares simulated sex scenes with saggy, pale actors.<br /><br />Cultural icon, holy grail, historic artifact..whatever this thing was, shred it, burn it, then stuff the ashes in a lead box!<br /><br />Elite esthetes still scrape to find value in its boring pseudo revolutionary political spewi... | https://python.langchain.com/en/latest/modules/indexes/document_loaders/examples/hugging_face_dataset.html |
50991973afdb-6 | 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 |
50991973afdb-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... | 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.