Code Monkey home page Code Monkey logo

book-recommendation-system-'s Introduction

Book-Recommendation-system


A book recommendation system is a type of recommender system that suggests books to users based on their preferences and past behavior. The goal of a book recommendation system is to help users discover new books that they might be interested in reading.

  • EDA

Built With

Python JavaScript HTML5 CSS3

Bootstrap

Firebase

Github Pages Git GitHub Canva Visual Studio Code


Running this project

Book-Recommendation-system Project. To build a book recommendation system, you need a large dataset of books, their authors, genres, descriptions, ratings, and any other relevant information. You also need to preprocess the data to clean it and convert categorical variables to numerical ones. Then you choose an appropriate algorithm, such as content-based filtering or collaborative filtering, and train your model on the preprocessed dataset.

Collect Data/ Import Library:

Collect a dataset of books, their authors, genres, descriptions, ratings, and any other relevant information that will help you build a recommendation system.

import numpy as np
import pandas as pd

Preprocess Data:

Clean the data and preprocess it for use in your recommendation system. This may include tasks such as removing duplicates, filling in missing values, and converting categorical variables to numerical ones.

Popularity Based Recommender System
Collaborative Filtering Based Recommender System

Choose a Recommendation Algorithm

There are many recommendation algorithms to choose from, such as content-based filtering, collaborative filtering, and matrix factorization. Choose the one that best fits your needs.

from sklearn.metrics.pairwise import cosine_similarity

Train Your Model And save in files:

Train your recommendation system on your preprocessed dataset using the chosen algorithm.

import pickle
pickle.dump(pt,open('pt.pkl','wb'))
pickle.dump(book,open('books.pkl','wb'))
pickle.dump(similarity_scores,open('similarity.pkl','wb'))

Then install the project dependencies with

pip install -r requirements.txt

Load the trained model:

Load the trained machine learning model into your Flask application. You can use a library like pickle to serialize your model and save it to disk, then load it into your Flask application when it starts up.

import pickle
from flask import Flask, request, render_template

# Load the trained model from disk
with open('model.pkl', 'rb') as f:
    model = pickle.load(f)

# Create a new Flask application
app = Flask(__name__)

# Define a route for book recommendations
@app.route('/recommend')
def recommend_books():
    # Get user input from the request arguments
    title = request.args.get('title')
    author = request.args.get('author')
    
    # Use the model to generate recommendations
    recommendations = model.predict(title, author)
    
    # Render the recommendations as HTML output
    return render_template('recommendations.html', recommendations=recommendations)

# Run the Flask application
if __name__ == '__main__':
    app.run(debug=True)

Data link:

https://www.kaggle.com/datasets/arashnic/book-recommendation-dataset

To build a book recommendation system, you need a large dataset of books, their authors, genres, descriptions, ratings, and any other relevant information. You also need to preprocess the data to clean it and convert categorical variables to numerical ones. Then you choose an appropriate algorithm, such as content-based filtering or collaborative filtering, and train your model on the preprocessed dataset.

Once your model is trained, you can build a user interface that allows users to input their preferences and see book recommendations based on those preferences. This user interface can be built using a web framework like Flask, and can be deployed on a cloud service like Heroku.

Overall, a book recommendation system can be a powerful tool for helping users discover new books and improving their reading experience.


Screenshots

Light Mode

Dark Mode


Contact

book-recommendation-system-'s People

Contributors

shaloofsaleem avatar

Stargazers

Mubarak Mayyeri avatar Jithin R S avatar

Watchers

 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.