Giter Site home page Giter Site logo

gemma-classification's Introduction

! Note. Currently we are now using Meta's LLaMA 3 to classify questions and summarize transcripts. It is found here

Categorization and Summarization of Transcript API

This is a simple API that categorizes and summarizes a given text. The API is built using Flask. Categorization is done using a fine-tuned GEMMA model and summarization is done using a Huggingface T5 model.

Requirements

Install the required packages using the following command: pip install -r requirements.txt

Install Gemma by cloning it in the same directory as this repository. The Gemma repository can be found here

git clone https://github.com/google/gemma_pytorch.git

Running the API

To run the API, use the following command: python app.py

The API will be running on http://localhost:5002 by default.

Sample request for categorization

curl -X POST -H "Content-Type: application/json" -d '{"question":"What is the square root of 5?"}' http://localhost:5002/categorize

Note: This does better if you include more context (previous sentences) in the question. For example, "Okay, we have learned about the Pythagorean theorem. What is the square root of 5?"

Sample response for categorization

{"response":1} (signifying this is a level 1 question, according to Costa's levels of questioning)

Sample request for summarization

curl localhost:5002/summarize -X POST -H "Content-Type: application/json" -d '{"text":"The quick brown fox jumps over the lazy dog."}'

Sample response for summarization

{"response":"The quick brown fox jumps over the lazy dog. This is 'a classroom transcript,' where I am to sum up what the teachers are teaching."}

Healthcheck

curl localhost:5002/healthcheck

Return

{"status": "ok"}

gemma-classification's People

Contributors

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