- Project Overview
- Key Features
- Technology Stack
- Project Structure
- Detailed Component Breakdown
- Setup and Installation
- Usage Guide
- Contributing Guidelines
- Troubleshooting
- Future Improvements
The Interview Evaluation System is a sophisticated web-based application designed to automate and enhance the interview process. It leverages cutting-edge technologies in speech recognition, natural language processing, and machine learning to transcribe interview questions and answers, generate ideal responses, and provide comprehensive evaluations of interviewee performance.
- Real-time speech-to-text conversion for capturing interview dialogue
- Retrieval-Augmented Generation (RAG) for producing context-aware ideal answers
- Automated answer evaluation using ROUGE scores and LLM-based assessment
- Interactive conversation history tracking
- Detailed debug logging for system diagnostics and troubleshooting
- Backend: Python 3.8+, Flask 2.0+
- Frontend: HTML5, CSS3, JavaScript (ES6+)
- Speech Recognition: SpeechRecognition library
- Natural Language Processing: Langchain, Groq API
- Audio Processing: FFmpeg
- Text Similarity: ROUGE
- Asynchronous Programming: asyncio
interview_evaluation_system/
│
├── app.py # Main Flask application
├── speechrec.py # Speech recognition module
├── rag.py # Retrieval-Augmented Generation module
├── intervieweval.py # Answer evaluation module
├── requirements.txt # Python dependencies
│
├── templates/
│ └── index.html # Main frontend interface
│
├── static/
│ ├── css/
│ │ └── styles.css # Custom CSS (if separated from index.html)
│ └── js/
│ └── main.js # Custom JavaScript (if separated from index.html)
│
└── temp/ # Temporary directory for audio files (created at runtime)
This is the core of our Flask application, orchestrating all components and handling HTTP requests.
Key Functions:
-
process_audio()
: Handles audio file uploads, coordinates transcription, answer generation, and evaluation.@app.route('/process_audio', methods=['POST']) def process_audio(): # ... (file handling and audio conversion) text = speech_to_text(wav_path) if is_question: return jsonify({'text': text}) else: ideal_answer = rag_generator.generate_answer(question) evaluation = asyncio.run(scorer.score_answer(question, ideal_answer, text)) return jsonify({'text': text, 'evaluation': evaluation})
This function demonstrates how we integrate speech recognition, RAG, and evaluation components.
-
convert_to_wav()
: Utilizes FFmpeg to convert uploaded audio to WAV format.def convert_to_wav(input_path, output_path): command = [FFMPEG_PATH, '-i', input_path, '-acodec', 'pcm_s16le', '-ar', '44100', output_path] result = subprocess.run(command, check=True, capture_output=True, text=True)
This function is crucial for ensuring audio compatibility across different systems.
Handles the speech-to-text conversion using the SpeechRecognition library.
Key Function:
speech_to_text()
: Converts audio file to text.This function encapsulates error handling for common speech recognition issues.def speech_to_text(audio_file_path): recognizer = sr.Recognizer() with sr.AudioFile(audio_file_path) as source: audio = recognizer.record(source) try: return recognizer.recognize_google(audio) except sr.UnknownValueError: return "Speech recognition could not understand the audio" except sr.RequestError as e: return f"Could not request results from speech recognition service; {e}"
Implements the Retrieval-Augmented Generation system for producing ideal answers.
Key Class:
RAGAnswerGenerator
: Manages the RAG process.This class demonstrates how we integrate FAISS for efficient similarity search and Groq API for language model inference.class RAGAnswerGenerator: def __init__(self, knowledge_base_dir, groq_api_key): # ... (initialization) def _create_vectorstore(self): # ... (create FAISS vectorstore from knowledge base) def _create_qa_chain(self): # ... (set up ConversationalRetrievalChain) def generate_answer(self, question): return self.qa_chain.run(question)
Handles the evaluation of interviewee answers against ideal responses.
Key Class:
AnswerComparisonScorer
: Manages the scoring process.This class showcases the use of both traditional metrics (ROUGE) and AI-based evaluation using Groq API.class AnswerComparisonScorer: def __init__(self, groq_api_key): # ... (initialization) async def llm_evaluation(self, question, ideal_answer, actual_answer): # ... (perform LLM-based evaluation) def compute_rouge_scores(self, ideal_answer, actual_answer): # ... (calculate ROUGE scores) async def score_answer(self, question, ideal_answer, actual_answer): rouge_scores = self.compute_rouge_scores(ideal_answer, actual_answer) llm_evaluation = await self.llm_evaluation(question, ideal_answer, actual_answer) # ... (combine scores and return evaluation)
Provides the user interface and client-side logic for the application.
Key JavaScript Functions:
startRecording()
: Initiates audio recording.stopRecording()
: Stops recording and sends audio to the server.updateButtonState()
: Manages UI state based on recording status.addToConversationHistory()
: Updates the conversation display with new Q&A pairs.
- Clone the repository:
git clone https://github.com/your-repo/interview-evaluation-system.git cd interview-evaluation-system
- Install FFmpeg on your system (visit https://ffmpeg.org/download.html for instructions)
- Set up a Python virtual environment:
python -m venv venv source venv/bin/activate # On Windows use `venv\Scripts\activate`
- Install dependencies:
pip install -r requirements.txt
- Set the GROQ_API_KEY environment variable:
export GROQ_API_KEY="your-api-key-here"
- Run the application:
python app.py
- Access the application by navigating to
http://localhost:5000
in your web browser. - Click "Start Question" to begin recording an interview question.
- Click "Stop Question" when finished. The transcribed question will appear.
- Click "Start Answer" to record the interviewee's response.
- Click "Stop Answer" to end recording. The system will process and evaluate the answer.
- View the evaluation results and conversation history on the page.
- Fork the repository and create a new branch for your feature or bug fix.
- Ensure your code follows PEP 8 style guide for Python code.
- Write unit tests for new features using pytest.
- Update documentation, including this README, as necessary.
- Submit a pull request with a clear description of your changes.
- If you encounter audio-related issues, ensure FFmpeg is correctly installed and accessible in your system PATH.
- For speech recognition errors, check your microphone settings and internet connection.
- If you face Groq API issues, verify your API key and check Groq's service status.
- Implement user authentication and session management for secure, multi-user support.
- Add support for multiple interview types or domains with customizable evaluation criteria.
- Enhance error handling with more informative user feedback.
- Optimize performance for handling longer interviews and larger knowledge bases.
- Implement a more sophisticated frontend framework (e.g., React, Vue.js) for improved interactivity.
- Integrate with popular video conferencing platforms for remote interview support.
For any questions or issues, please open an issue in the GitHub repository or contact the maintainers directly.