This project includes a set of Python scripts for extracting information and demonstrating a question-answering application using Atlas Vector Search and RAG architecture.
README.md: Project documentation providing an overview of the project and usage instructions.extract_information.py: Python script for extracting information using Atlas Vector Search.key_param.py: Configuration file containing key parameters and dependencies.load_data.py: Python script for loading data into MongoDB Atlas.Sample_Files/: Directory containing sample text files for demonstration.
The key_param.py file serves as a configuration file for setting up key parameters and dependencies required for the project. It includes the following functionality:
- Imports necessary libraries and modules.
- Connects to MongoDB Atlas using the specified URI and sets up a database and collection.
- Initializes a directory loader to load data from text files in the
Sample_Filesdirectory. - Creates OpenAI embeddings and stores data in the MongoDB collection.
- Defines a function (
query_data) for performing similarity search and question-answering using vector search and RAG architecture. - Utilizes Gradio to create a user interface for interacting with the question-answering application.
- Run the script to configure key parameters and load data into MongoDB Atlas.
- Utilize the
query_datafunction to perform similarity search and question-answering. - Launch the Gradio user interface for a user-friendly experience.
Note: Ensure to replace placeholder values with actual keys and URIs for proper functionality.
- Refer to
README.mdfor project-specific instructions and details. - Execute individual scripts (
extract_information.py,load_data.py) based on the desired functionality. - Interact with the question-answering application through the Gradio user interface.
pymongo: MongoDB Python driver for interacting with MongoDB Atlas.langchain: A library for natural language processing tasks.gradio: A library for creating interactive user interfaces for machine learning models.
The Sample_Files directory contains text files used for demonstration purposes. Users can customize and replace these files with their own data.
This documentation provides a high-level overview of the project structure, key files, and usage instructions. For detailed information on each script's functionality, refer to the code and comments within each file.