VectorisedGraph
#
Bases: object
VectorisedGraph object that contains embedded documents that correspond to graph entities.
edges_by_similarity(query, limit, window=None)
#
Perform a similarity search between each edge's associated document and a specified query. Returns a number of edges up to a specified limit ranked in ascending order of distance.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
query
|
str | list
|
The text or the embedding to calculate the distance from. |
required |
limit
|
int
|
The maximum number of new edges in the results. |
required |
window
|
Tuple[int | str, int | str]
|
The window that documents need to belong to in order to be considered. |
None
|
Returns:
| Type | Description |
|---|---|
VectorSelection
|
The vector selection resulting from the search. |
empty_selection()
#
Return an empty selection of entities.
entities_by_similarity(query, limit, window=None)
#
Perform a similarity search between each entity's associated document and a specified query. Returns a number of entities up to a specified limit ranked in ascending order of distance.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
query
|
str | list
|
The text or the embedding to calculate the distance from. |
required |
limit
|
int
|
The maximum number of new entities in the result. |
required |
window
|
Tuple[int | str, int | str]
|
The window that documents need to belong to in order to be considered. |
None
|
Returns:
| Type | Description |
|---|---|
VectorSelection
|
The vector selection resulting from the search. |
nodes_by_similarity(query, limit, window=None)
#
Perform a similarity search between each node's associated document and a specified query. Returns a number of nodes up to a specified limit ranked in ascending order of distance.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
query
|
str | list
|
The text or the embedding to calculate the distance from. |
required |
limit
|
int
|
The maximum number of new nodes in the result. |
required |
window
|
Tuple[int | str, int | str]
|
The window where documents need to belong to in order to be considered. |
None
|
Returns:
| Type | Description |
|---|---|
VectorSelection
|
The vector selection resulting from the search. |
optimize_index()
#
Optmize the vector index