File size: 1,714 Bytes
3a55c8f 4d70cc4 3a55c8f f59cfac b06e5f9 f59cfac ef9b2bf 92d142b f59cfac ef9b2bf 85d6b98 ef9b2bf f59cfac ef9b2bf f59cfac |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 |
---
title: Book Recommendation
sdk: streamlit
emoji: π
colorFrom: blue
colorTo: pink
sdk_version: 1.33.0
app_file: app.py
pinned: false
---
## **The Smart Book Search project for russian users π**
### **Task π:**
To develop a system for recommending books based on a user request. The user enters a promt with a description of the book he wants to receive - the model gives a set number of recommended books.
### **Steps of work πͺ:**
**1. Data parsing.** We used an online bookstore https://www.biblio-globus.ru . The main problem was the parsing of different genres. We solved it by creating a dictionary with genres in the cycle, in which the key was the name of the genre, and the value was a link to a section of the catalog. As a result, we managed to collect about 5000 books, although initially several hundred more were planned, but not all book cards were allowed to be parsed. The final dataset has 6 columns: page url, image url, author, genre, title, annotation.
**2. Creating the model.** It was necessary to implement two models.
β’ **First model:** SentenceTransformer(sentence-transformers/all-mpnet-base-v2) and FAISS libraries(IndexFlatIP) for efficient similarity search.
β’ **Second model:** cointegrated/rubert-tiny2 and Cosine similarity is used as a metric
**3. The app on streamlit via hugging face.**
### **How to run locally? π»**
**1. To create a Python virtual environment for running the code, enter:**
>python3 -m venv my-env
**2. Activate the new environment:**
* Windows:
>my-env\Scripts\activate.bat
* MacOS and Linux:
>source my-env/bin/activate
**3. Install all dependencies from the requirements.txt file:**
>pip install -r requirements.txt |