Show related packages based on description embeddings
Package pages get a "Related packages" section: a nearest neighbor query against the package's own stored embedding (no external service call), excluding the package itself. Packages without an embedding render no section.
This commit is contained in:
parent
fdf3289f54
commit
4d07f43a2e
5 changed files with 46 additions and 0 deletions
|
|
@ -30,6 +30,9 @@ class PackagesController < ApplicationController
|
|||
@screenshots = @package.screenshots.accessible_by(current_ability, :view).paginate(
|
||||
page: @page, per_page: 6
|
||||
)
|
||||
# Semantic recommendations based on the package's own description
|
||||
# embedding - a plain nearest neighbor query, no service call.
|
||||
@related_packages = @package.related_packages
|
||||
end
|
||||
end
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue