GithubHelp home page GithubHelp logo

kamron-h / nlp-research-summarizer Goto Github PK

View Code? Open in Web Editor NEW
1.0 3.0 0.0 3.22 MB

A Flask, OpenAI, and Redis chatbot for academic literature review.

Python 6.21% CSS 4.54% JavaScript 6.15% HTML 83.10%
language-model openai python3 flask redis

nlp-research-summarizer's Introduction

NLP Research Assistant

LangChain, OpenAI, PgVector, and Flask NLP chatbot for academic literature review assistance.

Description

  • This is a Python based application that allows you to chat with a bot/model based on the input of multiple PDF documents. You can ask questions about the PDFs using natural language, and the application will provide relevant responses based on the content of the documents. Utilizing GPT-4 as large language model to generate accurate answers to your queries.

How It Works

The application follows these steps to provide responses to your questions:

  1. PDF Loading: The app reads multiple PDF documents and extracts their text content.

  2. Text Chunking: The extracted text is divided into smaller chunks that can be processed effectively.

  3. Language Model: The application utilizes a language model to generate vector representations (embeddings) of the text chunks.

  4. Similarity Matching: When you ask a question, the app compares it with the text chunks and identifies the most semantically similar ones.

  5. Response Generation: The selected chunks are passed to the language model, which generates a response based on the relevant content of the PDFs.

Installation

Prerequisites

Steps

  1. Clone the repository:

    git clone [https://github.com/Vamp-ECU/nlp-research-summarizer]
    cd project-name
  2. Create a virtual environment (recommended):

    python3 -m venv env 
    source env/bin/activate
  • If you're using Windows, the activation command is:

    .\venv\Scripts\Activate.ps1
  1. Install dependencies:

    pip install -r requirements.txt
  2. Set up the environment variables:

    Create a .env file in the root directory of the project and add the following variables:

    OPENAI_API_KEY=your_openai_api_key
    

    Replace your_openai_api_key with your OpenAI API key.

Running the Application

  1. Make sure your virtual environment is activated (if you created one).

  2. Start the Flask development server:

    flask run

Usage

To use the MultiPDF Chat App, follow these steps:

  1. Ensure that you have installed the required dependencies and added the OpenAI API key to the .env file.

  2. Navigate to the Assistant page.

  3. Load multiple PDF documents into the app by following the provided instructions.

  4. Ask questions in natural language about the loaded PDFs using the chat interface.

Important Points:

  • Security: When using pickle, be aware that unpickling data can execute arbitrary code if the data is crafted by a malicious user. Only unpickle data you trust.
  • Redis Configuration: The above example assumes Redis is running on localhost with the default port 6379. Adjust these settings as necessary.
  • Session Management: We’re using Flask’s session.sid as the Redis key for storing each user’s vectorstore. Ensure your Flask session is securely configured.

Contributing

This repository is intended for educational purposes and does not accept further contributions.

nlp-research-summarizer's People

Contributors

kamron-h avatar fernaldr avatar corpeningm19 avatar

Stargazers

 avatar

Watchers

 avatar  avatar Kostas Georgiou avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.