Package org.apache.tika.inference
Class EmbedTask
java.lang.Object
org.apache.tika.inference.EmbedTask
- All Implemented Interfaces:
InferenceTask
The
embed task. Media: see embedMedia(org.apache.tika.parser.inference.InferenceBinding, java.util.List<org.apache.tika.parser.inference.InferenceUnit>, org.apache.tika.inference.EmbeddingEngine, org.apache.tika.parser.ParseContext). Images and pages: one vector chunk per unit, written on the
unit's destination with the page locator when the unit is a page or has one. Text: the
unit's text is chunked and every chunk gets a vector, on the unit's own document.
Requests are filled to the engine's batch size; every chunk names the binding as its
producer.-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidrun(InferenceBinding binding, List<InferenceUnit> units, Engine engine, ParseContext context) voidvalidate(InferenceBinding binding, Engine engine) Rejects an engine this task cannot use; called once at config load.
-
Constructor Details
-
EmbedTask
public EmbedTask()
-
-
Method Details
-
validate
Description copied from interface:InferenceTaskRejects an engine this task cannot use; called once at config load.- Specified by:
validatein interfaceInferenceTask- Throws:
TikaConfigException
-
run
public void run(InferenceBinding binding, List<InferenceUnit> units, Engine engine, ParseContext context) throws IOException, TikaException - Specified by:
runin interfaceInferenceTask- Throws:
IOExceptionTikaException
-