Giter Club home page Giter Club logo

text-summary-api's Introduction

Simple Text Summarization API

HTTP REST service for text summarization. Build with Flask, MySQL, and Hugging Face Transformers.

Why?

  • The goal was to have a working application that could be build on top of.
  • To practice creating a small system that utilizes Flask, MySQL, and Machine learning
  • Learning/Practice

API

There are two endpoints of interest:

/api/v1/summarize

This will summarize text and store it. Returns a json object with the following:

{ 
  summary_id=summary_id, 
  summary=text_summary
}

content-type: application/x-www-form-urlencoded

POST parameters: text, where text is the text to be summarized.

/api/v1/get_summary

Retrieve the text data using summary_id. Returns a Json object with the following:

{
  long_text=long_text, 
  text_summary=text_summary
}

where long_text is the original text and text_summary is the summarized text. Parameters content-type: application/json POST parameters: summary_id, the PRIMARY KEY ID of the summarized text.

Running the application

The app runs on Flask, with MySQL as a database to store text summaries. Further, the app has been containerized using Docker and docker-compose.

To run:

sudo docker-compose up

and then navigate to http://0.0.0.0:5000/ in a browser.

This brings up a small webpage that makes use of the summary API. The webpage is intended to just showcase how the endpoints work, and to test summarizing text.

alt text

Running without Docker/docker-compose

If you do not have docker-compose installed, or are unfamiliar with it, one could also do the following:

  • using any python environment, install requirements.txt
  • initialize a database summary using MySQL, and run ./db/init.sql
  • update local MySQL credentials in ./app/backend/database/connector.py:
  • run python wsgi.py
  • navigate to http://0.0.0.0:5000/

text-summary-api's People

Watchers

Eric Narciso Molina 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.