weaviatevector-database

How to find similar words in Weaviate database


I have heard that Weaviate database can be used to find similar words in database based on their meaning.

For example, If my Weaviate database contains words as: orange, dog, cat, bottle, laptop. And If my query word is 'tangerine' , then my database should return 'orange' as output. Because, the fruit 'orange' in database is the most similar word to 'tangerine'. Also, I want to store extra information with like it desc or some other fields(This other fields are just extra things used in my application for each object. This extra field has nothing to do with meaning of Object).

I have read the documentation on Weaviate but did not understood how can I approach this problem. Can anyone please tell me the way to achieve this. And also if possible, provide a small code depicting it. Thank you.


Solution

  • If my Weaviate database contains words as: orange, dog, cat, bottle, laptop

    Also, I want to store extra information with like it desc or some other fields

    You can create a schema that with properties to store the words you like and the extra info e.g. desc. Make sure to config your schema so that only the word property is vectorized and the others are skipped. More details here:

    https://weaviate.io/developers/weaviate/config-refs/schema

    If my query word is 'tangerine' , then my database should return 'orange' as output

    You can use the near text search for this. More details here: https://weaviate.io/developers/weaviate/api/graphql/search-operators#neartext