Skip to content

Book Finder project using BM25 and SBERT to address the Tip-of-the-Tongue phenomenon

Notifications You must be signed in to change notification settings

talhaStti/Book_Finder

Repository files navigation

Here is the formatted README.md in proper Markdown format.


Book Finder Project 📚

Addressing the Tip-of-the-Tongue Phenomenon


Project Description

The Book Finder project is an intelligent book search system designed to help users locate books even when they only remember vague or partial details. This project leverages Natural Language Processing (NLP) techniques, specifically BM25 for keyword-based search and Sentence-BERT (SBERT) for semantic search, to provide accurate and relevant search results.

The system features a modern, interactive web interface built with Flask, making it accessible and user-friendly. Whether users recall a book's theme, character names, or plot points, the Book Finder efficiently bridges the gap between incomplete memory and book discovery.


Features

  • 🔍 Keyword-Based Search: BM25 for tokenized keyword matching.
  • 🤖 Semantic Search: SBERT for context-aware similarity-based searching.
  • 🎨 Modern User Interface: Responsive and interactive Flask-based UI.
  • 📊 Dynamic Results: Display book titles, authors, and ratings dynamically.
  • 🚀 Scalable: Can be extended to other domains such as movies and music.

Technologies Used

Component Technology/Library
Programming Language Python
Web Framework Flask
NLP Models BM25, SBERT (all-MiniLM-L6-v2)
Libraries Pandas, NumPy, Torch, Rank-BM25, Sentence-Transformers
Frontend HTML, CSS
Deployment Local Server / Cloud Platforms

Project Setup

Follow the steps below to set up and run the Book Finder project on your local machine.

1. Prerequisites

Ensure you have the following installed on your system:

  • Python (version 3.8 or above)
  • pip (Python package manager)

2. Clone the Repository

git clone https://github.com/your-username/book-finder.git
cd book-finder

3. Install Dependencies

Run the following command to install the required libraries:

pip install -r requirements.txt

4. Project Files

Ensure you have the following files and folder structure:

project_folder/
│
├── app.py                          # Flask application  
├── books_data.pkl                  # Preprocessed book dataset with SBERT embeddings  
├── bm25_model.pkl                  # BM25 precomputed model  
├── templates/                      # HTML templates  
│   └── index.html                  # Frontend interface  
├── static/                         # Static files (CSS, images)  
│   └── style.css                   # Custom CSS for styling  
├── requirements.txt                # Project dependencies  
└── README.md                       # Project documentation  

5. Run the Application

Start the Flask application by running:

python app.py

The app will run on your local server. Open your browser and go to:

http://127.0.0.1:5000/

How to Use the Application

  1. Input Your Query:

    • Enter keywords, themes, author names, or plot details into the search box.
  2. Select a Search Method:

    • By default, the app uses BM25 for keyword-based search.
    • You can explore semantic search powered by SBERT.
  3. View Results:

    • The most relevant book titles, authors, and ratings will be displayed dynamically.

Output Screen

Homeimage

Future Enhancements

The following features can be added to improve the system:

  • 📸 Book Covers: Display images of book covers.
  • 🔖 Save Searches: Allow users to save search history.
  • 🎬 Other Domains: Extend support for movie and music searches.
  • ☁️ Cloud Deployment: Deploy the application to cloud platforms for wider accessibility.

Contributing

Contributions are welcome! Follow these steps to contribute:

  1. Fork the repository.
  2. Create a new branch:
    git checkout -b feature/your-feature-name
  3. Make your changes and commit them:
    git commit -m "Add your feature description"
  4. Push to the branch:
    git push origin feature/your-feature-name
  5. Submit a pull request.

Contact

For any questions or suggestions, feel free to reach out:


License

This project is licensed under the MIT License.


Acknowledgments

  • Inspired by the need to address the Tip-of-the-Tongue (TOT) phenomenon.
  • Datasets sourced from publicly available platforms like Goodreads.
  • Powered by Sentence-BERT and BM25 for efficient search.

About

Book Finder project using BM25 and SBERT to address the Tip-of-the-Tongue phenomenon

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published