Skip to content
Snippets Groups Projects
Unverified Commit efb8a409 authored by Siraj R Aizlewood's avatar Siraj R Aizlewood
Browse files

Merge branch 'simple_classification' of...

Merge branch 'simple_classification' of https://github.com/aurelio-labs/semantic-layer into simple_classification
parents b61facf3 aada86bb
No related branches found
No related tags found
No related merge requests found
......@@ -55,9 +55,7 @@ class DecisionLayer:
# create query vector
xq = np.array(self.encoder([text]))
xq = np.squeeze(xq) # Reduce to 1d array.
sim = np.dot(self.index, xq.T) / (norm(self.index, axis=1)*norm(xq.T))
# get indices of top_k records
top_k = min(top_k, sim.shape[0])
idx = np.argpartition(sim, -top_k)[-top_k:]
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment