Class Encoder


  • public class Encoder
    extends Object
    • Constructor Detail

      • Encoder

        public Encoder()
    • Method Detail

      • encodeTextVectorPair

        public static byte[] encodeTextVectorPair​(String text,
                                                  double[] vector,
                                                  ByteBuffer bb)
                                           throws IOException
        Encodes a pair of some text and a double vector - intended as the text's embedding vector - into a sequence of bytes encoding the input information.
        Parameters:
        text - The text that the embedding vector belongs to.
        vector - The embedding vector for text.
        bb - A ByteBuffer that can be reused if it has enough capacity. May be null.
        Returns:
        A byte sequence encoding the input text and vector.
        Throws:
        IOException
        See Also:
        Decoder.decodeBinaryEmbeddingVectors(InputStream)