Package de.julielab.jcore.consumer.ew
Class Encoder
- java.lang.Object
-
- de.julielab.jcore.consumer.ew.Encoder
-
public class Encoder extends Object
-
-
Constructor Summary
Constructors Constructor Description Encoder()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static byte[]encodeTextVectorPair(String text, double[] vector, ByteBuffer bb)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.static byte[]encodeTextVectorPair(org.apache.commons.lang3.tuple.Pair<String,double[]> pair, ByteBuffer bb)
-
-
-
Method Detail
-
encodeTextVectorPair
public static byte[] encodeTextVectorPair(org.apache.commons.lang3.tuple.Pair<String,double[]> pair, ByteBuffer bb) throws IOException
- Throws:
IOException
-
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)
-
-