Skip to main content

A Python package for generating educational content using Generative AI

Project description

educhain

A Python package for generating educational content using Generative AI. Educhain makes it easy to apply Generative AI in various educational use cases to create engaging and personalized learning experiences

Installation

pip install educhain

Usage

Use it to Generate MCQs

Open In Colab

Here's an example of how to use EduChain:

Generate a multiple-choice question with given number of questions

from educhain import generate_mcq, to_csv, to_json, to_pdf

generate_mcq function

The generate_mcq function takes the following arguments:

  • topic (str): The topic for which you want to generate MCQs.
  • level (str): The difficulty level of the MCQs (e.g., "Beginner", "Intermediate", "Advanced").
  • num (int, optional): The number of MCQs to generate. Defaults to 1.
  • llm (LLM, optional): An instance of a language model from the langchain library. If not provided, the function will use the ChatOpenAI model with the "gpt-3.5-turbo-0125" version.
  • topic (str): The topic for which you want to generate MCQs.
  • level (str): The difficulty level of the MCQs (e.g., "Beginner", "Intermediate", "Advanced").
  • num (int, optional): The number of MCQs to generate. Defaults to 1.
  • llm (LLM, optional): An instance of a language model from the langchain library. If not provided, the function will use the ChatOpenAI model with the "gpt-3.5-turbo-0125" version.

The function returns an instance of the MCQList class, which is a custom class defined in the library. It contains a list of Question objects, each representing a single MCQ.

mcq = generate_mcq(topic="Python", level="Advanced", num=5)
print(mcq)

Save the MCQ to a CSV file

Save the MCQ to a CSV file

to_csv(mcq, "mcq.csv")

Save the MCQ to a JSON file

to_json(mcq, "mcq.json")

Save the MCQ to a PDF file

  • heading (str): (optional)
  • subheading (str): (optional)
to_pdf(mcq, "mcq.pdf", heading="Python MCQ", subheading="Advanced Level - (10 Questions)")

Effortlessly create Lesson Plans

from educhain import content_engine

topic = "Medieval History"
level = "Beginner"

lesson_plan = content_engine.generate_lesson_plan(topic, level)
print(lesson_plan)

Contributing

Contributions are welcome! Please open an issue or submit a pull request on the GitHub repository.

Next Steps

Will be releasing more features for MCQ Generation

  • Bulk Generation
  • Outputs in JSON format
  • Export questions to CSV
  • Exports questions to JSON
  • Exports questions to PDF
  • Support for other LLM models
  • Generate questions from text/pdf file
  • Finetuned Model for question generation

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

educhain-0.1.7.tar.gz (5.6 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

educhain-0.1.7-py3-none-any.whl (6.7 kB view details)

Uploaded Python 3

File details

Details for the file educhain-0.1.7.tar.gz.

File metadata

  • Download URL: educhain-0.1.7.tar.gz
  • Upload date:
  • Size: 5.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.8.0 pkginfo/1.9.6 readme-renderer/40.0 requests/2.31.0 requests-toolbelt/1.0.0 urllib3/1.26.18 tqdm/4.66.1 importlib-metadata/6.8.0 keyring/24.0.1 rfc3986/1.5.0 colorama/0.4.6 CPython/3.10.14

File hashes

Hashes for educhain-0.1.7.tar.gz
Algorithm Hash digest
SHA256 26130978a12f4ccc1bbc81538cf6ae5fe0279136c4d6e5c7653ad954eaaeed7d
MD5 31e4863a604dd39544042b4557f2fe3c
BLAKE2b-256 053978cc4169c0aef8934a6b6b4aa92aec6abbda19066aafc16e625483d50de3

See more details on using hashes here.

File details

Details for the file educhain-0.1.7-py3-none-any.whl.

File metadata

  • Download URL: educhain-0.1.7-py3-none-any.whl
  • Upload date:
  • Size: 6.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.8.0 pkginfo/1.9.6 readme-renderer/40.0 requests/2.31.0 requests-toolbelt/1.0.0 urllib3/1.26.18 tqdm/4.66.1 importlib-metadata/6.8.0 keyring/24.0.1 rfc3986/1.5.0 colorama/0.4.6 CPython/3.10.14

File hashes

Hashes for educhain-0.1.7-py3-none-any.whl
Algorithm Hash digest
SHA256 badb7b163995b8ce68e3ba57c57640390ee3d65ea1024f290bd2a53caf5e477d
MD5 31bc1989285aca93d1c736dd5b7772ff
BLAKE2b-256 88f8d82729297ededa0f136df35dd2a5797a972144b08e6de1abf48106c46950

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page