Code Monkey home page Code Monkey logo

document-summariser's Introduction

document-summariser

Document Summariser is a tool that generates interactive summaries from text using GPT. Given an input document, the tool will first generate a summary using GPT. Then, when a user selects a sentence in the summary, the tool generates a relevance mapping between that sentence and the paragraphs in the document. It does this by computing the pairwise cosine similarity between the summary text embedding vector and each of the paragraph text embedding vectors. The tool also uses GPT to generate these text embeddings. This relevance mapping is rendered as a heatmap, with darker highlighting indicating higher relevance to the summary sentence.

example

Note: this app was put together as a proof of concept. As a result, some shortcuts were taken during development.

Instructions

Server

The server is built with Python@^3.9, FastAPI and some helper packages for things like typing/validation, reading from .env, OpenAI interaction and NLP. It is built using Poetry, so make sure this is installed along with a suitable python version. The following steps describe how to run the server.

  • Change into the server directory: cd server
  • Add your OpenAI API key to a .env file: echo 'OPENAI_API_KEY="<your-api-key>"' > .env
  • Install dependencies: poetry install
  • Run the server: poetry run python main.py

Client

The client is built with React and TypeScript, and was bootstrapped with create-react-app. The following steps describe how to run the client.

  • Change into the client directory: cd client
  • Install dependencies: npm install
  • Run the client: npm start
  • Navigate to localhost:3000 in your browser

Built with

  • React - Client UI library
  • TypeScript - Typing for JavaScript
  • npm - JavaScript dependency management
  • OpenAI - Completion and embeddings API
  • FastAPI - Server framework
  • Poetry - Python dependency management
  • NLTK - NLP library for tokenisation

License

MIT license

document-summariser's People

Contributors

michael-jb avatar

Stargazers

 avatar

Watchers

 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.