Skip to content

lordofthejars-ai/recommendation-with-vectors

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Vectors

This repo shows an example on how to use Vectors for a recommendation engine.

The example contains two examples:

Vector Calculation

Calculates a vector from three strings and calculates the distance between them. To calculate the distance uses cosine distance where returns a value between -1 and 1 where -1 is a value when both sentences are semantically far away each other, and 1 when it is the same.

To try it start the service with quarkus dev having Docker or Podman started (required for the second example) and then access to /vector/calculate.

Recommendation

This example imports a partial dataset of Ikea furniture into the PostgresSQL with pgvector database calculating the vector of the description. Then given a product, the system returns 5 similar articles based on the description.

The first thing you need to do is import the dataset into database calling the following URL /product/generate. Then you can start getting recommendations for products. For example, send the following request to get 5 recommendations for the item with id 13: /product/recommend/13.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages