File size: 3,939 Bytes
8308b2a
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
4894267
 
 
8308b2a
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
47a7ea0
8308b2a
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
# Automated Interview Filtering

## Overview
The HR Interview Analysis System is an AI-powered tool that helps HR professionals streamline their interview process through automated analysis of video interviews, resumes, and candidate responses. The system leverages multiple AI technologies including emotion detection, speech-to-text conversion, and natural language processing to provide comprehensive candidate assessments.

## Architecture
The project follows a clean, **layered monolith architecture**:

```
src/
β”œβ”€β”€ domain/      # Core business logic and entities
β”œβ”€β”€ service/     # Use cases and business rules
β”œβ”€β”€ frontend/    # UI and API interfaces
└── utils/       # Helper functions and utilities
tests/
└── integration/ # Integration tests
.gitignore       # Git ignore file
README.md        # Project documentation
requirements.txt # Dependencies
```

### Key Components
- **Domain Layer**: Contains business entities, value objects, and enums
- **Service Layer**: Core business logic and use cases
    - LangChain for LLM integration
    - DeepFace for emotion analysis
    - Google Speech-to-Text for audio transcription
    - LlamaParse for resume parsing
- **Frontend Layer**: Gradio-based user interface
- **Utils**: Helper functions and utilities

## Technologies Used
- **Frontend**: Gradio
- **AI/ML**:
    - LangChain for LLM operations
    - DeepFace for facial emotion analysis
    - Google Speech-to-Text API
    - LlamaParse for resume parsing
- **Development Tools**:
    - Python 3.9+
    - Black for code formatting
    - pytest for testing
    - pre-commit hooks

## Prerequisites
- Python 3.9 or higher
- pip package manager
- Git

## Installation

1. Clone the repository:
```bash
git clone https://github.com/your-username/hr-interview-analyzer.git
cd hr-interview-analyzer
```

2. Create and activate virtual environment:
```bash
python -m venv venv
source venv/bin/activate  # On Windows: venv\Scripts\activate
```

3. Install dependencies:
```bash
pip install -r requirements.txt
```

4. Set up environment variables:
```bash
cp .env.example .env
# Edit .env with your API keys and configurations
```

## Development Setup

### Code Formatting
We use Black for code formatting. To set up:

1. Install pre-commit hooks:
```bash
pre-commit install
```

2. Run Black manually:
```bash
black .
```

3. Configure VS Code (optional):
```json
{
    "python.formatting.provider": "black",
    "editor.formatOnSave": true
}
```

### Git Workflow

#### Creating a New Branch
```bash
# Update main branch
git checkout main
git pull origin main

# Create new feature branch
git checkout -b feature/your-feature-name
```

#### Making Changes
```bash
# Stage changes
git add .

# Commit changes
git commit -m "feat: your descriptive commit message"

# Push to remote
git push origin feature/your-feature-name
```

### Running the Application

#### Starting Gradio Interface
```bash
python -m src.presentation.gradio.interface
```
The interface will be available at `http://localhost:7860`

#### Running Tests
```bash
# Run all tests
pytest

# Run specific test file
pytest tests/unit/test_interview_analyzer.py

# Run with coverage
pytest --cov=src tests/
```

## Configuration

### Environment Variables
```env
OPENAI_API_KEY=your_key_here
GOOGLE_SPEECH_KEY=your_key_here
LLAMAPARSE_API_KEY=your_key_here
```

### Supported File Formats
- Video: MP4, AVI, MOV, WMV
- Resume: PDF, DOCX, DOC, TXT

## Error Handling
The system implements comprehensive error handling for:
- Invalid file formats
- API failures
- Resource limitations
- Processing errors

## Contributing
1. Clone the repository
2. Create your feature branch
3. Commit your changes
4. Push to the branch
5. Create a Pull Request

### Commit Message Format
```
[<type>]: <subject>

[<body>]

[<footer>]
```
Types:
- feat: New feature
- fix: Bug fix
- docs: Documentation
- style: Formatting
- refactor: Code restructuring