This repository has been archived by the owner on Jun 8, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 34
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
41 changed files
with
2,398 additions
and
460 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -130,4 +130,9 @@ dist | |
.pnp.* | ||
|
||
.ideas.md | ||
.todos.md | ||
.todos.md | ||
|
||
# Custom | ||
dist | ||
types | ||
build |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
import { BaseChunker } from "./BaseChunker"; | ||
import { RecursiveCharacterTextSplitter } from "langchain/text_splitter"; | ||
|
||
interface TextSplitterChunkParams { | ||
chunkSize: number; | ||
chunkOverlap: number; | ||
keepSeparator: boolean; | ||
} | ||
|
||
const TEXT_SPLITTER_CHUNK_PARAMS: TextSplitterChunkParams = { | ||
chunkSize: 1000, | ||
chunkOverlap: 0, | ||
keepSeparator: false, | ||
}; | ||
|
||
class PdfFileChunker extends BaseChunker { | ||
constructor() { | ||
const text_splitter = new RecursiveCharacterTextSplitter( | ||
TEXT_SPLITTER_CHUNK_PARAMS | ||
); | ||
super(text_splitter); | ||
} | ||
} | ||
|
||
export { PdfFileChunker }; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
import { BaseChunker } from "./BaseChunker"; | ||
import { RecursiveCharacterTextSplitter } from "langchain/text_splitter"; | ||
|
||
interface TextSplitterChunkParams { | ||
chunkSize: number; | ||
chunkOverlap: number; | ||
keepSeparator: boolean; | ||
} | ||
|
||
const TEXT_SPLITTER_CHUNK_PARAMS: TextSplitterChunkParams = { | ||
chunkSize: 300, | ||
chunkOverlap: 0, | ||
keepSeparator: false, | ||
}; | ||
|
||
class QnaPairChunker extends BaseChunker { | ||
constructor() { | ||
const text_splitter = new RecursiveCharacterTextSplitter( | ||
TEXT_SPLITTER_CHUNK_PARAMS | ||
); | ||
super(text_splitter); | ||
} | ||
} | ||
|
||
export { QnaPairChunker }; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
import { BaseChunker } from "./BaseChunker"; | ||
import { RecursiveCharacterTextSplitter } from "langchain/text_splitter"; | ||
|
||
interface TextSplitterChunkParams { | ||
chunkSize: number; | ||
chunkOverlap: number; | ||
keepSeparator: boolean; | ||
} | ||
|
||
const TEXT_SPLITTER_CHUNK_PARAMS: TextSplitterChunkParams = { | ||
chunkSize: 500, | ||
chunkOverlap: 0, | ||
keepSeparator: false, | ||
}; | ||
|
||
class WebPageChunker extends BaseChunker { | ||
constructor() { | ||
const text_splitter = new RecursiveCharacterTextSplitter( | ||
TEXT_SPLITTER_CHUNK_PARAMS | ||
); | ||
super(text_splitter); | ||
} | ||
} | ||
|
||
export { WebPageChunker }; |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
import { BaseChunker } from "./BaseChunker"; | ||
import { PdfFileChunker } from "./PdfFile"; | ||
import { QnaPairChunker } from "./QnaPair"; | ||
import { WebPageChunker } from "./WebPage"; | ||
|
||
export { BaseChunker, PdfFileChunker, QnaPairChunker, WebPageChunker } |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.