|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectpitt.search.semanticvectors.VectorStoreSparseRAM
public class VectorStoreSparseRAM
This class provides methods for reading a VectorStore into memory as an optimization if batching many searches.
The serialization currently presumes that the object (in the ObjectVectors) should be serialized as a String.
The class is constructed by creating a VectorStoreReader class, iterating through vectors and reading them into memory.
VectorStoreReaderLucene
,
ObjectVector
Nested Class Summary | |
---|---|
class |
VectorStoreSparseRAM.SparseVectorEnumeration
Implements the hasMoreElements() and nextElement() methods to give Enumeration interface from sparse vector store. |
Constructor Summary | |
---|---|
VectorStoreSparseRAM()
|
Method Summary | |
---|---|
void |
CreateRandomVectors(int numVectors,
int seedLength)
|
java.util.Enumeration<ObjectVector> |
getAllVectors()
|
java.util.Enumeration |
getKeys()
|
int |
getNumVectors()
|
short[] |
getSparseVector(java.lang.Object desiredObject)
Returns the sparse vector without going through the float[] interface. |
float[] |
getVector(java.lang.Object desiredObject)
Given an object, get its corresponding vector This implementation only works for string objects so far |
void |
putVector(java.lang.String key,
short[] sparseVector)
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public VectorStoreSparseRAM()
Method Detail |
---|
public java.util.Enumeration getKeys()
public void CreateRandomVectors(int numVectors, int seedLength)
public void putVector(java.lang.String key, short[] sparseVector)
public float[] getVector(java.lang.Object desiredObject)
getVector
in interface VectorStore
desiredObject
- - the string you're searching for
public short[] getSparseVector(java.lang.Object desiredObject)
public int getNumVectors()
getNumVectors
in interface VectorStore
public java.util.Enumeration<ObjectVector> getAllVectors()
getAllVectors
in interface VectorStore
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |