Git Product home page Git Product logo

cheese-recs's Introduction

Cheese-Recs

A cheese recommendation website

Description

This web application recommends cheeses based on user input and uses TF-IDF vectorization and cosine similarity to find similar cheeses. The application then returns the top recommendations, excluding any cheeses with qualities specified by the user to be excluded.

Business Use Case

This project could be useful for a cheese retailer or distributor to provide personalized recommendations to their customers. By asking customers about their preferences and excluding any qualities they do not like, the retailer can provide a curated list of cheeses that are more likely to be appealing to the customer. This could increase customer satisfaction and potentially lead to higher sales.

Technical Explanation

The code is implementing a cheese recommendation system using the TF-IDF algorithm and cosine similarity.

The CheeseRecommender class initializes with a file path for a tab-separated values (tsv) file containing information on various cheeses. The data is loaded into a pandas DataFrame, and a TfidfVectorizer is created to transform the cheese descriptions into a matrix of TF-IDF (Term Frequency-Inverse Document Frequency) values.

The get_recommendations method takes in user input, number of recommendations, starting index, and a list of words to exclude from the recommendation. If the user does not provide any input or exclusion words, the method generates a random sample of cheese recommendations. If the user provides input, the user's input is transformed into a vector using the same TfidfVectorizer used on the cheese descriptions, and the cosine similarity between the user input vector and the cheese matrix is calculated. The method returns the top recommendations with the highest cosine similarity scores. If exclude words are provided, the method removes any cheeses containing the excluded words from the recommendations.

Local Installation

  1. Clone the repository:

    git clone https://github.com/psibir/chz-recs.git
    
  2. Navigate to the project directory:

    cd chz-recs
    
  3. Create a virtual environment:

    python3 -m .venv venv
    
  4. Activate the virtual environment:

    • For macOS/Linux:

      source .venv/bin/activate
      
    • For Windows:

      venv\Scripts\activate
      
  5. Install the required dependencies:

    pip install -r requirements.txt
    
  6. Run the application:

    python3 app.py
    
  7. Open a web browser and visit http://localhost:8080 to access the Cheese Recommender.

Usage

  • Home Page: The home page displays a form where you can enter user preferences for cheese recommendations. Fill in the required fields and click the "Submit" button to get personalized recommendations.

  • Results Page: After submitting the form on the home page, you will be redirected to the results page, which shows a list of recommended cheeses based on your preferences. Click on a cheese name to view more details about that cheese.

  • Cheese Details: The cheese details page provides information about a specific cheese. It includes details such as the cheese name, country of origin, region, family, rind type, milk type, fat content, kind, description, producer, and synonyms.

  • Cheese Library: The website also includes a full database of over 1800 cheeses available so you can find your favorites on your own.

Contributing

Contributions to the Cheese Recommender project are welcome! If you find any issues or have suggestions for improvements, please submit a pull request or open an issue on the project's GitHub repository.

License

This project is licensed under the MIT License. Feel free to use and modify it for your own purposes.

cheese-recs's People

Contributors

psibir avatar

Stargazers

 avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.