Help with topK
# support
m
hello everyone can someone tell me what the topK means in this code: "knowledgeBase": { "topK": 2, "fileIds": [ "926201c3-xxxx-489a-xxxxx-1d38xxxxxx5883" ],
v
@MadHatMedia Hello! The
topK
parameter in the context of a knowledge base typically refers to the number of top results to return from a query. When you perform a search or request information from the knowledge base,
topK
determines how many of the most relevant results should be provided. In this case, a
topK
value of 2 means that the system will return the top 2 most relevant entries from the knowledge base in response to a query.
You can continue this conversation by mentioning me in the message.
m
ok i dont fully understand, what does "relevant results" pertain to? do you mean if i have 10 documents (fileID's), it will pull in 2 documents(fileID's)?
j
topK is number of relevant results usually
relevant results is ordered based on the similarity score from the knowledge base
it will pull in the 2 highest ranked documents
if topK is set to 2
@MadHatMedia let me know if that helped
m
ok so when you say "relevant results" you are reffering to relevant results of knowledge base documents. that helps. i did not see how to set a rank for each document, how is that set?
j
you cant set a rank for each document- it is computed whenever you do a query to the knowledgebase based on the input terms ( keywords etc. )
the rank is computed on every time you execute a query against the knowledge base
it reranks what has the most semantic similarity to your input query ( e.g. input "dog' as query, it will rank documents referring to dogs or dog related activities higher than say, a document about a hot air balloon)
if you just want it to pull everything each time and your knowledge base is small, just set topK = number of documents and similarity wont matter
@MadHatMedia if you need to discuss more we can hop on a quick call
s
just checking @MadHatMedia if resolved for you? Thanks @jsieber-eip for helping out.
4 Views