AMAL TOTKAY

Having a growth mentality is not only important, but necessary in my life. People with a growth mindset believe that intelligence can be developed and information can be obtained. I concentrated on…

Smartphone

独家优惠奖金 100% 高达 1 BTC + 180 免费旋转




Fuzzy Wuzzy Searching

This post reviews how I modified the search functionality of the wine recommender I worked on for my capstone project.

Yes, it’s called “Fuzzy Wuzzy” searching, so let’s just get this out right here and then move on:

For our wine recommender, we need to ask users to type in the title of a wine so that the recommender can go find that title in the database, find the closest cosine similarity scores, and bring back the wines associated with those scores. Wine titles can be pretty complex. For example, here is one of the recommendations from the last post:

If asked to enter in one of these wine titles, we may not remember where the year goes, or what region is in parenthesis. We might get close, though. That’s where fuzzy wuzzy searching helps.

Fuzzy Wuzzy searching helps find approximate matches to strings (letters), rather than exact matches. Fuzzy Wuzzy takes in a few parameters, shown in this code:

First, it needs a key — that’s the approximate term you are searching for.

Second, it needs the choices it is going to search through — that is the list of possible options.

Here is an example. I want to search for “geyser peak chardonnay” but I don’t remember what year or what region and I don’t use capital letters.

I type it in and these are returned:

For this first input of the recommender, I had Fuzzy Wuzzy bring back the five closest matches (using “process.Extract” and the limit parameter). Next, I ask the user to enter in the wine they want to search for and do a second Fuzzy Wuzzy search (using the “process.extractOne” method) to bring back the top match for the recommender to use.

I put in geyser peak 2014 chardonnay. Notice I am still entering in an approximation of the wine title, not an exact match. And it brings back the top 10 matches we saw from the last post.

Here is the code of the recommender so far. I’m still a new at this (a “newb” they say, whoever “they” are), and I hope to keep improving it.

In my next post, I’ll share the evaluation metric I used to evaluate how accurate the recommendations are for our recommendation system. Since we are using a content-based recommender, and do not have actual user ratings, the accuracy can only be judged by the tasting notes, or the content, we have to work with.

See you next time.

Add a comment

Related posts:

Some Basic Docker Commands Beginner Should Know

Docker is a container-based application framework that allows deploying programs that are run as containers. Docker Containers are generally used in CI/CD (Continuous Integration/Continuous…

Learnings from the past decade

Learnings from the past decade. We are not competing with other people, just with our own self-doubt, laziness and procrastination. Make the right thing easier to do. Time….

Healthy diet plan

I think in some unspecified time in the future now we have all asked this query and searched and hoped for the magical answer. Okay, at the moment I wish to discuss to you about the most superior…