Recommend members to jobs
This project implements a simple job recommendation system. The system matches members to their perfect jobs based on their bio and location preferences.
See the requirements in REQUIREMENTS.md for further details.
- Initial repo & dev environment setup
- Investigate the data with a Jupyter Notebook
- Implement the recommendation algorithm (introducing asyncio and pydantic)
- Implement different strategies for the recommendation algorithm (abstract base class)
- Implment an OpenAI strategy for the recommendation algorithm (use your openai api key and set the RECOMMENDATION_STRATEGY to openai in the .env file)
-
Clone the repository.
-
Create a virtual environment and activate it:
python3 -m venv venv . venv/bin/activate
-
Install the dependencies:
pip install -r requirements.txt
After installation of the dependencies:
jupyter-lab
A browser will open with the Jupyter Notebook interface. Open the investigation.ipynb
notebook to review the data and the initial solution.
NOTE: I would normally use a Makefile to build the venv, run the tests, and run the program. However, I am not using it in this project to keep it simple.
You will need to create a .env file inside the project directory with the following content:
MEMBERS_URL=https://bn-hiring-challenge.fly.dev/members.json
JOBS_URL=https://bn-hiring-challenge.fly.dev/jobs.json
RECOMMENDATION_STRATEGY=simple
OPENAI_API_KEY=your_openai_api_key
See .env-example for an example (you can copy it and rename it to .env).
Using environment variables for configuration makes it easier for deployments to have their own settings e.g. if we use docker containers or deploy to kubenetes etc.
To generate a list of members and their recommended jobs, after installing the dependencies and configuring the .env file:
python run.py
To run the tests with pytest, execute the following command in the terminal:
pytest
There are situations where the AI response may break the tests, so we may need to skip the tests that depend on the AI response, for example