GithubHelp home page GithubHelp logo

simple-summarization's Introduction

Simple Summarization API using OpenAI and ๐Ÿฆœ

This application prepares coherent and concise summaries for .txt files.

How It Works

system

Users upload .txt documents through the /upload endpoint. Upon receiving a document, the application:

  1. Splits the document into manageable segments.
  2. Processes each segment through a pipeline that utilizes LangChain ๐Ÿฆœ and the OpenAI API, generating summaries for each segment.
  3. Combines these summaries into a final document that captures the essence of the original text.

Limitations

  • OpenAI API Dependence: The functionality of this application depends on the availability and responsiveness of the OpenAI API. Downtime or rate limits imposed by the API will directly affect the application's performance.
  • Non-scalable: This application is intended to be used by only one user simultaneously.
  • Language Support: The application can process documents in any language supported by GPT-4, but the output summaries are provided exclusively in English.
  • Document Length: The application is designed to reject documents that are too short (less than 100 symbols) as summarizing a single sentence or very brief documents generally does not provide value. Similarly, excessively long documents may be truncated or rejected to prevent abuse and ensure compliance with OpenAI API limitations (up to 100,000 symbols).

Building Locally [Development Only]

To set up and run the application on your local machine, follow these steps:

  1. Install Dependencies: Execute the following command:

    pip install -r requirements.txt
  2. Environment Variables: Write your OPENAI_API_KEY to the .env.

  3. Run the Application:

uvicorn app.main:app --reload

This command starts a local development server. Access the application by navigating to http://localhost:8000 in your web browser.

Deploying on Render [Production]

To deploy the application on Render.com, a Dockerfile is prepared. Follow these steps:

  1. Create a New Web Service on Render:
  • Log into your Render account and select "New Web Service".
  • Connect it to this GitHub repository.
  1. Set environment variable OPENAI_API_KEY in the Render service settings.

  2. Enjoy the app using the link provided by Render.

Testing

Simply run the following command to test the deployed solution:

python testing/test.py

simple-summarization's People

Contributors

angusev 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.