Coder Social home page Coder Social logo

zhorifiandi / tajong.ai Goto Github PK

View Code? Open in Web Editor NEW

This project forked from geraldzakwan/tajong.ai

0.0 1.0 0.0 32.17 MB

"Hafalin" app repository, a web app that could automatically generate academic questions (multiple choice and short answer) given a document in Indonesian, e.g. elementary school history lesson. Submitted for a Hackathon competition held by Kata.ai. More on it in https://blog.kata.ai/en/post/katahack-2-0-2/.

License: MIT License

Python 100.00%

tajong.ai's Introduction

Tajong.ai

A web app that could automatically generate academic questions (multiple choice and short answer) given a document in Indonesian, for example, an elementary school history lesson. Submitted for a Hackathon competition held by Kata.ai. More on the competition: https://blog.kata.ai/en/post/katahack-2-0-2/.

How to Run

  • Install all requirements

    pip install -r requirements.txt

  • Run the web app

    python3 app.py

How to use API

  • Example Request using POST JSON
curl --location --request POST 'https://hafalin.herokuapp.com/generate_question/' \
--header 'Content-Type: application/json' \
--data-raw '{
    "document": "Roro, Guntur, dan Kanguru baru saja selesai melakukan karya wisata ke Sumatera Barat yang terletak di Pulau Sumatera. Pulau ini berbatasan dengan Teluk Benggala pada sebelah utara, Selat Sunda pada sebelah selatan, Samudera Hindia pada sebelah barat, dan Selat Malaka pada sebelah timur. Sebelum pulang, supir bus sengaja membawa mereka mampir ke Pelabuhan Teluk Bayur yang merupakan salah satu dari lima pelabuhan terbesar dan tersibuk di Indonesia. Mereka juga melewati Provinsi Bengkulu, Sumatera Selatan, dan Lampung karena searah dengan jalan pulang menuju Jakarta.",
    "type": "all",
    "max_questions": 5
}'
  • Example Response in JSON
{
    "data": {
        "multiple_choice": [
            {
                "answer": "b",
                "choices": {
                    "a": "Jakarta",
                    "b": "Teluk Benggala",
                    "c": "Bengkulu",
                    "d": "Selat Malaka",
                    "e": "Selat Sunda"
                },
                "question": " Pulau ini berbatasan dengan  ...  pada sebelah utara, Selat Sunda pada sebelah selatan, Samudera Hindia pada sebelah barat, dan Selat Malaka pada sebelah timur"
            },
            {
                "answer": "c",
                "choices": {
                    "a": "Sumatera Selatan",
                    "b": "Sumatera Barat",
                    "c": "Selat Sunda",
                    "d": "Selat Sunda",
                    "e": "Selat Malaka"
                },
                "question": " Pulau ini berbatasan dengan Teluk Benggala pada sebelah utara,  ...  pada sebelah selatan, Samudera Hindia pada sebelah barat, dan Selat Malaka pada sebelah timur"
            },
            {
                "answer": "d",
                "choices": {
                    "a": "Bengkulu",
                    "b": "Sumatera Barat",
                    "c": "Indonesia",
                    "d": "Selat Malaka",
                    "e": "Jakarta"
                },
                "question": " Pulau ini berbatasan dengan Teluk Benggala pada sebelah utara, Selat Sunda pada sebelah selatan, Samudera Hindia pada sebelah barat, dan  ...  pada sebelah timur"
            },
            {
                "answer": "e",
                "choices": {
                    "a": "Sumatera Selatan",
                    "b": "Pulau Sumatera",
                    "c": "Teluk Benggala",
                    "d": "Bengkulu",
                    "e": "Pelabuhan Teluk Bayur"
                },
                "question": " Sebelum pulang, supir bus sengaja membawa mereka mampir ke  ...  yang merupakan salah satu dari lima pelabuhan terbesar dan tersibuk di Indonesia"
            },
            {
                "answer": "e",
                "choices": {
                    "a": "Bengkulu",
                    "b": "Pulau Sumatera",
                    "c": "Teluk Benggala",
                    "d": "Selat Malaka",
                    "e": "Indonesia"
                },
                "question": " Sebelum pulang, supir bus sengaja membawa mereka mampir ke Pelabuhan Teluk Bayur yang merupakan salah satu dari lima pelabuhan terbesar dan tersibuk di ..."
            },
            {
                "answer": "b",
                "choices": {
                    "a": "Jakarta",
                    "b": "Bengkulu",
                    "c": "Indonesia",
                    "d": "Sumatera Selatan",
                    "e": "Teluk Benggala"
                },
                "question": " Mereka juga melewati Provinsi  ... , Sumatera Selatan, dan Lampung karena searah dengan jalan pulang menuju Jakarta"
            }
        ],
        "short_answer": [
            {
                "answer": [
                    "Roro"
                ],
                "question": "... , Guntur, dan Kanguru baru saja selesai melakukan karya wisata ke Sumatera Barat yang terletak di Pulau Sumatera"
            },
            {
                "answer": [
                    "Sumatera Barat"
                ],
                "question": "Roro, Guntur, dan Kanguru baru saja selesai melakukan karya wisata ke  ...  yang terletak di Pulau Sumatera"
            },
            {
                "answer": [
                    "Pulau Sumatera"
                ],
                "question": "Roro, Guntur, dan Kanguru baru saja selesai melakukan karya wisata ke Sumatera Barat yang terletak di ..."
            },
            {
                "answer": [
                    "Teluk Benggala"
                ],
                "question": " Pulau ini berbatasan dengan  ...  pada sebelah utara, Selat Sunda pada sebelah selatan, Samudera Hindia pada sebelah barat, dan Selat Malaka pada sebelah timur"
            },
            {
                "answer": [
                    "Selat Sunda"
                ],
                "question": " Pulau ini berbatasan dengan Teluk Benggala pada sebelah utara,  ...  pada sebelah selatan, Samudera Hindia pada sebelah barat, dan Selat Malaka pada sebelah timur"
            },
            {
                "answer": [
                    "Selat Malaka"
                ],
                "question": " Pulau ini berbatasan dengan Teluk Benggala pada sebelah utara, Selat Sunda pada sebelah selatan, Samudera Hindia pada sebelah barat, dan  ...  pada sebelah timur"
            }
        ]
    }
}

tajong.ai's People

Contributors

geraldzakwan avatar zhorifiandi avatar

Watchers

James Cloos 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.