You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
langchain/docs/modules/document_loaders/examples/online_pdf.ipynb

92 lines
16 KiB
Plaintext

{
"cells": [
{
"cell_type": "markdown",
"id": "8d9e1096",
"metadata": {},
"source": [
"# Online PDF\n",
"\n",
"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/"
]
},
{
"cell_type": "code",
"execution_count": 1,
"id": "3dde8f63",
"metadata": {},
"outputs": [],
"source": [
"from langchain.document_loaders import OnlinePDFLoader"
]
},
{
"cell_type": "code",
"execution_count": 2,
"id": "04e27651",
"metadata": {},
"outputs": [],
"source": [
"loader = OnlinePDFLoader(\"https://arxiv.org/pdf/2302.03803.pdf\")"
]
},
{
"cell_type": "code",
"execution_count": 3,
"id": "85690c73",
"metadata": {},
"outputs": [],
"source": [
"data = loader.load()"
]
},
{
"cell_type": "code",
"execution_count": 4,
"id": "2d48610e",
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"[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\\nFirstly we show a generalization of the ( 1 , 1 ) -Lefschetz theorem for projective toric orbifolds and secondly we prove that on 2 k -dimensional quasi-smooth hyper- surfaces coming from quasi-smooth intersection surfaces, under the Cayley trick, every rational ( k, k ) -cohomology class is algebraic, i.e., the Hodge conjecture holds\\n\\nIn [3] we proved that, under suitable conditions, on a very general codimension s quasi- smooth intersection subvariety X in a projective toric orbifold P d Σ with d + s = 2 ( k + 1 ) the Hodge conjecture holds, that is, every ( p, p ) -cohomology class, under the Poincar´e duality is a rational linear combination of fundamental classes of algebraic subvarieties of X . The proof of the above-mentioned result relies, for p ≠ d + 1 s , on a Lefschetz\\n\\nKeywords: (1,1)- Lefschetz theorem, Hodge conjecture, toric varieties, complete intersection Email: wmontoya@ime.unicamp.br\\n\\ntheorem ([7]) and the Hard Lefschetz 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, following the philosophy of Mavlyutov in [7], reduces results known for quasi-smooth hypersurfaces to quasi-smooth intersection subvarieties. The idea in this paper goes the other way around, we translate some results for quasi-smooth intersection subvarieties to quasi-smooth hypersurfaces, mainly the ( 1 , 1 ) -Lefschetz theorem.\\n\\nAcknowledgement. I thank Prof. Ugo Bruzzo and Tiago Fonseca for useful discus- sions. I also acknowledge support from FAPESP postdoctoral grant No. 2019/23499-7.\\n\\nPreliminaries and Notation\\n\\nLet M be a free abelian group of rank d , let N = Hom ( M, Z ) , and N R = 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 σ , σ one says that σ is a face of σ ( σ < σ ) if the set of integral generators of σ is a subset of the set of integral generators of σ . • A finite set Σ = { σ\\n\\n, . . . , σ t } of rational simplicial cones is called a rational simplicial complete d -dimensional fan if:\\n\\nall faces of cones in Σ are in Σ ;\\n\\nif σ, σ ∈ Σ then σσ < σ 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 -dimensional cones\\n\\nFor a cone σ ∈ Σ, ˆ σ is the set of 1-dimensional cone in Σ that are not contained in σ\\n\\nand x ˆ σ = ∏ ρˆ σ x ρ is the associated monomial in S .\\n\\nDefinition 2.2. The irrelevant ideal of P d Σ is the monomial ideal B Σ =< x ˆ σ σ ∈ Σ > and the zero 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 introduction to complex orbifolds and we mention the needed theorems for the next section. Namely: de Rham theorem and Dolbeault theorem for complex orbifolds.\\n\\nDefinition 2.4. A complex orbifold of complex dimension d is a sin
]
}
],
"source": [
"print(data)"
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "d3258869",
"metadata": {},
"outputs": [],
"source": []
}
],
"metadata": {
"kernelspec": {
"display_name": "Python 3 (ipykernel)",
"language": "python",
"name": "python3"
},
"language_info": {
"codemirror_mode": {
"name": "ipython",
"version": 3
},
"file_extension": ".py",
"mimetype": "text/x-python",
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.9.1"
}
},
"nbformat": 4,
"nbformat_minor": 5
}