This project evaluates CVs for O-1A visa qualification using a FastAPI backend and OpenAI's language model. It employs a Retrieval-Augmented Generation (RAG) system to enhance the evaluation process by leveraging relevant document context.
-
Clone the repository:
git clone git clone https://github.com/ako1983/simple_cv_evaluation_for_O1.git cd my_cv_evaluation_app
-
Create a virtual environment and install dependencies:
python -m venv venv source venv/bin/activate # On Windows, use `venv\Scripts\activate` pip install -r requirements.txt
-
Run the FastAPI application:
uvicorn app:app --reload --port 8000
-
Use the loader script to evaluate a CV:
python query_data.py " how do you get qualified for O1 Visa"
app.py: FastAPI application code, including endpoints for creating the database, querying, and evaluating CVs.
create_database.py: Script for initializing and managing the Chroma vector store.
get_embedding_function.py: Defines the embedding function used for document processing.
loader.py: Script to send CV files to the FastAPI endpoint for evaluation.
query_data.py: Handles querying the Chroma database for relevant document context.
requirements.txt: List of dependencies required for the project.
README.md: Project overview, setup instructions, and usage guidelines.
/create_database Description: Initializes or resets the Chroma vector store with documents from the data/ directory.
Method: POST Parameters: reset (boolean, optional) - Resets the database if true. Response: A message indicating the status of the database creation.
/query_database Description: Retrieves relevant documents from the database based on a query. Method: POST Request Body: query_text (string): The query to search for relevant documents. Response: response (string): Generated response from the model. sources (list): List of document IDs used as context.
/evaluate Description: Evaluates a CV for O-1A visa qualification using document context from the database. Method: POST Request Body: cv_text (string): The CV content to be evaluated. Response: evaluation (string): The model's assessment of the CV's qualification.
See the docs/
directory for detailed information on design choices and how to evaluate the output.
Creating the Database:
curl -X POST "http://127.0.0.1:8000/create_database?reset=true"
Querying the Database:
curl -X POST "http://127.0.0.1:8000/query_database" -H "Content-Type: application/json" -d '{"query_text": "specific question or keyword"}'
Evaluating a CV:
curl -X POST "http://127.0.0.1:8000/evaluate" -H "Content-Type: application/json" -d '{"cv_text": "CV content here"}'