Class VllmActor
- All Implemented Interfaces:
com.scivicslab.pojoactor.core.CallableByActionName,AutoCloseable
Actor that calls a vLLM server via OpenAI-compatible chat completions API.
Provides two-step kana-kanji pair generation:
segment- Step 1: merge OCR fragments into bunsetsu-segmented sentencestoHiragana- Step 2: convert bunsetsu-segmented kanji text to hiragana
Supported actions:
setUrl- Set the vLLM endpoint URLsetModel- Set the model namesegment- Step 1: segment OCR text into bunsetsutoHiragana- Step 2: convert segmented text to hiragana
-
Field Summary
Fields inherited from class com.scivicslab.pojoactor.core.ActorRef
actorName, actorSystem, object -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptioncom.scivicslab.pojoactor.core.ActionResultStep 1: Send OCR text to LLM for bunsetsu segmentation.com.scivicslab.pojoactor.core.ActionResultcom.scivicslab.pojoactor.core.ActionResultcom.scivicslab.pojoactor.core.ActionResulttoHiragana(String segmentedText) Step 2: Convert bunsetsu-segmented kanji text to hiragana/kanji pairs.Methods inherited from class com.scivicslab.turingworkflow.workflow.IIActorRef
callByActionName, hasAnnotatedAction, invokeAnnotatedAction, parseFirstArgumentMethods inherited from class com.scivicslab.pojoactor.core.ActorRef
ask, ask, askNow, clearJsonState, clearPendingMessages, close, createChild, expandVariables, getJsonBoolean, getJsonInt, getJsonString, getJsonString, getLastResult, getName, getNamesOfChildren, getParentName, hasJson, hasJsonState, initLogger, isAlive, json, putJson, setLastResult, setParentName, system, tell, tell, tellNow, toStringOfJson, toStringOfYaml
-
Constructor Details
-
VllmActor
-
-
Method Details
-
setUrl
-
setModel
-
segment
Step 1: Send OCR text to LLM for bunsetsu segmentation. Returns the segmented kanji text (one sentence per line, bunsetsu separated by |). -
toHiragana
Step 2: Convert bunsetsu-segmented kanji text to hiragana/kanji pairs.Processes input in batches of 20 lines. For each batch, validates that lines containing Japanese have hiragana readings. Lines that fail validation are retried individually (up to 2 times). Purely ASCII/numeric lines require no hiragana and are passed through.
- Returns:
- tab-separated hiragana-kanji pairs, one per line
-