wongcyrus / AzureOpenAIChatGTPAutoGrader

AutoGrader with Azure OpenAI

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

AzureOpenAIChatGTPAutoGrader

AutoGrader: A Notebook for Automatic Grading of Moodle Assignments with Azure OpenAI

moodle_word_pdf.ipynb

moodle_word_pdf.ipynb notebook can grade students’ assignments automatically by downloading them from Moodle LMS. It will unzip the assignment file from Moodle and create a folder for each student. If a student submits a zip file, it will also unzip it in their folder. The folder should contain either some Docx files or one PDF file. For Docx files, the notebook will extract and merge all the texts into one answer. For PDF files, it will only extract the text from the first page as the answer.

The notebook will then use a marking scheme as prompts and let Azure OpenAI ChatGPT evaluate the answer according to the rules. It will also estimate the probability that the answer is copied from the internet or generated by AI.

The notebook will use Azure OpenAI text-embedding-ada-002 to get the embedding of the answer. It will then use K-means clustering to group the answers based on their embeddings and show the teachers the different types of answers. It will also perform PCA on the embeddings and plot the first three principal components in 3D. This will help the teachers see how similar or different the answers are.

How to use moodle_word_pdf.ipynb

  1. Make a copy of this repository and create a new Codespace.
  2. Save your assignment from Moodle as submission.zip
  3. Move it to the “data” folder.
  4. Change the name of .env.template to .env.
  5. Enter your Azure OpenAI Endpoint and API key.
  6. Execute the entire notebook.
  7. Download final.xlsx.

About

AutoGrader with Azure OpenAI

License:MIT License


Languages

Language:Jupyter Notebook 100.0%