Giter Club home page Giter Club logo

gpt-epub-chatbot's Introduction

Readme | 说明

Installation

1 In the console, run: pip install -r requirements.txt

2. In the project path, open the console and run: flask run

3. Open http://127.0.0.1:5000 in your browser

How the Program Works

This tool is an e-book parsing and conversation tool based on ChatGPT. It includes a simple GUI conversation interface implemented using Flask, and a web interface for parsing e-books:

1 Upon first opening the interface, the user needs to enter their OpenAI API Key. The program will save it in a cookie and provide a way for the user to delete the key. The program calls OpenAI's function to validate the API Key's effectiveness, ensuring it's usable.

2 With a valid API Key, the epub file upload button becomes visible. Users can click the button or drag and drop an epub file onto the GUI interface. The program will upload the file to the "uploads" folder. Subsequently, the program will perform the following tasks in sequence: extract content from the entire book, perform recursive summarization, and compute text-embeddings. This process generates a csv file with the same name as the uploaded file, storing summarized content, and a *_embedding.csv file, storing text-embedding values. After this process is completed, the program can be used to engage in conversations surrounding the details and main ideas of the book.

3 At this point, users can enter any text in the input box at the bottom of the interface. The program calls the process_input function in the background to traverse all csv files in the "uploads" folder and analyze the entered text. It retrieves background text as answer material based on similarity, calls the OpenAI API to generate an answer, and returns it to the GUI interface.

4 Conversation records can be downloaded by clicking the link on the interface.

5 The program does not yet implement the memory feature. 效果示意

gpt-epub-chatbot's People

Contributors

waynia avatar

Stargazers

 avatar  avatar Vila avatar

Watchers

 avatar

gpt-epub-chatbot's Issues

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.