Send feedback
mp.tasks.text.TextProofreader
Stay organized with collections
Save and categorize content based on your preferences.
Performs proofreading on text.
mp . tasks . text . TextProofreader (
lib : serial_dispatcher . SerialDispatcher , handle : ctypes . c_void_p
)
Methods
close
View source
close ()
Shuts down the MediaPipe task instance.
create_from_model_path
View source
@classmethod
create_from_model_path (
model_path : str
) -> 'TextProofreader'
Creates a TextProofreader object from model path.
Args
model_path
Path to the model.
Returns
TextProofreader object that's created from the model file and the
default TextProofreaderOptions.
Raises
ValueError
If failed to create TextProofreader object from the provided
file such as invalid file path.
RuntimeError
If other types of error occurred.
create_from_options
View source
@classmethod
create_from_options (
options : mp . tasks . text . TextProofreaderOptions
) -> 'TextProofreader'
Creates the TextProofreader object from text proofreader options.
Args
options
Options for the text proofreader task.
Returns
TextProofreader object that's created from options.
Raises
ValueError
If failed to create TextProofreader object from
TextProofreaderOptions such as missing the model.
RuntimeError
If other types of error occurred.
proofread
View source
proofread (
text : str
) -> mp . tasks . text . TextProofreaderResult
Performs proofreading on the input text.
Args
text
The input text.
Returns
A TextProofreaderResult object that contains the proofread text.
Raises
ValueError
If any of the input arguments is invalid.
RuntimeError
If proofreading failed to run.
proofread_async
View source
proofread_async (
text : str ,
result_callback : Callable [[ Optional [ TextProofreaderResult ], Optional [ str ]], None ]
) -> None
Performs proofreading on the input text asynchronously.
Args
text
The input text.
result_callback
A callback function that will be called with the
TextProofreaderResult and an error message (if any).
Raises
ValueError
If any of the input arguments is invalid, or if
proofread_async is called before the previous call has finished.
RuntimeError
If proofreading failed to run.
__enter__
View source
__enter__ ()
Returns self upon entering the runtime context.
__exit__
View source
__exit__ (
unused_exc_type , unused_exc_value , unused_traceback
)
Shuts down the MediaPipe task instance on exit of the context manager.
Send feedback
Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License , and code samples are licensed under the Apache 2.0 License . For details, see the Google Developers Site Policies . Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2026-11-05 UTC.
Need to tell us more?
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2026-11-05 UTC."],[],[]]