Code Monkey home page Code Monkey logo

autoquizzer's Introduction

title emoji colorFrom colorTo sdk sdk_version app_file header pinned short_description models
AutoQuizzer
๐Ÿง‘โ€๐Ÿซ
purple
blue
gradio
4.31.1
app.py
mini
true
Generate a quiz, play or let ๐Ÿฆ™ LLM play
meta-llama/Meta-Llama-3-8B-Instruct

๐Ÿง‘โ€๐Ÿซ AutoQuizzer ย  HF Space

Generates a quiz from a URL. You can play the quiz, or let the LLM play it.

Built using: ๐Ÿ—๏ธ Haystack โ€ข ๐Ÿฆ™ Llama 3 8B Instruct โ€ข โšก Groq

How does it work?

๐ŸŽฌ Project walkthrough video

AutoQuizzer

  • Quiz generation Pipeline: downloads HTML content from the URL, extracts the text and passes it to Llama 3 to generate a quiz in JSON format.
  • You can play the quiz and get a score.
  • You can let Llama 3 play the quiz:
    • closed book answer Pipeline: the LLM is provided given the general quiz topic and questions. It can answer the questions based on its parametric knowledge and reasoning abilities.
    • Web RAG answer Pipeline: for each question, a Google search is performed and the top 3 snippets are included in the prompt for the LLM.

How to run it locally?

  • Clone the repo: git clone https://github.com/anakin87/autoquizzer
  • Install: cd autoquizzer && pip install -r requirements.txt
  • Export two environment variables:
    • GROQ_API_KEY: API key for the Groq API, used to serve Llama 3.
    • SERPERDEV_API_KEY: API key for the SerperDev API, used to fetch search results.
  • Run the webapp: gradio app.py

Customization and potential improvements

  • To not exceed the rate limits of Groq's free API, we truncate the text extracted from the URL to 4000 characters. This means that the generated quiz focuses on the beginning of the text. You can increase/remove this limit, taking into account the maximum context length of the model.
  • We are using the OpenAIGenerator to query Llama 3 on Groq. You can use an OpenAI model with the same generator. You can also use a different generator (Haystack generators).
  • In the quiz generation pipeline, we ask the model to generate a JSON. Llama-3-8B-Instruct usually works. You can also create a more robust JSON generation pipeline, as shown in this tutorial: Generating Structured Output with Loop-Based Auto-Correction.

autoquizzer's People

Contributors

anakin87 avatar tuanacelik avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

autoquizzer's Issues

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.