How OpenAI API Transformed Word Learning: A Fun and Efficient Way for 5th Grade Students and Parents.
As a parent of a 5th grade student, my child has weekly homework on spelling and word memorization. Typically, her mom creates flashcards with the word on one side and the meaning and word root on the other. While it has been effective, it can be tedious and un-engaging for kids. From what I remember, textbooks often provide articles that feature new words to help comprehension. Is it possible to find more articles that not only teach new words but also engage readers with enjoyable storytelling??This not only makes learning more enjoyable for students but also saves time for working parents.
Definitely a new weapon here is chatGPT.?We input the word list into the chatGPT, ask to?generate a table with the word meaning and its root first. Additionally, ask chatGPT to generate two short articles, each containing up to 500 words, in either Sci-Fi or Fantasy genre that incorporated all of the assigned words. I specifically requested that ChatGPT review the generated content to ensure its appropriateness for a 5th grade student, and as a parent, I also reviewed it before sharing with my child. I was impressed with the quality of the generated content, which was not only imaginative and entertaining but also logically sound. There is a high likelihood that anyone who reads both of the articles will be able to memorize all of the words.
To streamline the process, together with my kid, (she is also learning some basic Python coding recent months), we created a small pipeline that allows us to implement the features from the word list input, OpenAI API calling, and use LaTeX as a template. Furthermore, all of the assigned words were highlighted by setting them to bold in the article. The final rendered Latex file is been published as a PDF file.?
Bellow are some scripts with "prompts" we used:
1. Prepare word list table
word_list_str = ",".join(my_word_list)
word_list_question = "Please generate a Latex formatted table for these words: " + word_list_str + ", including three columns, 'word', 'meaning', 'word root' in latex format with width ratio 0.3, 0.4 and 0.3 respectively, rows are sepearated by line. Please only return the Latex content, nothing else."
word_list_table = chat(word_list_question)
2. Generate articles in two genres
领英推荐
scifi_article_prompt = "now you are sci-fi fiction writer for youth, please use all these words: " + word_list_str + ", write one article within 500 words. This article should include all these words. Make sure the content is safe for youth. Please inlcude a title at the beginning, bold it, no other content except the title and content. Article should NOT include any URL."
scifi_article = chat(scifi_article_prompt)
......
3. highlighted words in the article
# bold words
for word in my_word_list:
scifi_article = scifi_article.replace(word, "\\textbf{" + word + "}")
fantasy_article = fantasy_article.replace(word, "\\textbf{" + word + "}")
......
4. render by Latex and publish to pdf
write_to_latex(word_list_table, scifi_article, fantasy_article)
Anytime press the button, you will get a totally two new stories, in both Sci-Fi and Fantasy styles. All these steps to build this mini pipeline are finished in about 2 hours, including the prompt tuning and Latex template preparations.
Starting today, I simply need to compile the word list and with the click of a single button, generate a PDF document. In future, incorporating illustrations (Clip Art images) into the generated articles could provide additional visual benefits.
Note:
To test/triage and tuning prompts and scripts, totally called my personal openAI 56 times, per OpenAI API usage portal, costed total 8 cents. In future, for each PDF generation, it only needs 3 API requests which should cost less than half cent.