Semantic Search

BytapaScript

In a nutshell

Searching by meaning rather than exact keywords.

What it means

Searching for information based on meaning and intent rather than exact keyword matches.

💡 Asking a librarian for books about happiness and receiving books about well-being.

Code example

# find the chunks most similar to the query
scores = [cosine(query_vec, chunk_vec) for chunk_vec in chunk_vecs]
top = sorted(range(len(scores)), key=lambda i: -scores[i])[:3]

Why it matters

It finds relevant information even when users use different words from those in the original documents.

When to use it

  • Document search
  • E-commerce product search

Further reading

Related terms

Learn Full Stack

with tapaScript

By clicking Sign Up you re confirming that you agree with our Terms and Conditions.

newsletter

Don't forget to connect with us on