File size: 2,881 Bytes
6f8d992
 
 
 
 
 
 
 
 
 
717fb23
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
c79625a
 
717fb23
23dae9f
717fb23
 
 
 
 
 
 
 
 
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
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
---
title: EcomShoppingBuddy
emoji: 🌍
colorFrom: pink
colorTo: red
sdk: streamlit
sdk_version: 1.27.2
app_file: app.py
pinned: false
---
# Shopping Buddy

## Overview:

This project leverages [Falcon LLM](https://falconllm.tii.ae/), [OpenAI](openai.com) API, [Sentence Transformer](https://www.sbert.net/docs/installation.html#install-sentencetransformers), [Hugging Face Hub](https://huggingface.co/) and [Streamlit](https://docs.streamlit.io/) to build and deploy a chatbot shopping assistant application that processes Amazon products dataset to provide tailored product recommendations aligned with user's needs. The application uses [Langchain](https://www.langchain.com/) to integrate those diverse functionalities. Data preprocessing, embedding generation, and storage in Redis are also essential components of this project.
More details about the project are provided in [this blog post](insertalink.com).

## Table of Contents

- [Shopping Buddy](#shopping-buddy)
  * [Overview](#overview)
  * [Installation & Setup](#installation--setup)
    + [1. Clone the Repository](#1-clone-the-repository)
    + [2. Install Dependencies](#2-install-dependencies)
    + [3. Environment Variables](#3-environment-variables)
    + [4. Data Preprocessing](#4-data-preprocessing)
  * [Running the Application](#running-the-application)
  * [Contributing](#contributing)


## Installation & Setup

### 1. Clone the Repository

```bash
git clone git@github.com:romaissaMe/shopping-buddy.git
cd shopping-buddy
```

### 2. Install Dependencies

```bash
pip install -r requirements.txt
```

### 3. Environment Variables

Set up your environment variables. This project uses the `dotenv` library to manage environment variables. Create a `.env` file in the root directory:
```bash
cp .env_example .env
```

and add the following variables:

```bash
HUGGINGFACEHUB_API_TOKEN=your_huggingface_api_token
OPENAI_API_KEY=your_openai_api_key
REDIS_HOST=your_redis_host
REDIS_PORT=your_redis_port
REDIS_KEY=your_redis_key
```

### 4. Data Preprocessing

Before running the main application, preprocess and import your data into a database using:

```bash
python preprocess.py
```
[data_link](https://drive.google.com/file/d/1tHWB6u3yQCuAgOYc-DxtZ8Mru3uV5_lj/view)

## Running the Application

Once the setup is complete, you can run the main application using:

```bash
streamlit run app.py
```

This will launch the Streamlit application, and you can access the chatbot via the provided URL.

<img
  src="./ShoppingBudddy.png"
  style="display: inline-block;margin: 0 auto ; max-width:400px">

## Contributing

If you're looking to contribute to this project, kindly follow the standard GitHub workflow:

1. Fork the repository.
2. Create a new branch for your feature or fix.
3. Commit your changes and open a pull request.
4. Ensure that your code adheres to the project's style and standards.