id stringlengths 14 17 | text stringlengths 42 2.11k |
|---|---|
4e9727215e95-1000 | You?\nOkay then f f f f.This is a weird text to write, but gotta test the splittingggg some how.\n\nBye!\n\n-H.`;const splitter = new RecursiveCharacterTextSplitter({ chunkSize: 10, chunkOverlap: 1,});const output = await splitter.createDocuments([text]);You'll note that in the above example we are splitting a raw te... |
4e9727215e95-1001 | has a number of built-in document transformers that make it easy to split, combine, filter, and otherwise manipulate documents.Text splittersWhen you want to deal with long pieces of text, it is necessary to split up that text into chunks.
As simple as this sounds, there is a lot of potential complexity here. Ideally... |
4e9727215e95-1002 | This notebook showcases several ways to do that.At a high level, text splitters work as following:Split the text up into small, semantically meaningful chunks (often sentences).Start combining these small chunks into a larger chunk until you reach a certain size (as measured by some function).Once you reach that size, ... |
4e9727215e95-1003 | You?\nOkay then f f f f.This is a weird text to write, but gotta test the splittingggg some how.\n\nBye!\n\n-H.`;const splitter = new RecursiveCharacterTextSplitter({ chunkSize: 10, chunkOverlap: 1,});const output = await splitter.createDocuments([text]);You'll note that in the above example we are splitting a raw te... |
4e9727215e95-1004 | has a number of built-in document transformers that make it easy to split, combine, filter, and otherwise manipulate documents.Text splittersWhen you want to deal with long pieces of text, it is necessary to split up that text into chunks.
As simple as this sounds, there is a lot of potential complexity here. Ideally... |
4e9727215e95-1005 | This notebook showcases several ways to do that.At a high level, text splitters work as following:Split the text up into small, semantically meaningful chunks (often sentences).Start combining these small chunks into a larger chunk until you reach a certain size (as measured by some function).Once you reach that size, ... |
4e9727215e95-1006 | You?\nOkay then f f f f.This is a weird text to write, but gotta test the splittingggg some how.\n\nBye!\n\n-H.`;const splitter = new RecursiveCharacterTextSplitter({ chunkSize: 10, chunkOverlap: 1,});const output = await splitter.createDocuments([text]);You'll note that in the above example we are splitting a raw te... |
4e9727215e95-1007 | This notebook showcases several ways to do that.At a high level, text splitters work as following:Split the text up into small, semantically meaningful chunks (often sentences).Start combining these small chunks into a larger chunk until you reach a certain size (as measured by some function).Once you reach that size, ... |
4e9727215e95-1008 | You?\nOkay then f f f f.This is a weird text to write, but gotta test the splittingggg some how.\n\nBye!\n\n-H.`;const splitter = new RecursiveCharacterTextSplitter({ chunkSize: 10, chunkOverlap: 1,});const output = await splitter.createDocuments([text]);You'll note that in the above example we are splitting a raw te... |
4e9727215e95-1009 | This notebook showcases several ways to do that.At a high level, text splitters work as following:Split the text up into small, semantically meaningful chunks (often sentences).Start combining these small chunks into a larger chunk until you reach a certain size (as measured by some function).Once you reach that size, ... |
4e9727215e95-1010 | You?\nOkay then f f f f.This is a weird text to write, but gotta test the splittingggg some how.\n\nBye!\n\n-H.`;const splitter = new RecursiveCharacterTextSplitter({ chunkSize: 10, chunkOverlap: 1,});const output = await splitter.createDocuments([text]);You'll note that in the above example we are splitting a raw te... |
4e9727215e95-1011 | At a high level, text splitters work as following:
That means there are two different axes along which you can customize your text splitter:
The recommended TextSplitter is the RecursiveCharacterTextSplitter. This will split documents recursively by different characters - starting with "\n\n", then "\n", then " ". Th... |
4e9727215e95-1012 | import { Document } from "langchain/document";import { RecursiveCharacterTextSplitter } from "langchain/text_splitter";const text = `Hi.\n\nI'm Harrison.\n\nHow? Are? You?\nOkay then f f f f.This is a weird text to write, but gotta test the splittingggg some how.\n\nBye!\n\n-H.`;const splitter = new RecursiveCharacterT... |
4e9727215e95-1013 | Stripping HTML tags from documents with the HtmlToTextTransformer can result in more content-rich chunks, making retrieval more effective.SetupYou'll need to install the html-to-text npm package:npmYarnpnpmnpm install html-to-textyarn add html-to-textpnpm add html-to-textThough not required for the transformer by itse... |
4e9727215e95-1014 | (quantamagazine.org) 75 points by Amorymeltzer\n' + '5 months ago | hide | past | favorite | 6 comments delta_p_delta_x 5 months ago\n' + '| next [–] Astrophysical and cosmological simulations are often insightful.\n' + "They're also very cross-disciplinary; besides the obvious astrophysics, there'... |
4e9727215e95-1015 | froeb 5 months ago | parent | next [–]\n' + 'Supernova simulations are especially interesting too. I have heard them\n' + 'described as the only time in physics when all 4 of the fundamental forces are\n' + 'important. The explosion can be quite finicky too. If I remember right, you\n' + "ca... |
4e9727215e95-1016 | I didn't know the accretion theory of Ia\n" + 'supernovae was dead, much less that it had been since 2011. andreareina 5 months\n' + 'ago | prev | next [–] This seems to be the paper', metadata: { source: 'https://news.ycombinator.com/item?id=34817881', loc: [Object] } }, Doc... |
4e9727215e95-1017 | If one type Ia\n' + 'supernova goes 1,2,3,2,1, the sum of two could go 1+0=1 2+1=3 3+2=5 2+3=5 1+2=3\n' + '0+1=1 Guidelines | FAQ | Lists |', metadata: { source: 'https://news.ycombinator.com/item?id=34817881', loc: [Object] } }, Document { pageContent: 'the sum of two c... |
4e9727215e95-1018 | Get startedIntroductionInstallationQuickstartModulesModel I/OData connectionDocument loadersDocument transformersIntegrationshtml-to-text@mozilla/readabilityOpenAI functions metadata taggerText splittersText embedding modelsVector storesRetrieversExperimentalCaching embeddingsChainsMemoryAgentsCallbacksModulesGuidesEc... |
4e9727215e95-1019 | then extracts content from the individual chunks:import { CheerioWebBaseLoader } from "langchain/document_loaders/web/cheerio";import { RecursiveCharacterTextSplitter } from "langchain/text_splitter";import { HtmlToTextTransformer } from "langchain/document_transformers/html_to_text";const loader = new CheerioWebBaseLo... |
4e9727215e95-1020 | (quantamagazine.org) 75 points by Amorymeltzer\n' + '5 months ago | hide | past | favorite | 6 comments delta_p_delta_x 5 months ago\n' + '| next [–] Astrophysical and cosmological simulations are often insightful.\n' + "They're also very cross-disciplinary; besides the obvious astrophysics, there'... |
4e9727215e95-1021 | froeb 5 months ago | parent | next [–]\n' + 'Supernova simulations are especially interesting too. I have heard them\n' + 'described as the only time in physics when all 4 of the fundamental forces are\n' + 'important. The explosion can be quite finicky too. If I remember right, you\n' + "ca... |
4e9727215e95-1022 | I didn't know the accretion theory of Ia\n" + 'supernovae was dead, much less that it had been since 2011. andreareina 5 months\n' + 'ago | prev | next [–] This seems to be the paper', metadata: { source: 'https://news.ycombinator.com/item?id=34817881', loc: [Object] } }, Doc... |
4e9727215e95-1023 | If one type Ia\n' + 'supernova goes 1,2,3,2,1, the sum of two could go 1+0=1 2+1=3 3+2=5 2+3=5 1+2=3\n' + '0+1=1 Guidelines | FAQ | Lists |', metadata: { source: 'https://news.ycombinator.com/item?id=34817881', loc: [Object] } }, Document { pageContent: 'the sum of two c... |
4e9727215e95-1024 | ModulesData connectionDocument transformersIntegrationshtml-to-textOn this pagehtml-to-textWhen ingesting HTML documents for later retrieval, we are often interested only in the actual content of the webpage rather than semantics.
Stripping HTML tags from documents with the HtmlToTextTransformer can result in more con... |
4e9727215e95-1025 | (quantamagazine.org) 75 points by Amorymeltzer\n' + '5 months ago | hide | past | favorite | 6 comments delta_p_delta_x 5 months ago\n' + '| next [–] Astrophysical and cosmological simulations are often insightful.\n' + "They're also very cross-disciplinary; besides the obvious astrophysics, there'... |
4e9727215e95-1026 | froeb 5 months ago | parent | next [–]\n' + 'Supernova simulations are especially interesting too. I have heard them\n' + 'described as the only time in physics when all 4 of the fundamental forces are\n' + 'important. The explosion can be quite finicky too. If I remember right, you\n' + "ca... |
4e9727215e95-1027 | I didn't know the accretion theory of Ia\n" + 'supernovae was dead, much less that it had been since 2011. andreareina 5 months\n' + 'ago | prev | next [–] This seems to be the paper', metadata: { source: 'https://news.ycombinator.com/item?id=34817881', loc: [Object] } }, Doc... |
4e9727215e95-1028 | If one type Ia\n' + 'supernova goes 1,2,3,2,1, the sum of two could go 1+0=1 2+1=3 3+2=5 2+3=5 1+2=3\n' + '0+1=1 Guidelines | FAQ | Lists |', metadata: { source: 'https://news.ycombinator.com/item?id=34817881', loc: [Object] } }, Document { pageContent: 'the sum of two c... |
4e9727215e95-1029 | Stripping HTML tags from documents with the HtmlToTextTransformer can result in more content-rich chunks, making retrieval more effective.SetupYou'll need to install the html-to-text npm package:npmYarnpnpmnpm install html-to-textyarn add html-to-textpnpm add html-to-textThough not required for the transformer by itse... |
4e9727215e95-1030 | (quantamagazine.org) 75 points by Amorymeltzer\n' + '5 months ago | hide | past | favorite | 6 comments delta_p_delta_x 5 months ago\n' + '| next [–] Astrophysical and cosmological simulations are often insightful.\n' + "They're also very cross-disciplinary; besides the obvious astrophysics, there'... |
4e9727215e95-1031 | froeb 5 months ago | parent | next [–]\n' + 'Supernova simulations are especially interesting too. I have heard them\n' + 'described as the only time in physics when all 4 of the fundamental forces are\n' + 'important. The explosion can be quite finicky too. If I remember right, you\n' + "ca... |
4e9727215e95-1032 | I didn't know the accretion theory of Ia\n" + 'supernovae was dead, much less that it had been since 2011. andreareina 5 months\n' + 'ago | prev | next [–] This seems to be the paper', metadata: { source: 'https://news.ycombinator.com/item?id=34817881', loc: [Object] } }, Doc... |
4e9727215e95-1033 | If one type Ia\n' + 'supernova goes 1,2,3,2,1, the sum of two could go 1+0=1 2+1=3 3+2=5 2+3=5 1+2=3\n' + '0+1=1 Guidelines | FAQ | Lists |', metadata: { source: 'https://news.ycombinator.com/item?id=34817881', loc: [Object] } }, Document { pageContent: 'the sum of two c... |
4e9727215e95-1034 | Stripping HTML tags from documents with the HtmlToTextTransformer can result in more content-rich chunks, making retrieval more effective.SetupYou'll need to install the html-to-text npm package:npmYarnpnpmnpm install html-to-textyarn add html-to-textpnpm add html-to-textThough not required for the transformer by itse... |
4e9727215e95-1035 | (quantamagazine.org) 75 points by Amorymeltzer\n' + '5 months ago | hide | past | favorite | 6 comments delta_p_delta_x 5 months ago\n' + '| next [–] Astrophysical and cosmological simulations are often insightful.\n' + "They're also very cross-disciplinary; besides the obvious astrophysics, there'... |
4e9727215e95-1036 | froeb 5 months ago | parent | next [–]\n' + 'Supernova simulations are especially interesting too. I have heard them\n' + 'described as the only time in physics when all 4 of the fundamental forces are\n' + 'important. The explosion can be quite finicky too. If I remember right, you\n' + "ca... |
4e9727215e95-1037 | I didn't know the accretion theory of Ia\n" + 'supernovae was dead, much less that it had been since 2011. andreareina 5 months\n' + 'ago | prev | next [–] This seems to be the paper', metadata: { source: 'https://news.ycombinator.com/item?id=34817881', loc: [Object] } }, Doc... |
4e9727215e95-1038 | If one type Ia\n' + 'supernova goes 1,2,3,2,1, the sum of two could go 1+0=1 2+1=3 3+2=5 2+3=5 1+2=3\n' + '0+1=1 Guidelines | FAQ | Lists |', metadata: { source: 'https://news.ycombinator.com/item?id=34817881', loc: [Object] } }, Document { pageContent: 'the sum of two c... |
4e9727215e95-1039 | Though not required for the transformer by itself, the below usage examples require cheerio for scraping:
The below example scrapes a Hacker News thread, splits it based on HTML tags to group chunks based on the semantic information from the tags,
then extracts content from the individual chunks:
import { CheerioWeb... |
4e9727215e95-1040 | (quantamagazine.org) 75 points by Amorymeltzer\n' + '5 months ago | hide | past | favorite | 6 comments delta_p_delta_x 5 months ago\n' + '| next [–] Astrophysical and cosmological simulations are often insightful.\n' + "They're also very cross-disciplinary; besides the obvious astrophysics, there'... |
4e9727215e95-1041 | froeb 5 months ago | parent | next [–]\n' + 'Supernova simulations are especially interesting too. I have heard them\n' + 'described as the only time in physics when all 4 of the fundamental forces are\n' + 'important. The explosion can be quite finicky too. If I remember right, you\n' + "ca... |
4e9727215e95-1042 | I didn't know the accretion theory of Ia\n" + 'supernovae was dead, much less that it had been since 2011. andreareina 5 months\n' + 'ago | prev | next [–] This seems to be the paper', metadata: { source: 'https://news.ycombinator.com/item?id=34817881', loc: [Object] } }, Doc... |
4e9727215e95-1043 | loc: [Object] } }, Document { pageContent: 'the sum of two could go 1+0=1 2+1=3 3+2=5 2+3=5 1+2=3 0+1=1 Guidelines | FAQ |\n' + 'Lists | API | Security | Legal | Apply to YC | Contact Search:', metadata: { source: 'https://news.ycombinator.com/item?id=34817881', loc: [Object] ... |
4e9727215e95-1044 | API Reference:CheerioWebBaseLoader from langchain/document_loaders/web/cheerioRecursiveCharacterTextSplitter from langchain/text_splitterHtmlToTextTransformer from langchain/document_transformers/html_to_text
You can pass the transformer any arguments accepted by the html-to-text package to customize how it works.
@m... |
4e9727215e95-1045 | then extracts content from the individual chunks:import { CheerioWebBaseLoader } from "langchain/document_loaders/web/cheerio";import { MozillaReadabilityTransformer } from "langchain/document_transformers/mozilla_readability";import { RecursiveCharacterTextSplitter } from "langchain/text_splitter";const loader = new C... |
4e9727215e95-1046 | (quantamagazine.org) 75 points by Amorymeltzer\n' + '5 months ago | hide | past | favorite | 6 comments delta_p_delta_x 5 months ago\n' + '| next [–] Astrophysical and cosmological simulations are often insightful.\n' + "They're also very cross-disciplinary; besides the obvious astrophysics, there'... |
4e9727215e95-1047 | froeb 5 months ago | parent | next [–]\n' + 'Supernova simulations are especially interesting too. I have heard them\n' + 'described as the only time in physics when all 4 of the fundamental forces are\n' + 'important. The explosion can be quite finicky too. If I remember right, you\n' + "ca... |
4e9727215e95-1048 | I didn't know the accretion theory of Ia\n" + 'supernovae was dead, much less that it had been since 2011. andreareina 5 months\n' + 'ago | prev | next [–] This seems to be the paper', metadata: { source: 'https://news.ycombinator.com/item?id=34817881', loc: [Object] } }, Doc... |
4e9727215e95-1049 | If one type Ia\n' + 'supernova goes 1,2,3,2,1, the sum of two could go 1+0=1 2+1=3 3+2=5 2+3=5 1+2=3\n' + '0+1=1 Guidelines | FAQ | Lists |', metadata: { source: 'https://news.ycombinator.com/item?id=34817881', loc: [Object] } }, Document { pageContent: 'the sum of two c... |
4e9727215e95-1050 | Get startedIntroductionInstallationQuickstartModulesModel I/OData connectionDocument loadersDocument transformersIntegrationshtml-to-text@mozilla/readabilityOpenAI functions metadata taggerText splittersText embedding modelsVector storesRetrieversExperimentalCaching embeddingsChainsMemoryAgentsCallbacksModulesGuidesEc... |
4e9727215e95-1051 | then extracts content from the individual chunks:import { CheerioWebBaseLoader } from "langchain/document_loaders/web/cheerio";import { MozillaReadabilityTransformer } from "langchain/document_transformers/mozilla_readability";import { RecursiveCharacterTextSplitter } from "langchain/text_splitter";const loader = new C... |
4e9727215e95-1052 | (quantamagazine.org) 75 points by Amorymeltzer\n' + '5 months ago | hide | past | favorite | 6 comments delta_p_delta_x 5 months ago\n' + '| next [–] Astrophysical and cosmological simulations are often insightful.\n' + "They're also very cross-disciplinary; besides the obvious astrophysics, there'... |
4e9727215e95-1053 | froeb 5 months ago | parent | next [–]\n' + 'Supernova simulations are especially interesting too. I have heard them\n' + 'described as the only time in physics when all 4 of the fundamental forces are\n' + 'important. The explosion can be quite finicky too. If I remember right, you\n' + "ca... |
4e9727215e95-1054 | I didn't know the accretion theory of Ia\n" + 'supernovae was dead, much less that it had been since 2011. andreareina 5 months\n' + 'ago | prev | next [–] This seems to be the paper', metadata: { source: 'https://news.ycombinator.com/item?id=34817881', loc: [Object] } }, Doc... |
4e9727215e95-1055 | If one type Ia\n' + 'supernova goes 1,2,3,2,1, the sum of two could go 1+0=1 2+1=3 3+2=5 2+3=5 1+2=3\n' + '0+1=1 Guidelines | FAQ | Lists |', metadata: { source: 'https://news.ycombinator.com/item?id=34817881', loc: [Object] } }, Document { pageContent: 'the sum of two c... |
4e9727215e95-1056 | Stripping HTML tags from documents with the MozillaReadabilityTransformer can result in more content-rich chunks, making retrieval more effective.SetupYou'll need to install the @mozilla/readability and the jsdom npm package:npmYarnpnpmnpm install @mozilla/readability jsdomyarn add @mozilla/readability jsdompnpm add @... |
4e9727215e95-1057 | (quantamagazine.org) 75 points by Amorymeltzer\n' + '5 months ago | hide | past | favorite | 6 comments delta_p_delta_x 5 months ago\n' + '| next [–] Astrophysical and cosmological simulations are often insightful.\n' + "They're also very cross-disciplinary; besides the obvious astrophysics, there'... |
4e9727215e95-1058 | froeb 5 months ago | parent | next [–]\n' + 'Supernova simulations are especially interesting too. I have heard them\n' + 'described as the only time in physics when all 4 of the fundamental forces are\n' + 'important. The explosion can be quite finicky too. If I remember right, you\n' + "ca... |
4e9727215e95-1059 | I didn't know the accretion theory of Ia\n" + 'supernovae was dead, much less that it had been since 2011. andreareina 5 months\n' + 'ago | prev | next [–] This seems to be the paper', metadata: { source: 'https://news.ycombinator.com/item?id=34817881', loc: [Object] } }, Doc... |
4e9727215e95-1060 | If one type Ia\n' + 'supernova goes 1,2,3,2,1, the sum of two could go 1+0=1 2+1=3 3+2=5 2+3=5 1+2=3\n' + '0+1=1 Guidelines | FAQ | Lists |', metadata: { source: 'https://news.ycombinator.com/item?id=34817881', loc: [Object] } }, Document { pageContent: 'the sum of two c... |
4e9727215e95-1061 | Stripping HTML tags from documents with the MozillaReadabilityTransformer can result in more content-rich chunks, making retrieval more effective.SetupYou'll need to install the @mozilla/readability and the jsdom npm package:npmYarnpnpmnpm install @mozilla/readability jsdomyarn add @mozilla/readability jsdompnpm add @... |
4e9727215e95-1062 | (quantamagazine.org) 75 points by Amorymeltzer\n' + '5 months ago | hide | past | favorite | 6 comments delta_p_delta_x 5 months ago\n' + '| next [–] Astrophysical and cosmological simulations are often insightful.\n' + "They're also very cross-disciplinary; besides the obvious astrophysics, there'... |
4e9727215e95-1063 | froeb 5 months ago | parent | next [–]\n' + 'Supernova simulations are especially interesting too. I have heard them\n' + 'described as the only time in physics when all 4 of the fundamental forces are\n' + 'important. The explosion can be quite finicky too. If I remember right, you\n' + "ca... |
4e9727215e95-1064 | I didn't know the accretion theory of Ia\n" + 'supernovae was dead, much less that it had been since 2011. andreareina 5 months\n' + 'ago | prev | next [–] This seems to be the paper', metadata: { source: 'https://news.ycombinator.com/item?id=34817881', loc: [Object] } }, Doc... |
4e9727215e95-1065 | If one type Ia\n' + 'supernova goes 1,2,3,2,1, the sum of two could go 1+0=1 2+1=3 3+2=5 2+3=5 1+2=3\n' + '0+1=1 Guidelines | FAQ | Lists |', metadata: { source: 'https://news.ycombinator.com/item?id=34817881', loc: [Object] } }, Document { pageContent: 'the sum of two c... |
4e9727215e95-1066 | Stripping HTML tags from documents with the MozillaReadabilityTransformer can result in more content-rich chunks, making retrieval more effective.SetupYou'll need to install the @mozilla/readability and the jsdom npm package:npmYarnpnpmnpm install @mozilla/readability jsdomyarn add @mozilla/readability jsdompnpm add @... |
4e9727215e95-1067 | (quantamagazine.org) 75 points by Amorymeltzer\n' + '5 months ago | hide | past | favorite | 6 comments delta_p_delta_x 5 months ago\n' + '| next [–] Astrophysical and cosmological simulations are often insightful.\n' + "They're also very cross-disciplinary; besides the obvious astrophysics, there'... |
4e9727215e95-1068 | froeb 5 months ago | parent | next [–]\n' + 'Supernova simulations are especially interesting too. I have heard them\n' + 'described as the only time in physics when all 4 of the fundamental forces are\n' + 'important. The explosion can be quite finicky too. If I remember right, you\n' + "ca... |
4e9727215e95-1069 | I didn't know the accretion theory of Ia\n" + 'supernovae was dead, much less that it had been since 2011. andreareina 5 months\n' + 'ago | prev | next [–] This seems to be the paper', metadata: { source: 'https://news.ycombinator.com/item?id=34817881', loc: [Object] } }, Doc... |
4e9727215e95-1070 | If one type Ia\n' + 'supernova goes 1,2,3,2,1, the sum of two could go 1+0=1 2+1=3 3+2=5 2+3=5 1+2=3\n' + '0+1=1 Guidelines | FAQ | Lists |', metadata: { source: 'https://news.ycombinator.com/item?id=34817881', loc: [Object] } }, Document { pageContent: 'the sum of two c... |
4e9727215e95-1071 | npm install @mozilla/readability jsdomyarn add @mozilla/readability jsdompnpm add @mozilla/readability jsdom
npm install @mozilla/readability jsdom
yarn add @mozilla/readability jsdom
pnpm add @mozilla/readability jsdom
import { CheerioWebBaseLoader } from "langchain/document_loaders/web/cheerio";import { MozillaRe... |
4e9727215e95-1072 | (quantamagazine.org) 75 points by Amorymeltzer\n' + '5 months ago | hide | past | favorite | 6 comments delta_p_delta_x 5 months ago\n' + '| next [–] Astrophysical and cosmological simulations are often insightful.\n' + "They're also very cross-disciplinary; besides the obvious astrophysics, there'... |
4e9727215e95-1073 | froeb 5 months ago | parent | next [–]\n' + 'Supernova simulations are especially interesting too. I have heard them\n' + 'described as the only time in physics when all 4 of the fundamental forces are\n' + 'important. The explosion can be quite finicky too. If I remember right, you\n' + "ca... |
4e9727215e95-1074 | I didn't know the accretion theory of Ia\n" + 'supernovae was dead, much less that it had been since 2011. andreareina 5 months\n' + 'ago | prev | next [–] This seems to be the paper', metadata: { source: 'https://news.ycombinator.com/item?id=34817881', loc: [Object] } }, Doc... |
4e9727215e95-1075 | loc: [Object] } }, Document { pageContent: 'the sum of two could go 1+0=1 2+1=3 3+2=5 2+3=5 1+2=3 0+1=1 Guidelines | FAQ |\n' + 'Lists | API | Security | Legal | Apply to YC | Contact Search:', metadata: { source: 'https://news.ycombinator.com/item?id=34817881', loc: [Object] ... |
4e9727215e95-1076 | API Reference:CheerioWebBaseLoader from langchain/document_loaders/web/cheerioMozillaReadabilityTransformer from langchain/document_transformers/mozilla_readabilityRecursiveCharacterTextSplitter from langchain/text_splitter
You can pass the transformer any arguments accepted by the @mozilla/readability package to cust... |
4e9727215e95-1077 | You could initialize the document transformer as follows:import { z } from "zod";import { createMetadataTaggerFromZod } from "langchain/document_transformers/openai_functions";import { ChatOpenAI } from "langchain/chat_models/openai";import { Document } from "langchain/document";const zodSchema = z.object({ movie_titl... |
4e9727215e95-1078 | 1 out of 5 stars. ', metadata: { movie_title: 'The Godfather', critic: 'Anonymous', tone: 'negative', rating: 1, reliable: false } } ]*/API Reference:createMetadataTaggerFromZod from langchain/document_transformers/openai_functionsChatOpenAI from langchain/chat_models/op... |
4e9727215e95-1079 | For example, if you wanted to ask the LLM to focus specific details in the input documents, or extract metadata in a certain style, you could pass in a custom prompt:import { z } from "zod";import { createMetadataTaggerFromZod } from "langchain/document_transformers/openai_functions";import { ChatOpenAI } from "langcha... |
4e9727215e95-1080 | ", metadata: { reliable: false }, }),];const taggedDocuments = await metadataTagger.transformDocuments(documents);console.log(taggedDocuments);/* [ Document { pageContent: 'Review of The Bee Movie\n' + 'By Roger Ebert\n' + 'This is the greatest movie ever made. 4 out of 5 stars. ', metad... |
4e9727215e95-1081 | Get startedIntroductionInstallationQuickstartModulesModel I/OData connectionDocument loadersDocument transformersIntegrationshtml-to-text@mozilla/readabilityOpenAI functions metadata taggerText splittersText embedding modelsVector storesRetrieversExperimentalCaching embeddingsChainsMemoryAgentsCallbacksModulesGuidesEc... |
4e9727215e95-1082 | You could initialize the document transformer as follows:import { z } from "zod";import { createMetadataTaggerFromZod } from "langchain/document_transformers/openai_functions";import { ChatOpenAI } from "langchain/chat_models/openai";import { Document } from "langchain/document";const zodSchema = z.object({ movie_titl... |
4e9727215e95-1083 | 1 out of 5 stars. ', metadata: { movie_title: 'The Godfather', critic: 'Anonymous', tone: 'negative', rating: 1, reliable: false } } ]*/API Reference:createMetadataTaggerFromZod from langchain/document_transformers/openai_functionsChatOpenAI from langchain/chat_models/op... |
4e9727215e95-1084 | For example, if you wanted to ask the LLM to focus specific details in the input documents, or extract metadata in a certain style, you could pass in a custom prompt:import { z } from "zod";import { createMetadataTaggerFromZod } from "langchain/document_transformers/openai_functions";import { ChatOpenAI } from "langcha... |
4e9727215e95-1085 | ", metadata: { reliable: false }, }),];const taggedDocuments = await metadataTagger.transformDocuments(documents);console.log(taggedDocuments);/* [ Document { pageContent: 'Review of The Bee Movie\n' + 'By Roger Ebert\n' + 'This is the greatest movie ever made. 4 out of 5 stars. ', metad... |
4e9727215e95-1086 | ModulesData connectionDocument transformersIntegrationsOpenAI functions metadata taggerOn this pageOpenAI functions metadata taggerIt can often be useful to tag ingested documents with structured metadata, such as the title, tone, or length of a document, to allow for more targeted similarity search later. However, for... |
4e9727215e95-1087 | You could initialize the document transformer as follows:import { z } from "zod";import { createMetadataTaggerFromZod } from "langchain/document_transformers/openai_functions";import { ChatOpenAI } from "langchain/chat_models/openai";import { Document } from "langchain/document";const zodSchema = z.object({ movie_titl... |
4e9727215e95-1088 | 1 out of 5 stars. ', metadata: { movie_title: 'The Godfather', critic: 'Anonymous', tone: 'negative', rating: 1, reliable: false } } ]*/API Reference:createMetadataTaggerFromZod from langchain/document_transformers/openai_functionsChatOpenAI from langchain/chat_models/op... |
4e9727215e95-1089 | For example, if you wanted to ask the LLM to focus specific details in the input documents, or extract metadata in a certain style, you could pass in a custom prompt:import { z } from "zod";import { createMetadataTaggerFromZod } from "langchain/document_transformers/openai_functions";import { ChatOpenAI } from "langcha... |
4e9727215e95-1090 | ", metadata: { reliable: false }, }),];const taggedDocuments = await metadataTagger.transformDocuments(documents);console.log(taggedDocuments);/* [ Document { pageContent: 'Review of The Bee Movie\n' + 'By Roger Ebert\n' + 'This is the greatest movie ever made. 4 out of 5 stars. ', metad... |
4e9727215e95-1091 | ModulesData connectionDocument transformersIntegrationsOpenAI functions metadata taggerOn this pageOpenAI functions metadata taggerIt can often be useful to tag ingested documents with structured metadata, such as the title, tone, or length of a document, to allow for more targeted similarity search later. However, for... |
4e9727215e95-1092 | You could initialize the document transformer as follows:import { z } from "zod";import { createMetadataTaggerFromZod } from "langchain/document_transformers/openai_functions";import { ChatOpenAI } from "langchain/chat_models/openai";import { Document } from "langchain/document";const zodSchema = z.object({ movie_titl... |
4e9727215e95-1093 | 1 out of 5 stars. ', metadata: { movie_title: 'The Godfather', critic: 'Anonymous', tone: 'negative', rating: 1, reliable: false } } ]*/API Reference:createMetadataTaggerFromZod from langchain/document_transformers/openai_functionsChatOpenAI from langchain/chat_models/op... |
4e9727215e95-1094 | For example, if you wanted to ask the LLM to focus specific details in the input documents, or extract metadata in a certain style, you could pass in a custom prompt:import { z } from "zod";import { createMetadataTaggerFromZod } from "langchain/document_transformers/openai_functions";import { ChatOpenAI } from "langcha... |
4e9727215e95-1095 | ", metadata: { reliable: false }, }),];const taggedDocuments = await metadataTagger.transformDocuments(documents);console.log(taggedDocuments);/* [ Document { pageContent: 'Review of The Bee Movie\n' + 'By Roger Ebert\n' + 'This is the greatest movie ever made. 4 out of 5 stars. ', metad... |
4e9727215e95-1096 | OpenAI functions metadata taggerIt can often be useful to tag ingested documents with structured metadata, such as the title, tone, or length of a document, to allow for more targeted similarity search later. However, for large numbers of documents, performing this labelling process manually can be tedious.The Metadata... |
4e9727215e95-1097 | You could initialize the document transformer as follows:import { z } from "zod";import { createMetadataTaggerFromZod } from "langchain/document_transformers/openai_functions";import { ChatOpenAI } from "langchain/chat_models/openai";import { Document } from "langchain/document";const zodSchema = z.object({ movie_titl... |
4e9727215e95-1098 | 1 out of 5 stars. ', metadata: { movie_title: 'The Godfather', critic: 'Anonymous', tone: 'negative', rating: 1, reliable: false } } ]*/API Reference:createMetadataTaggerFromZod from langchain/document_transformers/openai_functionsChatOpenAI from langchain/chat_models/op... |
4e9727215e95-1099 | For example, if you wanted to ask the LLM to focus specific details in the input documents, or extract metadata in a certain style, you could pass in a custom prompt:import { z } from "zod";import { createMetadataTaggerFromZod } from "langchain/document_transformers/openai_functions";import { ChatOpenAI } from "langcha... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.