Interface to a repository for vectors representing word embeddings.
More...
#include <vectorStorageClientInterface.hpp>
Interface to a repository for vectors representing word embeddings.
virtual strus::VectorStorageClientInterface::~VectorStorageClientInterface |
( |
| ) |
|
|
inlinevirtual |
virtual void strus::VectorStorageClientInterface::close |
( |
| ) |
|
|
pure virtual |
Close client connection and eventually do some cleanup.
- Note
- the method does not have to be called necessarily.
-
it calls compactDatabase of the underlying database and can therefore last some time (some minutes in case of leveldb after large inserts).
virtual std::string strus::VectorStorageClientInterface::config |
( |
| ) |
const |
|
pure virtual |
Get the configuration of this storage.
- Returns
- the configuration string
Create an iterator on the feature values inserted.
- Returns
- the iterator
Create an insert/update transaction object.
- Returns
- the created transaction interface (with ownership)
- Note
- this function is thread safe, multiple concurrent transactions are allowed
virtual std::vector<std::string> strus::VectorStorageClientInterface::featureTypes |
( |
const std::string & |
featureValue | ) |
const |
|
pure virtual |
Get the list of types assigned to a specific featureValue.
- Parameters
-
[in] | featureValue | feature value to get the types assigned to |
- Returns
- the list of types assigned to 'featureValue'
virtual WordVector strus::VectorStorageClientInterface::featureVector |
( |
const std::string & |
type, |
|
|
const std::string & |
featureValue |
|
) |
| const |
|
pure virtual |
Get the vector assigned to a feature value.
- Parameters
-
[in] | type | type of the feature |
[in] | featureValue | value of the feature |
- Returns
- the vector assinged to this feature
virtual std::vector<VectorQueryResult> strus::VectorStorageClientInterface::findSimilar |
( |
const std::string & |
type, |
|
|
const WordVector & |
vec, |
|
|
int |
maxNofResults, |
|
|
double |
minSimilarity, |
|
|
bool |
realVecWeights |
|
) |
| const |
|
pure virtual |
Find all features that are within maximum simiarity distance.
- Parameters
-
[in] | type | type of the features to search for |
[in] | vec | vector to search similar features of |
[in] | maxNofResults | limits the number of results returned |
[in] | minSimilarity | value between 0.0 and 1.0 specifying the minimum similarity a result should have |
[in] | realVecWeights | true if to calculate the real vector weights and diffs for the best matches and not an approximate value (e.g. the similarity estimation derived from the LSH bits differing) |
virtual int strus::VectorStorageClientInterface::nofVectors |
( |
const std::string & |
type | ) |
const |
|
pure virtual |
Get the number of vectors defined for the features of a type.
- Parameters
-
- Returns
- the number of vectors
Calculate the normalized vector representation of the argument vector.
virtual void strus::VectorStorageClientInterface::prepareSearch |
( |
const std::string & |
type | ) |
|
|
pure virtual |
Prepare datastructures for calling findSimilar( const WordVector&, int,double,bool)const'.
- Parameters
-
[in] | type | type of the features to search for |
virtual std::vector<std::string> strus::VectorStorageClientInterface::types |
( |
| ) |
const |
|
pure virtual |
Get the list of types defined.
- Returns
- the list
virtual double strus::VectorStorageClientInterface::vectorSimilarity |
( |
const WordVector & |
v1, |
|
|
const WordVector & |
v2 |
|
) |
| const |
|
pure virtual |
Calculate a value between 0.0 and 1.0 representing the similarity of two vectors.
- Parameters
-
[in] | v1 | first input vector |
[in] | v2 | second input vector |
- Returns
- the similarity measure
The documentation for this class was generated from the following file: