Announcements
This site is in read only until July 22 as we migrate to a new platform; refer to this community post for more details.
Get hands-on experience with 20+ free Google Cloud products and $300 in free credit for new customers.

BigQuery VECTOR_SEARCH() and ML.GENERATE_EMBEDDING() - Negation handling

Hi,

I'm using BigQuery ML.GENERATE_EMBEDDING() and VECTOR_SEARCH() functions. I have a sample product catalog for which I created embeddings and then run vector search query to fetch the relevant results, which was working great until my query included the negation in it.

Say I write a query as , "looking for yellow t-shirts for boys."
It is working great and fetching the relevant results.

However, if change my query as, "looking for boys t-shirts and not yellow"
It should not include any results including the yellow color. Unfortunately, the color yellow is at the top of results, which means the negation ("not yellow") ain't working properly in this scenario.

What is the solution for it?

A sample query snapshot is shown below for reference

ammar_hanif_0-1719916592778.png

 



3 2 3,033