Olayinka // DataCreative
Guess the Query: NLP Classification
This is a FastAPI application that takes in a search query for the Flipkart websiote and returns the best matching products which it can find.
GuessTheQuery
├── src
│ ├── db
│ │ ├── __init__.py
│ │ ├── class_model.py
│ │ ├── db_connect.py
│ ├── ml
│ │ ├── __init__.py
│ │ ├── train.py
│ │ ├── training_file.txt
│ ├── __init__.py
│ └── main.py
├── Dockerfile
├── logging.ini
├── README.md
└── requirements.txt
These instructions will help you set up and run the FastAPI application on your local machine.
- Python 3.9+
- MongoDB database (You can set up a local instance or use a cloud-based MongoDB service)
- Clone this repository:
git clone https://github.com/your/repo.git
- Install requirements
pip install -r requirements.txt
- Run the FastAPI application:
uvicorn app:app --host 0.0.0.0 --port 8000
- Access the swagger docs via http://0.0.0.0:8000/docs
Alternatively, you can use the Dockerfile.
To predict the product for a search query, send a POST request to the /predict endpoint with a JSON payload containing the search query. The endpoint will return the predicted product name.
Example POST request:
POST http://localhost:8000/predict
Content-Type: application/json
{
"search_query": "Search Query Here"
}