-
Notifications
You must be signed in to change notification settings - Fork 4
feat: add word_confidence_threshold param to whisper #23
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -184,6 +184,11 @@ class LLMWhispererClientV2 { | |
| * @param {boolean} [options.addLineNos=false] - If true, adds line numbers to the extracted text | ||
| * and saves line metadata, which can be queried later | ||
| * using the highlights API. | ||
| * @param {number} [options.wordConfidenceThreshold=0.3] - The minimum OCR confidence score a word must | ||
| * have to be included in the extracted text. Any text whose confidence | ||
| * value falls below the configured threshold is ignored and excluded | ||
| * from the final output. This parameter works only with "form", | ||
| * "high_quality" and "table" modes. | ||
|
|
||
| * @returns {Promise<Object>} The response from the whisper API. | ||
| * @throws {LLMWhispererClientException} If there is an error in the request. | ||
|
|
@@ -210,6 +215,7 @@ class LLMWhispererClientV2 { | |
| waitForCompletion = false, | ||
| waitTimeout = 180, | ||
| addLineNos = false, | ||
| wordConfidenceThreshold = 0.3, | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. [P2 · behavior] Client now forces With
[P3 · validation] No range check. Confidence is expected in |
||
| } = {}) { | ||
| this.logger.debug("whisper called"); | ||
| const apiUrl = `${this.baseUrl}/whisper`; | ||
|
|
@@ -234,6 +240,7 @@ class LLMWhispererClientV2 { | |
| wait_for_completion: waitForCompletion, | ||
| wait_timeout: waitTimeout, | ||
| add_line_nos: addLineNos, | ||
| word_confidence_threshold: wordConfidenceThreshold, | ||
|
jaseemjaskp marked this conversation as resolved.
|
||
| }; | ||
|
|
||
| this.logger.debug(`api_url: ${apiUrl}`); | ||
|
|
||
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Uh oh!
There was an error while loading. Please reload this page.