Hands-on – building quizzes in PITS
One of the features we are building in our PITS project is the ability to generate quizzes based on the learning material uploaded by the user.
These quizzes will initially be used to gauge the overall knowledge of the user on the topic. Based on that assessment, the training slides and narration will be adjusted to the level of the learner.
The same mechanism can also be used to generate intermediate quizzes at the end of each section to test the user’s current knowledge. Let’s see how we can easily implement the quiz builder feature.
We’ll be using one of the LlamaIndex pre-packaged pydantic programs: the DataFrame Pydantic extractor. This is designed to extract tabular DataFrames from raw text.
Let’s have a look at the code in quiz_builder.py
:
from llama_index.core import load_index_from_storage, StorageContext from llama_index.program.evaporate.df import DFRowsProgram from llama_index.program...