In this group project for my NLP class, I developed and programmed a summarizer and quiz generator using the OpenAI API. The summarizer extracted relevant and key information from the course textbook and displayed it on a website. I collaborated with the team to design the interface using Figma and set up the backend using Flask to handle API calls. The summaries were then presented in a static format on the web.
The home page of the LIGN 167 website, featuring an introduction to Deep Learning for Natural Language Understanding, weekly course summaries, interactive quizzes, and a coding challenge section to support student learning.
The summarizer initially read PDF images of the course text book, which we had to manually specify which pages to process. Using these images, the OpenAI API extracted important information and condensed it into a simpler format that high-school students could easily understand.
Week 7 content on Transformers in Natural Language Processing (NLP). The page simplifies key concepts such as self-attention, autoregressive generation, and transformer-based language models for students. A “Quiz” button at the bottom allows students to generate questions based on the summary provided, helping reinforce their understanding.
After generating the summaries, the quiz generator used them to create questions through the OpenAI API. The API was effective at creating thoughtful and meaningful questions, but frequently generated duplicate questions. To address this, I implemented prompt engineering techniques, a uniqueness check, and rejection sampling, which significantly reduced duplicate questions. I also found that generating one question per API call, instead of all at once, led to more unique and insightful questions.
This image displays questions generated by the OpenAI API based on the summary of the Transformer topic. The questions are designed to help students review key concepts and deepen their understanding of transformer-based language models in natural language processing.
Integrating the frontend and backend to display the generated questions was another challenge. I used Flask to manage the communication between the two. As Flask was new to me, I used GPT-4 to assist with some of the development. Though it was helpful for debugging and guiding me through the process, I had to step in and manually complete the integration. In the end, we successfully built a dynamic interface where students could answer free-text and coding questions, with the API providing feedback on correct and incorrect responses.
This image displays coding questions from the course, where students fill in missing parts of the Python code. Once the “Submit” button is clicked, the OpenAI API evaluates the answers and provides feedback, helping students learn and correct their mistakes.