From 4c0bc00bb714f0c453fb1a463841c68bebd314f2 Mon Sep 17 00:00:00 2001 From: yujonglee Date: Tue, 17 Sep 2024 18:47:15 +0900 Subject: [PATCH] set bound to keywords for source overview --- core/lib/canary/sources/source.ex | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/lib/canary/sources/source.ex b/core/lib/canary/sources/source.ex index 4ff69f3b..27fcf59a 100644 --- a/core/lib/canary/sources/source.ex +++ b/core/lib/canary/sources/source.ex @@ -71,7 +71,7 @@ defmodule Canary.Sources.Source do chunks |> Enum.map(fn %Ash.Union{value: value} -> value.content end) |> Enum.join("\n") - |> then(&Canary.Native.extract_keywords(&1, 20)) + |> then(&Canary.Native.extract_keywords(&1, max(5, floor(500 / length(documents))))) end) |> Enum.uniq()