Giter Club home page Giter Club logo

book_summary's Introduction

Book Summary

In this repository, we generate both textual summaries and image descriptions for written texts.

Intro

The application is divided into Frontend and Backend. The backend is a locally running python server which is communicating with the frontend svelte based web application.

Backend

In the backend folder, we generate the text summaries and images. First generate text summaries based on json/epub content: python backend/book_summarizer.py --input_file "data/alice.json" Then generate image representations of the text. python backend/generator.py --input_file "data/alice_summarized.json" --output_dir "results"

Images are generated using a stable diffusion text to image model.

Frontend

For now, the frontend only displays different levels of text summaries.

Images are only placeholders as of now.

Getting started

Install Python and Node.js on your computer.
Clone the Project from GitHub and open the book_summary folder.

As an example Visual Studio Code is used here. Check that you have the Python extension installed.

One-time setup

Environment (Recommended, but optional)

  1. Install miniconda as Python environment.
  2. Press STRG + SHIFT + P and search for Python: Create Environment > Conda.

Here you can find more information regarding environments.

Interpreter

To select an interpreter, press STRG + SHIFT + P and search for Python: Select Interpreter.

How to setup Backend

  1. Open the terminal in VS Code and start a new command prompt.
  2. cd backend to change the directory to the backend folder.
  3. pip install -r requirements.txt to install the requirements.
  4. Optionally create a .flaskenv file with your HUGGINGFACE_TOKEN, see Huggingface security-tokens.
    HUGGINGFACE_TOKEN="hf_YOUR_TOKEN_HERE"
    Specifying the token will allow you to use the HuggingFace inference servers, which potentially are faster than your computer.
  5. python server.py to start the backend server.

How to setup Frontend

  1. After the backend server is up and running, open a new command prompt.
  2. cd frontend to go into the frontend folder.
  3. yarn install to install npm.
  4. Create a .env file to establish the backend URL for the frontend. By default, it should look like this:
    PUBLIC_BACKEND_URL="http://127.0.0.1:5000"
  5. yarn dev to start the frontend.

Now the application should be running at http://localhost:5173/.

book_summary's People

Contributors

therealmiketv avatar sparkier avatar js357 avatar researchdaniel avatar onc avatar

Stargazers

 avatar

Watchers

 avatar  avatar  avatar

book_summary's Issues

Editable images

Make it possible to edit images.

For the start maybe just through a button that toggles regeneration, long term possibly by prompting

Use EventSource for sending updates instead of polling

Should use EventSource for sending updates instead of polling.
Also, the current solution will only work when a single user is connected and a single book is being processed, but that might be too much work to fix.

The BookSummarized class should be refactored to ensure that the state is consistent across calls to summarize_book.

Originally posted by @ResearchDaniel in #37 (review)

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.