Recomendation / README.md
ritikesh18's picture
Update README.md
5367a84 verified
|
Raw
History Blame Contribute Delete
2.3 kB
---
title: Book Recommender System
short_description: Book Recommendation System
sdk: streamlit
emoji: 🦀
colorFrom: green
colorTo: red
---
This is a content-based book recommender system built with Streamlit, Python, and machine learning techniques. The system takes a book title as input from the user and recommends 5 similar books based on content similarity (summaries and categories).
Features
User Input: A simple input box allows users to enter a book title.
Recommendations: Based on the book title, the system computes the 5 most similar books using text-based similarity from the dataset.
Cosine Similarity: Utilizes cosine similarity between book summaries and categories to find similar books.
Functionalities & Libraries
1. Data Loading and Processing
Library: pandas
Functionality:
Loads the dataset containing books, their summaries, and categories.
Preprocesses the dataset by combining summaries and categories into a single text field for similarity calculation.
2. Text Preprocessing and TF-IDF Vectorization
Library: scikit-learn (TfidfVectorizer)
Functionality:
Transforms the combined textual data (summaries + categories) into numerical features using TF-IDF vectorization.
TF-IDF (Term Frequency-Inverse Document Frequency) is used to convert the text into vectors that represent the importance of words in each document.
3. Similarity Calculation
Library: scikit-learn (cosine_similarity)
Functionality:
Computes the cosine similarity between the TF-IDF vectors of the books, which quantifies how similar two books are based on their content.
The system calculates similarity scores between the book that the user inputs and all the other books in the dataset.
4. Streamlit User Interface
Library: streamlit
Functionality:
Provides an interactive web interface where users can input a book title.
Displays the 5 most similar book recommendations based on content similarity.
5. Model Loading and Caching
Library: pickle (standard Python library)
Functionality:
The model (model2.pkl), which contains the pre-trained TF-IDF matrix, vectorizer, similarity matrix, and the dataset, is loaded using pickle.
The model is cached to avoid reloading it every time the page is refreshed.
Laod the model and start using this space
streamlit run app.py
#Happy training/Coding