nl en

Python for Linguists 2


Admission requirements

To partake in this course, students must have completed the course Python for Linguists 1 (in previous years called simply “Python for Linguists”), or have attained a comparable level of Python programming elsewhere.


This course will extend students’ existing foundation with more advanced Python techniques, as well as with greater familiarity with the (Bash) command line. The focus is on building reusable, self-contained command-line interface tools for analyzing natural language data, this time with the help of more powerful Python libraries (e.g., pandas, spaCy). Along the way, students will get acquainted with core concepts and challenges from Computational Linguistics, such as parts of speech, regular expressions, dependency parsing, discourse relations, coreference resolution and gender bias.

We will again use printed readers with incremental exercises and interesting Coding Quests, and there will be lectures as well as explicitly optional ‘workgroups’ for additional help with the homework. In the final weeks, students will collaboratively conduct a small computational research project.

This course is more ‘linguistic’ than the course Python for Linguists 1, but students from other discipines are again more than welcome. As before, the course is focused on ‘getting stuff done’, while also teaching best practices: the research we do must be sound and replicable, so the tools we build must be correct and transparent.

Course objectives

  • You will be able to build and use command-line interface programs in Python, ranging from small auxiliary tools to sizable programs that conduct sophisticated Linguistic analysis, mostly on textual data.

  • You will be able to operate in a Unix (Bash) environment, and solve problems by combining existing command-line tools (such as cat, grep, piping) with your own Python scripts.

  • You will be able to use more advanced Python libraries such as Pandas and spaCy for analyzing linguistic data, with the help of documentation.

  • You will be able to explain key notions from the field of Computational Linguistics, such as part-of-speech tagging, dependency parsing, algorithmic bias, and coreference resolution.

  • You will be able to conduct a small research project, which involves translating a Linguistic research question into a computational methodology, implementing this methodology in Python, and presenting your findings to an audience of peers.


The timetables are available through My Timetable.

Mode of instruction

  • Lecture

  • Tutoring

Assessment method


There will be one written exam at the end, with a mix of closed questions, short open questions and short programming exercises. Throughout the course, portions of the homework will be marked as mandatory, to be submitted for a simple pass/fail grade. Only students with at least 80% of these assignments passed can pass the course. In the final weeks, students will collaboratively conduct and present a small research project.


Your final grade will be computed as the average of the exam (70%) and the group project (30%), with a maximum grade of 5.0 (fail) if insufficient homework assignments are passed.


A resit will be offered for the written exam, replacing the original grade entirely. A resit will also be offered for the mandatory portion of the homework, in the form of a substantial, individual programming assignment at the end of the course. Resitting the group project is not possible.

Inspection and feedback

How and when an exam review will take place will be disclosed together with the publication of the exam results at the latest. If a student requests a review within 30 days after publication of the exam results, an exam review will have to be organized.

Reading list

Students will need to order two readers with exercises from Leiden University’s ReaderOnline service:

  • The Big Book of Python Exercises for Linguists, volume 2

  • The Small Book of Python Quests for Linguists, volume 2


Enrolment through MyStudyMap is mandatory.

General information about course and exam enrolment is available on the website.

Registration Contract teaching and Exchange

Information for those interested in taking this course in context of Contract teaching (with taking examinations), eg. about costs, registration and conditions.

For the registration of exchange students contact Humanities International Office.


  • For substantive questions, contact the lecturer listed in the right information bar.

  • For questions about enrolment, admission, etc, contact the Education Administration Office: Reuvensplaats