CS 124: From Languages to Information

Dan Jurafsky
Winter 2023

The online world has a vast array of unstructured information in the form of language and social networks. Learn how to make sense of it using neural networks and other machine learning tools, and how to interact with humans via language, from answering questions to giving advice!

Schedule

Schedule

Week Date Homework Quiz In-class Video Lectures and Readings (to be done by the Monday of the week unless I specify another date)
1 Jan 10, 12

PA 0: Setup and Tutorial

Due Fri Jan 13, 5:00pm (Ungraded/optional for those who haven't done Jupyter before; we'll go over this in Thursday Jan 12's in-person tutorial )

-
  • Tue Jan 10: In-person Lecture: Intro

  • Thurs Jan 12: In-person tutorial: Jupyter notebooks
2 Jan 17 and 19

PA 1: Spamlord

Due Fri Jan 20, 5:00pm

Quiz 1: Text Processing/Edit Distance

Due Tue Jan 24, 11:59pm

    Thur Jan 26: In-person Tutorial: NumPy (Optional)
  • Basic Text Processing Canvas Videos (watch videos before Mon Jan 16)
  • Edit Distance Canvas Videos (watch videos before Mon Jan 16)
    3 Jan 24 and 26

    PA 2: Naive Bayes and Sentiment Analysis!

    Due Fri Jan 27, 5:00pm

    Quiz 2: Language Modeling/Naive Bayes

    Due Tuesday Jan 24, 11:59pm

      Tue Jan 24: Group Work 2: Naive Bayes and Sentiment Analysis
      (watch NB videos beforehand)
      (don't look at the solution until you've completed all the questions!)


      Thu Jan 26: No class: extra in-person office hours during class time in classroom


    Language Modeling Canvas Videos (watch before Monday Jan 23)
    Naive Bayes and Text Classification Canvas Videos (watch before Monday Jan 23)
  • J+M (3ed) Chapter 4, "Naive Bayes and Sentiment Classification" pages 1-14 plus page 18, sections 4.1 through 4.8 and 4.10.
  • 4 Jan 31 and Feb 2

    PA 3: Logistic Regression!

    Due Fri Feb 3, 5:00pm

    Quiz 3: Logistic Regression

    Due Tuesday Feb 7, 11:59pm

      Tuesday: No class: extra in-person office hours during class time in 420-040


      Thursday: No class: extra in-person office hours during class time in 420-040


      Logistic Regression Canvas Videos (watch/read before Mon Jan 30)
    5 Feb 7 and 9

    PA 4: Information Retrieval

    Due Fri Feb 10, 5:00pm

    Quiz 4: Information Retrieval

    Due Tuesday Feb 14, 11:59pm

    • Tuesday: Group Work 3: Information Retrieval


      • Thursday: No class: extra in-person office hours during class time in 420-040
    Chris Manning Canvas Video: Information Retrieval (I) (watch/read before Monday Feb 6)
    • MR+S Chapter 1: Boolean Retrieval (pages 1-17)
    • MR+S Chapter 2: Term vocabulary and postings lists (only pages 33-42)
    Chris Manning Canvas Video: Information Retrieval (II) (watch/read before Monday Feb 6) [slides pptx] [slides pdf]
    • MR+S Chapter 6: Scoring, term weighting, and the vector space model, (only pages 100 and 107-116)
    • MR+S Chapter 8: Evaluation in Information Retrieval (only pages 139-149)
    6 Feb 14 and 16

    PA 5: Embeddings and Vector Semantics

    Due Tue Feb 21, 5:00pm

    Quiz 5: Vector Semantics and Sequence Labelling

    Due Fri Feb 24, 11:59pm

    Tuesday: Review for First Midterm (online)

    Thursday: First Midterm (online)




    • Vector Semantics and Embeddings Canvas Videos
    • Parts of Speech and Named Entities Canvas Videos
    7 Feb 21 and 23

    PA 6: Neural Networks

    Due next week! Tues Feb 28, 5:00pm

    Quiz 6: Neural Networks

    Due Fri Feb 24, 11:59pm. Not next Tuesday!!!

    Tuesday Group Work 4: Large Language Models

    Thurs No class: extra in-person office hours during class time in classroom

    • Neural Networks Video
    8 Feb 28 and Mar 2

    PA 7: Chatbot

    Due Fri Mar 10, 5:00pm

    Quiz 6: Chatbots

    Due Fri Mar 3, 11:59pm

    Tues: No class: extra in-person office hours during class time in classroom

    In-person walkthrough of PA7, plus a tutorial on Git and Team Coding

    • Chat Bot Videos (watch by Thursday Mar 2)
    Recommender systems and Collaborative Filtering Canvas videos (watch by Monday Mar 6)

    Additional (optional) reading for those looking for more on this topic!:
    9 Mar 7 and 9

    Reminder: PA 7: Chatbot due Fri Mar 10, 5:00pm

    Quiz 7: Recommendation Systems

    Due Tues Mar 7, 11:59pm

    Tuesday Group Work 5: Smartphone Chatbots






    Thursday: Live Lecture: NLP for Social Good

    Web graphs, Links, and PageRank (watch by Mon Mar 13)
    • MR+S Chapter 21: Link Analysis, just pages 421-433 (Skip section 21.3 and 21.4)
    Social Networks Canvas Videos (watch by Mon Mar 13)
    10 Mar 14 and 16

    Quiz 8: Pagerank and Networks

    Due Tues Mar 14, 11:59pm

    Tuesday: Review for Second Midterm (online)


    Thursday: Second Midterm (online)

    Logistics

    Instructor
    Dan Jurafsky (jurafsky@stanford.edu)
    Office: Margaret Jacks 117
    Office Hours: For the first 4 weeks this quarter, I'm going to try an experiment with individual one-at-a-time in-person office hours, where we take walks outside. It will be right after class on Tuesdays 4:30-5:45, and let's try starting outside my office, which is Margaret Jacks 117!
    Teaching Assistants
      TBD

    TA Office Hours
    • Tuesdays 12:00noon to 1:30pm
    • Wednesdays 7:00pm to 10:00pm
    • Fridays 1:00-2:30pm
    • Plus: extra in person office hours on 6 Thursdays in 420-040 during class timeslot 3:00-4:20pm: Jan 26, 31, Feb 2, Feb 9, Feb 23, Feb 28.
    Class Time

    Tuesday and Thursday 3:00-4:20

    Attendance

    We require you come to the 2 live lectures and strongly strongly recommend the 5 in-person group works, you will learn more from doing them with other people (I won't require attendance at the group works but I will give extra credit for attending). For any group work in-person class you miss, you must still do them at home yourself. The course can be taken asynchronously only if you have permission from Dan due to a required conflict or medical issue. Also: different people learn better from different combinations of videos/lectures, reading the chapters, coming to the live group exercises in 420-040, and coming to office hours. But I will say that students who do all four tend to do the best on the exams and in the course in general.

    Email

    Alas, we can't reply to email sent to individual staff members. If you have a question that is not confidential or personal, post it on the Ed Discussion forum! Responses are quicker and you'll also be helping others with the same question! To contact the teaching staff directly, come see us in office hours! If that is not possible, you can also email (non-technical questions) to the course staff list, cs124-aut2223-staff@lists.stanford.edu. If you have a matter to be discussed privately, come to office hours or use cs124-aut2223-staff@lists.stanford.edu to make an appointment. For grading questions, please talk to us after class or during office hours.

    Class announcements will be on Ed Discussion (although we will occasionally try Canvas and mailing lists). We will assume that everyone reads all announcements.

    Honor Code

    Since we occasionally reuse homeworks from previous years, we expect students not to copy, refer to, or look at the solutions in preparing their answers. It is an honor code violation to intentionally refer to a previous year's solutions. This applies both to the official solutions and to solutions that you or someone else may have written up in a previous year. It is also an honor code violation to find some way to look at the test set, or to interfere in any way with programming assignment scoring or tampering with the submit script.

    Since quizzes are a form of assessment, students are not allowed to collaborate on completing quizzes. It is an honor code violation to discuss quiz questions with other students.

    Textbooks
    • There is no required textbook, but I'll expect you to know the textbook/reading material listed above, and will test it on the midterms.

    Course Description

    Extracting meaning, information, and structure from human language text, speech, web pages, social networks. Introducing methods (string algorithms, edit distance, language modeling, machine learning, logistic regression, neural networks, neural embeddings, inverted indices, collaborative filtering, PageRank), applications (chatbots, sentiment analysis, information retrieval, text classification, social networks, recommender systems), and ethical issues.

    Prerequisites

    CS106B. CS 107 can be helpful, but is fine if you haven't had it, we'll cover the required UNIX material. Math 51 can also be helpful, but isn't required, since we will introduce the basic vectors knowledge we need in the class.

    Required Work

    From Languages to Information is a flipped class with much of the material online. All the lectures (except the Intro and Outro) have been prerecorded, and you can watch them at home. The weekly quizzes and programming homeworks will be automatically uploaded and graded. Lecture, quizzes, and homeworks are available on Canvas, and, via Canvas, on Gradescope.
    Prerecorded Video Lectures

    Most weeks, we will ask you to watch a set of video lectures (2 to 2.5 hours total). Most videos will have some in-video questions embedded in them, which you should answer. You are required to watch the videos but the embedded quizzes are not counted toward the final grade.

    In class Lectures

    2 lectures will be live, and are required!

    In-class group problem-solving

    5 in-class sessions are for group problem-solving activities. The group works are required and will be tested on the quiz, meaning that if you can't make a particular in-person group work, you must still do the exercises at home instead. Previous students who did well in the class have reported that doing the group exercises in-class have been extremely useful.

    Automated Review Quizzes

    After watching a week's video lectures, we will ask you to answer an open-notes, open-book review quiz (about 5 questions) on the content that you just learned. These quizzes are not timed, they are open book, and they may be attempted an infinite number of times. The questions, as well as the options for each question, are randomly selected from a larger pool each time you take a quiz. You will not see your quiz grade/correct answers until after the due date, but the system will take the the score from the last submission of all your infinitely-allowed submissions for the quiz. So if you worry you might have got something wrong, just submit another one! Review Quizzes for each week are due 11:59pm Tuesday of the following week (except that Quiz 6 and Quiz 7 are due on the Thursday instead of the Tuesday). There are no late days for review quizzes. We will drop your lowest scoring quiz (i.e. we will only count your best 8 of the 9 quizzes in your final grade).

    Class Participation

    You have to watch all lectures, and attendance for the 2 live lectures is required. The group works are required and we will test material from them on the 2 midterms. however, attendance for group work sessions is only strongly recommended; you may do them yourself at home if you really cannot come to class. You can get extra credit for class participation and other things by:: Coming to the 2 live lectures and the 5 group works; helpful answers on the class forum, helping out other students in office hours or group work sessions, being the first person to find typos in the textbook (not counting bugs in figure or chapter numbering), speaking up in the group work sessions. Plus there will be extra credit problems on the two quizzes and also on PA6.

    Programming Assignments

    6 Python programming assignments. PA 1-4 are due at 5:00pm on the Friday it is due; PA5 and PA6 are due on different weekdays, still at 5:00pm.

    Programming Assignment Collaboration for PA 1-5: You may talk to anybody you want about the assignments and bounce ideas off each other. And if you want, you can also choose a partner and do pair programming for PA 1-5. You and your pair-partner can discuss code, but it's important that each of you work on each part of the assignment so that you're comfortable with the whole assignment, since assignments build on each other (and we will test concepts from the assignments on the midterms). If you choose to pair-program, each of you must still submit your own program, and should specify in the submission who your partner is. We will use the normal automatic checks for overlap between your code and other students' code who are not your pair partner.

    Programming Assignment Collaboration for PA 6: PA6 is a group homework that must be done in groups. You will work together with your group, and write code together. Groups must be of size 3 or 4. To work in a group of size 2, you must get special permission from the staff. You cannot work by yourself on PA 6, because part of the goal of this homework is to learn to work on group projects. You must describe in your writeup who worked on which parts of the assignment/code.

    Late homeworks

    You have 4 free late (calendar) days to use on programming assignments 1-5. If you are pair programming, late days are still individual (i.e if one of you has used up late days, and one has not, and you submit a homework late one day, only the student without remaining late days will be penalized). You cannot use late days on PA 6. Once late days are exhausted, any PA turned in late will be penalized 20% per late day. Each 24 hours or part thereof that a homework is late uses up one full late day. However, no assignment will be accepted more than four days after its due date.

    Readings

    This class has a significant amount of textbook reading. Most weeks have around 25 textbook pages. The homeworks and exams will be based heavily on the readings.

    Final grade computation
    • 63% homeworks (PAs 1-5 are each worth the same, 9% (ignore the different point values for each homework). PA6 is worth 18%, double the others)
    • 11% Midterm 1
    • 11% Midterm 2
    • 15% weekly review quizzes
    Final letter grades
    • Some sort of A: 90% and above of the total points (the numerator will include your extra credit, the denominator does not include possible extra credit (otherwise it wouldn't be extra credit))
    • Some sort of B: 80% and above
    • Some sort of C: 70% and above