Spaces:
Runtime error
Download README.md from jacobwu/GenAI_Powered_Cover_Letter_Generator: direct link, hf CLI and curl.
- Browser
- Download file 5.05 kB
-
https://huggingface.co/spaces/jacobwu/GenAI_Powered_Cover_Letter_Generator/resolve/main/README.md
- Command line
-
hf download hf://spaces/jacobwu/GenAI_Powered_Cover_Letter_Generator/README.md
-
curl -L -o README.md https://huggingface.co/spaces/jacobwu/GenAI_Powered_Cover_Letter_Generator/resolve/main/README.md
A newer version of the Gradio SDK is available: 6.32.0
title: GenAI Powered Cover Letter Generator
emoji: ✉️
colorFrom: indigo
colorTo: blue
sdk: gradio
sdk_version: '3.0'
app_file: Cover_Letter_chain_github.py
pinned: false
license: mit
AI Powered Cover Letter Generator
Project Description
An AI-powered tool that generates personalized cover letters based on user-provided resume, LinkedIn profile URL, job description URL, and optional cover letter format.
Tech Stack
- Python: Main programming language
- Gradio: Interactive user interface
- BeautifulSoup: Web scraping for job descriptions and LinkedIn profiles
- LangChain: Managing sequential chains of operations
- PyPDFLoader: PDF file handling
- docx: DOCX file handling
- OpenAI GPT-4: Language model for generating text
- Requests: Library for making HTTP requests
- LangChain Community: Additional models and utilities for LangChain
Installation
Clone the repository:
git clone https://github.com/jacobwu25/AI-Powered-Cover-Letter-Generator.git cd AI-Powered-Cover-Letter-GeneratorCreate and activate a virtual environment:
python -m venv venv source venv/bin/activate # On Windows use `venv\Scripts\activate`Install the required packages:
pip install -r requirements.txtSet Up Environment Variables:
- Create a
.envfile in the root directory of your project:touch .env - Open the
.envfile and add your OpenAI API key:OPENAI_API_KEY=your_openai_api_key
Replace
your_openai_api_keywith your actual OpenAI API key.- Create a
Usage
- Run the application:
python app.py - Open the provided URL in your browser.
- Upload your resume, enter the LinkedIn profile URL, job description URL, and optionally upload a cover letter format.
- View the generated cover letter and messages.
High-Level Architecture
Overview
The system is composed of several key components:
- Input Handling: Collects inputs from the user, including resume (PDF), LinkedIn profile URL, job description URL, manual job description text, and optional cover letter format (PDF or DOCX).
- Processing: Uses LangChain to manage sequential operations, including fetching data, text extraction, and generating the cover letter.
- Output Generation: Displays the final cover letter and messages to the user via the Gradio interface.
Detailed Architecture
Gradio Interface:
- Inputs: Resume (PDF), LinkedIn profile URL, job description URL, manual job description text, optional cover letter format (PDF or DOCX)
- Outputs: Final cover letter, messages
Data Fetching and Text Extraction:
- BeautifulSoup: For scraping job descriptions and LinkedIn profiles
- PyPDFLoader: For extracting text from PDFs
- docx: For extracting text from DOCX files
LangChain Sequential Chain:
- LLM: Uses OpenAI GPT-4
- Prompt Templates: Used to define specific tasks for each chain
- Chains:
- Chain One: Summarizes the job description (
job_summary) - Chain Two: Creates a personal profile based on the resume and LinkedIn profile (
personal_profile) - Chain Three: Composes a draft of the cover letter (
cover_letter_draft) - Chain Four: Proofreads and finalizes the cover letter (
cover_letter_final)
- Chain One: Summarizes the job description (
Chain of Thought
Chain One: Job Summary Generation
- Function: Summarizes the job description to highlight key responsibilities and requirements.
- Prompt Template: Uses a template to extract essential information from the job description.
Chain Two: Personal Profile Creation
- Function: Generates a personal profile by combining data from the resume and LinkedIn profile.
- Prompt Template: Uses a template to create a coherent and compelling profile summary.
Chain Three: Cover Letter Draft Composition
- Function: Drafts the initial version of the cover letter by integrating the job summary and personal profile.
- Prompt Template: Uses a template to compose the cover letter with relevant sections and personalized content.
Chain Four: Cover Letter Finalization
- Function: Proofreads and finalizes the cover letter, ensuring it is polished and ready for submission.
- Prompt Template: Uses a template to review and enhance the draft, correcting any errors and improving the overall flow.
Contributing
Contributions are welcome! Please follow these steps to contribute:
- Fork the repository.
- Create a new branch (
git checkout -b feature-branch). - Commit your changes (
git commit -m 'Add new feature'). - Push to the branch (
git push origin feature-branch). - Open a pull request.
License
This project is licensed under the MIT License - see the LICENSE file for details.
