GithubHelp home page GithubHelp logo

snoopycn / antilibrary Goto Github PK

View Code? Open in Web Editor NEW

This project forked from team-watchdog/antilibrary

0.0 0.0 0.0 2.13 MB

A little tool that lets you ask questions from your pdfs, epubs, text files and word documents.

License: Apache License 2.0

Jupyter Notebook 100.00%

antilibrary's Introduction

antilibrary

A little tool that lets you ask questions from your pdfs, epubs, text files and word documents. Think Chatpdf.com or Box AI.

Available as a notebook that launches a simple web app with a UI. Uses langchain and gradio for much of the heavy lifting.

enter image description here

How to use

Grab Antilibrary-OpenAI.ipynb . Save it anywhere and create a folder named books - that's where you should put your files. [*] Antilibrary can currently take PDF, DOC, DOCX, TXT, MD and EPUB.

You'll need an OpenAI API key. In the .ipynb notebook, you'll see OPENAI_API_KEY = "your openai api key goes here" - that's where the key goes.

Once the key is in, run each section of the notebook. The last section will open up an interface at the bottom. You can either open the UI in a separate browser tab, or use it directly in the notebook.

Antilibrary will read your documents and generate embeddings for them. It will then use these embeddings to search for information relevant to your question, and pass this information to OpenAI to generate the response you see. If you add new documents while the program is running, hit the Scan the library again button.

Here's a diagram,

graph LR
A[You] --your question---> B(Embedded text ie: the antilibrary)
B --relevant text--> D{OpenAI}
A --your question--> D
D --the response--> A

Loading

I build this to explore langchain, so the current version may have a few unresolved dependencies (small fixes).

[*] if you're running in a Google Collab, you can replace /books with a Drive folder of your choice.

To-do

  1. Clean up dependencies
  2. Fully local version using llama.cpp
  3. Add mobi and csv support

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.