0

I work in a company which develops a price comparator with Django (1.11). We have uploaded catalogs from merchants and my job is to find the related category for each products. Then, in our website we have about 22 categories (home, dress, glasses, barbecues, speakers, ...) Each catalog uploaded by a merchant has thousand products with properties such as: - name - description - category - price - ... This category can be each a word or a full category path (i.e: dress > shoes > baby > ...)

My question is: how can I find the best category from submitted informations ? I've tried to use trigram search on title but I have too many errors.

categories_by_title = Category.objects\
    .annotate(distance=TrigramDistance('name', product_title))\
    .filter(distance__lte=0.9)\
    .order_by('distance')

Do you know how can I find the most appropriate category function of submitted products ? There are many price comparator but I do not know how they do. Thanks

2
  • I suspect many of them are manually configured to map, e.g., Amazon categories (these are finite and relatively slow to change) to your own categories. Once that is done the query becomes simple. Having said that, this is too broad and too opinion-based to be on-topic. Please read about what's on-topic in the help center.
    – Chris
    Commented Jul 1, 2017 at 13:33
  • Did you have a look at related questions?
    – steppo
    Commented Jul 1, 2017 at 13:37

0

Browse other questions tagged or ask your own question.