The NLP Trainer is an intelligent virtual assistant designed to enhance understanding of Natural Language Processing (NLP) concepts and assist with interview preparation. Leveraging a Retrieval-Augmented Generation (RAG) pipeline and advanced Large Language Models (LLMs), the assistant provides precise, context-aware answers to common NLP questions.
- Interactive Q&A: Provides answers to foundational NLP concepts and advanced interview-style questions.
- Multi-Model Support: Includes two powerful LLMs:
- Llama-3.2-3B-Instruct for detailed responses.
- Flan-T5-Large for concise answers.
- Retrieval-Augmented Generation (RAG): Combines knowledge retrieval with generative capabilities for context-aware responses.
- Gradio UI: Intuitive web-based interface for seamless interaction.
- Knowledge Enhancement: Strengthen user understanding of NLP concepts.
- Interview Preparation: Provide clear, structured answers to frequently asked interview questions.
- Performance Optimization: Deliver accurate, contextually relevant answers efficiently.
- Compiled a corpus of over 12,000 words from:
- PDF of top 100 NLP interview questions.
- Web scraping from authoritative sources.
- Preprocessed using
PyPDF2andBeautifulSoupto ensure data quality.
- Embeddings: Generated using
all-MiniLM-L6-v2from Sentence Transformers. - Retrieval: Utilized FAISS for fast similarity searches and context retrieval.
- Context Integration: Filtered results using a similarity threshold of 0.7 for precision.
- Llama-3.2-3B-Instruct: Chosen for contextual depth and efficiency.
- Flan-T5-Large: Excels in question-answering with concise outputs.
- Fine-tuned RAG parameters and similarity thresholds.
- Enhanced prompt engineering to handle diverse query formats.
- Improved text cleanup for refined responses.
- Metrics: Evaluated using BLEU and ROUGE on 30 common NLP questions.
- Results:
- Llama-3.2: Higher scores, better for detailed responses.
- Flan-T5: Slightly lower scores, ideal for brevity.
- Clone the repository:
git clone https://github.com/sudip0789/NLP_Trainer.git cd NLP_Trainer - Add your Hugging Face token.
- The code was originally ran on Google Colab, hence replace the imports of the input files.

