Class CrossEncoderBatchTranslator

java.lang.Object
ai.djl.huggingface.translator.CrossEncoderBatchTranslator
All Implemented Interfaces:
ai.djl.translate.NoBatchifyTranslator<ai.djl.util.StringPair[],float[][]>, ai.djl.translate.PostProcessor<float[][]>, ai.djl.translate.PreProcessor<ai.djl.util.StringPair[]>, ai.djl.translate.Translator<ai.djl.util.StringPair[],float[][]>

public class CrossEncoderBatchTranslator extends Object implements ai.djl.translate.NoBatchifyTranslator<ai.djl.util.StringPair[],float[][]>
The translator for Huggingface cross encoder model.
  • Method Summary

    Modifier and Type
    Method
    Description
    ai.djl.ndarray.NDList
    processInput(ai.djl.translate.TranslatorContext ctx, ai.djl.util.StringPair[] inputs)
    float[][]
    processOutput(ai.djl.translate.TranslatorContext ctx, ai.djl.ndarray.NDList list)

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

    Methods inherited from interface ai.djl.translate.NoBatchifyTranslator

    getBatchifier

    Methods inherited from interface ai.djl.translate.Translator

    getExpansions, prepare, toBatchTranslator, toBatchTranslator
  • Method Details

    • processInput

      public ai.djl.ndarray.NDList processInput(ai.djl.translate.TranslatorContext ctx, ai.djl.util.StringPair[] inputs) throws ai.djl.translate.TranslateException
      Specified by:
      processInput in interface ai.djl.translate.PreProcessor<ai.djl.util.StringPair[]>
      Throws:
      ai.djl.translate.TranslateException
    • processOutput

      public float[][] processOutput(ai.djl.translate.TranslatorContext ctx, ai.djl.ndarray.NDList list)
      Specified by:
      processOutput in interface ai.djl.translate.PostProcessor<float[][]>