Skip to content

Commit

Permalink
[FSTORE-1418] Add embeding_index to fg creation guide (#388)
Browse files Browse the repository at this point in the history
* add similarity search reference

* Update docs/user_guides/fs/vector_similarity_search.md

Co-authored-by: Ralf <[email protected]>

---------

Co-authored-by: Ralf <[email protected]>
  • Loading branch information
kennethmhc and bubriks authored May 31, 2024
1 parent e74f5b4 commit 83078d3
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion docs/user_guides/fs/feature_group/create.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ The first step to create a feature group is to create the API metadata object re
)
```

The full method documentation is available [here](https://docs.hopsworks.ai/feature-store-api/{{{ hopsworks_version }}}/generated/api/feature_group_api/#featuregroup). `name` is the only mandatory parameter of the `create_feature_group` and represents the name of the feature group.
The full method documentation is available [here](https://docs.hopsworks.ai/feature-store-api/{{{ hopsworks_version }}}/generated/api/feature_group_api/#featuregroup). If you need to create a feature group with vector similarity search supported, refer to [this guide](../vector_similarity_search.md#extending-feature-groups-with-similarity-search). `name` is the only mandatory parameter of the `create_feature_group` and represents the name of the feature group.

In the example above we created the first version of a feature group named *weather*, we provide a description to make it searchable to the other project members, as well as making the feature group available online.

Expand Down
2 changes: 1 addition & 1 deletion docs/user_guides/fs/vector_similarity_search.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ from hsfs import embedding
emb = embedding.EmbeddingIndex(index_name="news_fg")
```

Then, add one or more embedding features to the index. Name and dimension of the embedding features are required for identifying which features should be indexed for k-nearest neighbor (KNN) search. In this example, we get the dimension of the embedding by taking the length of the value of the `embedding_heading` column in the first row of the dataframe `df`. Optionally, you can specify the similarity function among `l2_norm`, `cosine`, and `dot_product`.
Then, add one or more embedding features to the index. Name and dimension of the embedding features are required for identifying which features should be indexed for k-nearest neighbor (KNN) search. In this example, we get the dimension of the embedding by taking the length of the value of the `embedding_heading` column in the first row of the dataframe `df`. Optionally, you can specify the similarity function among `l2_norm`, `cosine`, and `dot_product`. Refer to [add_embedding](https://docs.hopsworks.ai/feature-store-api/{{{ hopsworks_version }}}/generated/api/embedding_index_api/#add_embedding) for the full list of arguments.
```aidl
# Add embedding feature to the index
emb.add_embedding("embedding_heading", len(df["embedding_heading"][0]))
Expand Down

0 comments on commit 83078d3

Please sign in to comment.