A programming course without one standard answer: encouraging students to ask AI for help.
With appropriate adjustments to course design and assessment criteria, we do not need to block or fear students using AI for assignments. We can help them learn better with it.
This semester, I adjusted my introductory programming course to incorporate an LLM Python API. Across the units, students use my examples as starting points, find their own data to replace the example data, modify the relevant code, ask questions about their own datasets, and answer those questions through programmatic analysis.
Each small task can connect into a small project, allowing every student to create a collection of their own work.
1. Learn data types through dataframes and sets: read a CSV into a dataframe, convert it into sets, and explore the data through intersections, unions, and differences.
2. Learn file formats through CSV and JSON: read a CSV into a dataframe and JSON into a dictionary, ask three questions about the data, and use Plotly to create visualizations that answer those questions.
4. Use requests to retrieve website HTML, parse its contents with BeautifulSoup, extract the relevant text into a dataframe, and export it to Google Sheets.
5. Continue with the text stored in Google Sheets in step 4, including authors and posts. Use regular expressions for basic cleaning, then jeiba for word segmentation to identify each author's ten leading keywords. Build a graph linking authors and keywords and visualize it with NetworkX.
6. Starting from step 5, replace the jeiba segmentation component with HuggingFaceHub. Send each Google Sheets post to Breeze-7B for summarization, sentiment analysis, and selection of key features, then redraw the relationship graph.
7. Integrate steps 1–6 into a complete modular package and add a Gradio web interface to turn it into the final project.
Here is my example code for step 5: https://colab.research.google.com/drive/1mmSci4Sf1AUzrrutHbNk2KwNjvxteLzs?authuser=2
I will share the example for step 6 next week.
The course combines practical programming skills and open-source Python packages to help students develop the following abilities:
1. Understanding data structures and types: working with dataframes and sets helps students understand why data structures matter and how to manipulate them to explore data.
2. File formats and data processing: handling formats such as CSV and JSON teaches students to read, process, and analyze data.
3. Visualization: creating charts with Plotly helps students turn complex datasets into understandable representations.
4. Web data collection and analysis: requests and BeautifulSoup introduce automated collection and preliminary processing of online data.
5. Natural language processing basics: jeiba and Hugging Face introduce basic text processing and ways to work with open-source AI packages.
6. Graph theory and visualization: NetworkX teaches students to construct and visualize complex networks, skills relevant to social network analysis, recommender systems, and other fields.
7. Modularization and minimum viable project development: integrating units into a modular package and building a Gradio interface introduces software engineering principles important for maintainable, extensible systems.
8. Practical application and creative thinking: students are encouraged to think creatively and apply what they learn to real problems, developing problem-solving ability and creativity.
#PecuLab #臺師大科技系
