Team Ai
Apppublic

ndhanvina/research-paper-explainer

sourceHugging Facemitupdated 1y agoView on Hugging Face
1likes
App README

Research Paper Explainer with Gemini & FAISS ๐Ÿ“š

An intelligent Streamlit-based application that leverages Google's Gemini AI and FAISS vector storage to help users understand research papers through interactive Q&A. Upload any research paper in PDF format and ask questions to get concise, context-aware answers.

๐ŸŒŸ Key Features

  • โ€”PDF Processing & Analysis
  • โ€”Upload and process any research paper in PDF format
  • โ€”Automatic document chunking with optimal overlap for context preservation
  • โ€”Smart text splitting using RecursiveCharacterTextSplitter
  • โ€”Advanced Vector Storage
  • โ€”Local vector storage using Facebook AI Similarity Search (FAISS)
  • โ€”Efficient similarity search for relevant context retrieval
  • โ€”In-memory storage for quick access and data privacy
  • โ€”Intelligent Q&A System
  • โ€”Powered by Google's Gemini 1.5 Flash model
  • โ€”Semantic understanding and context-aware responses
  • โ€”Precise answer length control (40-100 words)
  • โ€”Professional and concise response format
  • โ€”User-Friendly Interface
  • โ€”Clean and intuitive Streamlit interface
  • โ€”Real-time processing status updates
  • โ€”Easy API key configuration
  • โ€”Progress indicators and success/error messages

๐Ÿ› ๏ธ Technical Stack

  • โ€”Frontend: Streamlit
  • โ€”AI/ML:
  • โ€”Google Gemini AI (for text generation)
  • โ€”FAISS (for vector similarity search)
  • โ€”LangChain (for RAG pipeline)
  • โ€”Document Processing: PyPDF Loader
  • โ€”Text Processing: RecursiveCharacterTextSplitter

๐Ÿ“‹ Prerequisites

  • โ€”Python 3.7 or higher
  • โ€”Google Gemini API key (Get it here)
  • โ€”Sufficient RAM for FAISS in-memory operations

๐Ÿš€ Installation

  1. 1.Clone the repository:
bash
git clone https://github.com/yourusername/research-paper-gpt.git
cd research-paper-gpt
  1. 1.Create and activate a virtual environment (recommended):
bash
python -m venv venv
.\venv\Scripts\activate  # Windows
  1. 1.Install required packages:
bash
pip install -r requirements.txt

โš™๏ธ Configuration

  1. 1.Get your Google Gemini API key from Google AI Studio
  2. 2.Launch the application and enter your API key in the sidebar
  3. 3.The key is stored only for the current session

๐ŸŽฏ Usage Guide

  1. 1.Start the Application:
bash
streamlit run app.py
  1. 1.Configure API Key:
  2. 2.Enter your Gemini API key in the sidebar
  3. 3.Click "Save Gemini API Key"
  1. 1.Upload Research Paper:
  2. 2.Click "Browse files" or drag and drop your PDF
  3. 3.Wait for the upload confirmation
  1. 1.Process the Document:
  2. 2.Click "Process PDF" to start document chunking
  3. 3.Monitor the progress in the status messages
  1. 1.Create FAISS Store:
  2. 2.Click "Create FAISS Store" to generate embeddings
  3. 3.Wait for the completion message
  1. 1.Ask Questions:
  2. 2.Type your question in the text area
  3. 3.Click "Get Answer" for AI-generated responses

๐Ÿ” How It Works

  1. 1.Document Processing Pipeline:
  2. 2.PDF is loaded and split into manageable chunks
  3. 3.Chunks overlap by 200 characters to maintain context
  4. 4.Each chunk is processed for optimal information retrieval
  1. 1.Embedding Generation:
  2. 2.Text chunks are converted to vector embeddings
  3. 3.Uses Google's Generative AI embedding model
  4. 4.Vectors capture semantic meaning of text
  1. 1.Vector Storage:
  2. 2.FAISS creates an efficient index of embeddings
  3. 3.Enables fast similarity search
  4. 4.Maintains all data in local memory
  1. 1.Question Answering:
  2. 2.User query is processed and vectorized
  3. 3.FAISS retrieves most relevant context
  4. 4.Gemini AI generates precise, contextual answers

โš ๏ธ Important Notes

  • โ€”The application maintains all data in memory (no permanent storage)
  • โ€”API key is only stored in session state
  • โ€”Large PDFs may require significant RAM
  • โ€”Answer length is optimized for readability (40-100 words)

๐Ÿ”’ Security Considerations

  • โ€”No data is stored permanently
  • โ€”All processing happens locally
  • โ€”API key is never saved between sessions
  • โ€”PDF files are processed in temporary storage

๐Ÿค Contributing

Feel free to:

  • โ€”Open issues
  • โ€”Submit pull requests
  • โ€”Suggest improvements
  • โ€”Report bugs

๐Ÿ“„ License

This project is licensed under the MIT License - see the LICENSE file for details.

โœจ Acknowledgments

  • โ€”Google Gemini AI for the language model
  • โ€”Facebook Research for FAISS
  • โ€”LangChain for the RAG framework
  • โ€”Streamlit for the web interface

๐Ÿ“ž Support

For issues and questions:

  • โ€”Open a GitHub issue
  • โ€”Check existing documentation
  • โ€”Review closed issues for solutions