|
DocWire SDK
DocWire SDK: Award-winning modern data processing in C++20. SourceForge Community Choice & Microsoft support. AI-driven processing. Supports nearly 100 data formats, including email boxes and OCR. Boost efficiency in text extraction, web data extraction, data mining, document analysis. Offline processing possible for security and confidentiality
|
Class representing the CTranslate2 AI model loaded to memory. More...
#include <ct2_runner.h>
Public Member Functions | |
| ct2_runner (const std::filesystem::path &model_data_path) | |
| Constructor. Loads model to memory. More... | |
| std::string | process (const std::string &input) override |
| Process input text using the model. More... | |
| std::vector< double > | embed (const std::string &input) override |
| Create embedding for the input text using the model. More... | |
| virtual void | unload () override |
| Unload the model and free associated resources. –!Must be thread-safe!– and safe to call concurrently with process()/embed(). | |
Public Member Functions inherited from docwire::ai::ai_runner | |
| virtual | ~ai_runner ()=default |
| Virtual destructor. More... | |
Additional Inherited Members | |
Protected Types inherited from docwire::with_pimpl< ct2_runner > | |
| using | impl_type = pimpl_impl< ct2_runner > |
Protected Member Functions inherited from docwire::with_pimpl< ct2_runner > | |
| impl_type * | create_impl (Args &&... args) |
| with_pimpl (Args &&... args) | |
| with_pimpl (with_pimpl< ct2_runner > &&other) noexcept | |
| with_pimpl (std::nullptr_t) | |
| with_pimpl & | operator= (with_pimpl &&other) noexcept |
| impl_type & | impl () |
| const impl_type & | impl () const |
Class representing the CTranslate2 AI model loaded to memory.
Constructor loads model to memory and makes it ready for usage. Destructor frees memory used by model. It is important not to duplicate the object because memory consumption can be high.
Definition at line 32 of file ct2_runner.h.
| docwire::ai::ct2::ct2_runner::ct2_runner | ( | const std::filesystem::path & | model_data_path | ) |
Constructor. Loads model to memory.
| model_data_path | Path to the folder containing model files. |
|
overridevirtual |
Create embedding for the input text using the model.
| input | Text to process. |
Implements docwire::ai::ai_runner.
|
overridevirtual |
Process input text using the model.
| input | Text to process. |
Implements docwire::ai::ai_runner.