Skip to content

UBC-NLP/python2020

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Python Programming

School of Information & Department of Linguistics

The University of British Columbia

Course title: Python Programming, Course Code: LIBR559C/LING530G

Program: iSchool (MLIS, Dual). Linguistics graduate programs

Year: Winter Session I 2020

Time: Wed. 9:00–11:50 p.m.

Time Breakdown

Watch recorded video: 9:00-10:30 Live Q & A: 10:30-11:50

Teaching Mode: Synchronous via Zoom + Asynchronous (Mediated via Canvas)

See "pdf" syllabus on Canvas for Zoom meeting link and passcode

COVID-19 Teaching Mode Remark: The instructor may need to switch teaching modes should unexpected emergencies arise in his family circle. I borrow the following notes on teaching mode policy from FRST 430/533C (Advanced Biometrics):

"We are all aware that the impact of COVID-19 has been devastating on all of our lives and communities. Class instruction of primary and secondary schools is planned to resume in person in September. Yet, as we move towards the cooler months, indoor activities will increase and it is likely that the Province of British Columbia will continue to adjust its guidance with regards to schools, work, and recreation activities. Therefore, it is important that I plan for contingencies, should circumstances change and I am unable to hold live online lectures and activities as outlined above. Rest assured, details on changes will be posted on Canvas if this happens and I will be as transparent and clear as possible in my expectations if these changes are required to occur." Kindly provided by Heather O’Brien and communicated by Erik Kwakkel.

Instructor: Dr. Muhammad Abdul-Mageed

Office location: Totem Field Studios 224 (Department of Linguistics: 2613 West Mall V6T 1Z4)

Office phone: (Apologies, I do not use office phone. Please email me)

Office hours: Wed. 12:00-14:00pm @Zoom (See zoom link and passcode in the pdf syllabus on Canvas) (I can also handle inquiries via email or arrange a Zoom meeting at a different time.)

E-mail address: muhammad.mageed@ubc.ca

Portal: http://canvas.ubc.ca

School of Information Welcome Page: The School of Information has a Welcome Page for new students (\url{https://ischool.ubc.ca/welcome/}), which captures a lot of information to new and returning students get settled. You may find the information therein useful.

1. Course Rationale & Goal:

Rationale/Background: Python is a remarkably powerful dynamic programming language that is used for a very wide variety of application domains, including text processing, data mining and analytics, and web development. Python’s very clear, readable syntax (e.g., use of English keywords where other languages use punctuation) and strong introspection capabilities make it an ideal choice for novice programmers. Indeed, more and more instructors are adopting the language for introductory programming courses.

Goal: The goal of this course is to introduce programming concepts using the Python programming language. The course is designed to be self-standing and focuses on basic concepts, assuming no prior programming experience. For an IT professional, programming skills are almost indispensable: General understanding of programming and programming experience both improve students’ overall understanding of information systems and help develop their general problem solving skills. Programming skills are also essential for analysis and mining of information users’ behaviors and communities. Good programming skills significantly boost work productivity and students usually utilize them during their program of study and throughout their professional lives.

Potential audiences for this course are:

  • People with no programming/IT experience who want to acquire an introductory level understanding of programming generally and Python specifically.
  • People planning to take courses on text analytics, social media mining, information retrieval, information visualization, human-information interaction, natural language processing, machine learning, web and database design, or similar courses, who want to prepare for, or significantly advance, carrying out work and research in these areas.

2. Course Objectives:

Upon completion of this course students will be able to:

  • Identify, analyze, assess, and solve a problem or need using Python programming. [1.1]
  • Apply Python programing knowledge to practical information access, extraction, retrieval, and data (e.g., text) mining tasks. [1.2]
  • Enhance interpersonal and written communication skills through assignments and discussions with classmates and instructor. [2.1]
  • Collaborate effectively with peers through course assignments, demonstrating the ability to work as part of a team, including initiative taking, integrity, dependability and co-operation. [3.1]
  • Understand, develop, and apply relevant library and information science tools to address information needs, questions and issues. [4.1]

3. Course Topics:

  • Overview of (Python) programming;

  • Unix: Directory navigation & control, File maintenance commands, Display commands, Text processing

  • Data types (numbers. Strings, lists, tuples, and dictionaries/hashes);

  • Control flow & functions;

  • File input and output;

  • Exception handling;

  • Iterators;

  • Applications: Simple text processing

4. Prerequisites:

  • MLIS and Dual MAS/MLIS: Completion of MLIS Core or permission of iSchool Graduate Advisor (prerequisite for iSchool students only)
  • Access to a computer on a regular basis. You should make your own arrangements for this.

5. Format of the course:

• This course will involve lectures, class hands-on activities, individual and group work, and instructor-, peer-, and self-assessment.

6. Course syllabus:

Recommended book:

  • Hetland, M. L. (2017). Beginning Python: from novice to professional (3rd ed.). Apress. ISBN-10: 1484200292. ISBN-13: 978-1484200292.

Suggested supplemental book:

  • Bird, S., Klein, E., & Loper, E. (2009). Natural language processing with Python. " O'Reilly Media, Inc.". (ISBN-13: 063-6920516491; ISBN-10: 0596516495) nltk-book

Online Tutorials:

  • Pandas
  • Tutorials linked in this syllabus.

7.A Calendar / Weekly schedule and readings (tentative)

Week Date Topic Readings / Slides What is due/out
1 9-Sep Course overview & Unix Intro. No readings / slides_0; unix_for_poets (extra); Videos: unix_intro;extra_unix
2 16-Sep Python Intro., Editors & Literals Hetland CH01 / slides_1; Videos: coding_as_cooking; Python_tools; literals; extra_literals hw 1 out
3 23-Sep Sequences (Lists & Tuples) Hetland CH02 / slides_2 & slides_3; Videos: strings_0; lists_tuples
4 30-Sep Sequences (Strings) Hetland CH03 / slides_4; Videos: strings_I; strings_II hw 1 due; hw 2 out
5 7-Oct Dictionaries Hetland CH04 / slides_5; Videos: dictionaries, dictionaries_short; Additional (not required)recursion
6 14-Oct Conditionals & Loops Hetland CH05 / slides_6; Videos: Conditionals_&_Loops_1; Conditionals_&_Loops_2 hw 2 due
7 21-Oct Functions Hetland CH06 / slides_7; videos: functions_1 hw 3 out
8 28-Oct Revision & Project Discussion slides_7 (second half of slides), slides_8; videos: functions_2
9 4-Nov Exceptions Hetland CH08 /slides_9; videos: exceptions
10 11-Nov Remembrance day-- No Class hw 3 due, Project outline due
11 18-Nov Modules & Files Hetland CH10 /slides_10; Hetland CH11 /slides_11_A; Extra: slides_11_B; videos: modules; files
12 25-Nov Text processing nltk-book CH03 / slide_12; Videos: file_practice_1; file_practice_2; text_processing; Extra (Optional) (A bit advanced) Sorting
13 2-Dec Revision & Project Work API & Pandas; Twitter Crawling; Rule-Based Sentiment Analysis Final paper due Dec. 5th at 11:59 pm

Extra Videos (NLP & Machine Learning)

Topic
Seq2Seq Models (1)
Seq2Seq Models (2)
Seq2Seq Models (3)
GPT2
ELMo
Convolutional Neural Networks
Language Models, Beam Search, Multilingual Machine Translation
Transformer(1)
Transformer(2)
BERT

7.C Ask Me Lab-Fashion Schedule (Extra Office Hours)

To provide additional support, the instructor will arrange additional support to be offered by a number of Deep Learning & NLP Team Mebmbers. The below is the current time for these additional sessions. For more information, please see Canvas.

Week Date Time
1 10-Sep 4pm-5pm
2 17-Sep 4pm-5pm
3 24-Sep 4pm-5pm
4 1-Oct 4pm-5pm
5 8-Oct 4pm-5pm
6 15-Oct 4pm-5pm
7 22-Oct 4pm-5pm
8 29-Oct 4pm-5pm
9 5-Nov 4pm-5pm
10 12-Nov 4pm-5pm
11 19-Nov 4pm-5pm
12 26-Nov 4pm-5pm

8. Course Assignments/Grades:

Assignment Due date Weight
Professionalization & online class attendance 15%
ASSIGNMENT 0: In-Class & Video Tutorial Code Throughout weeks 2-11 15%
Homework 1: Sept. 25 10%
Homework 2: Oct 14 10%
Homework 3: Nov 4 10%
ASSIGNMENT 4: Term Project (GROUP)
Proposal/Outline Nov 4 not graded
Report/Product Dec. 5 40%

Notes about assignments:

  • All written assignments must be submitted before 9:00 am of a respective assignment date;
  • All coding assignments must be submitted in "pdf" form as well as the form of a Python script (either .py file or an "iPython/Jupyter notebook"). Support will be provided on how to create ".py" scripts and iPython notebooks;
  • Note: If you need help converting/printing your python code file into "pdf", please check online but also feel free to ask the instructor.
  • Project proposal/outline must be in a pdf format;
  • All submitted files should be labeled with your last name(s) followed by an underscore and an assignment code. Assignment codes are two digit numbers, i.e., the assignment number preceeded by "0" for readability (e.g., “assignment01,” “asignment02,”). For example, "ASSIGNMENT 01" would be submitted as “abdul-mageed_assignment01.ipynb”

Assignments/Requirements in Detail

Professionalization: In an educational (or work) setting, each of us is expected to learn and demonstrate ability to interact with others professionally and collegially. This is important as it ensures we all work together efficiently. A total of 15% of your grade is devoted to the combination of online class attendance and encouraging professional communication related to the course both inside the virtual class (e.g., the way you interact with peers and the instructor) and outside the virtual class (responding to instructor communication timely). Practically, this means you should come to the virtual class in time, ensure your communication with everyone in class is civil, be attentive and do not engage in an external task or browse the social web during the class session, and respond to instructor email timely (e.g., not \emph{consistently} responding after 3 days, but responding the same day or in 1 or 2 days is fine and an occasional delay within reason is also fine [e.g., if you are traveling]). Part of professionalization is clear communication. As such, you are encouraged to ask questions, freely and civilly agree/disagree with others, etc.

Should you have any issues that impede your ability to attend any of the virtual class synchronous sessions, you are requested to inform the instructor. The instructor will then work with you to find solutions.

Assignment 0: In-Class & Video Tutorial Code Throughout weeks 2-11, you are required to practice coding inside the class session. There will be time in-class devoted to practice where you will be able to a) extend examples the instructor provides in his slides/notebooks and/or b) run code from the Hetland book. The resulting code may end up having some mistakes, look unorganized, lack depth and illustrative examples for a given task, or look identical to what the code instructor provides. To help you write better code and acquire deeper understanding of programming concepts, you will be given the chance to spend some more time at home re-running the same code with more examples. To further enhance the process, the instructor will provide thematically-organized video tutorials that you are required to watch before working further on your in-class code. Once you watch the video relevant to a given week, you can re-organize and tidy your code, provide depth and run it with more examples, and submit it.

This assignment is meant to engage you both during the class time and at home (where you can involve in content explained in a differnt mode and engage at your chosen time and place). The goal is to ensure you are not only able to run code shared with you during a given session, but also extend it slightly. This assignment is only accepted if you attend class. If you miss a class, this automatically means you are not allowed to submit In-Class & Video Tutorial Code for the session/sessions you missed. As such, failure to attend class without excuse (e.g., a sickness or another emergency which you must explain to the instructor over email prior to a class whenever possible) will result in a lower class grade.

Deliverables: In-class code snippets (Note: In-Class means in virtual class) A total of 10 code snippets in the form of ".py" or ".ipynb" files for the code you write based on In-Class practice + Watching Video Tutorials for weeks 2-11 of class. Please also convert your code-snippet file into a "pdf" document and submit that document along with (i.e., in addition) to the ".py" or ".ipynb" files.

Grading: Each code snippet (from each of the 10 weeks) will be worth 1.5 marks (total 15 marks). While students are required to submit the deliverables in time (as indicated above), the instructor will grade the deliverables together in two iterations (each 5 weeks' deliverables together. This is intended to simplify the process, while also sometimes allowing the instructor provide some flexibility in helping any students who may need additional help by allowing them to resubmit deliverables of specific weeks.

Assignment 1-3: Coding assignments These three assignments are coding exercises meant to support learning of the covered content. Each of these will be extensions of problems covered in class. The following criteria are required for each of them:

  • You must run your code before submitting, and ensure it is working code. Also, you should provide evidence that your code runs well (e.g., the result of each snippet when run or first 5/few lines of output in the case of large amounts of output). The code should be submitted in the form of ".py" or ".ipynb" files, in addition to a "pdf" version of the same code file.
  • For each problem, in addition to your code, you should provide explanatory Python comments as appropriate. Your comments should be short and to-the-point. As a programmer, you should develop a sense as to when to use comments and when not. This requirement is meant to teach you about using comments. Using comments will be discussed in class and feedback on your deliverables will be provided.
  • In addition to the functionality of your code, you should care for algorithms and style. This means, over time, you are expected to develop a sense of what the best ways to solve a problem in a computationally efficient way and using the capabilities of the Python programming language. These are aspects that will be discussed in class over the course of the semester.

Deliverables: ".py" or "iPython notebooks" with code + "pdf" of the same code

  • For each of assignments the 1-3 assignments, you are required to submit your code an in the form of ".py" or ".ipynb" files, including your code and relevant narratives/comments, etc. Please also convert your code-snippet file into a "pdf" document and submit that document along with (i.e., in addition) to the ".py" or ".ipynb" files.

Assignment 4: Term Project The purposes of this assignment include:

  • Identifying, analyzing, assessing, and solving a problem or need using Python programming;
  • Applying acquired Python skills and knowledge to practical tasks;
  • Developing oral and written communication skills through discussions with classmates and instructor;
  • Demonstrating ability to work as part of a team, including initiative taking, integrity, dependability and co-operation, and effective collaboration.

For this assignment, each student is required to work as part of a group of of 3 students on a project involving a significant amount of coding (e.g., coding at least equal to or more than the amount you wrote for assignments 1-3). Example projects include designing a system that generates language (e.g., the language of William Shakespeare), analyzes emotions in a dataset of literary work, visualizes concepts from a data source, summarizes texts, builds a simple website that delivers some service, builds a web interface or an app for a service (e.g., a library service), builds an interactive database with use case scenarios in meaningful contexts, analyzes a publicly available (e.g., governmental) dataset. You will have the chance to discuss your project with the instructor upon your request, and example projects will be discussed with class as well.

Deliverables Proposal (500 words)

  • Who are the the group members?
  • What are you designing or coding for?
  • What motivates your work? Why is it important or useful? For which audience?
  • How does your project compare to other projects people have articulated?
  • How do you think the project will further your Python programming skills?
  • What Python libraries do you expect to use?
  • How does the work bread down and what each member of the team be contributing?
  • Timeline for completing the project, including goals for each segment.

Final Report/Paper (3000-4000 words maximum) The final deliverable should include:

  • A detailed and clear description of your project, including the necessary sections, as appropriate. For system-oriented projects (e.g., building a website or an app), you will need to provide motivations, describe the audience, details of your implementation, and system functionality. For projects more focused on data analysis, you will need to include research questions, a brief literature review, a description of datasets, implementation details and methods employed, results, and a conclusion involving limitations and future directions;
  • All relevant code;
  • Pointers to live versions of your system, if any;
  • Some of these components will be more relevant to some projects but not others. For example, if your project involves a system for analysis of a dataset, you will need to include standard sections as you would find in an academic journal;
  • As appropriate, you should situate your work within the wider context of previous works and approaches, with supporting arguments (~ 5 sources);
  • Use case scenarios and screenshots from your system interface, if any;
  • Employment of figures, tables, and visualizations as appropriate to enhance argument and facilitate communicating your findings/results;

9. Course Policies

COVID-19-Related | Contingencies and COVID-19 Accommodation

Your instructor is committed to availing the best learning experience to you, including during the time of the pandemic. Should you have any difficulties, challenges, issues, etc. that impede your learning, please contact the instructor as soon as you can. Together, we can approach the learning process with engagement, kindness, and empathy. I want you to know I feel it is a privilege to have you in my course. Please help me serve you in the best ways possible by keeping me informed. I also invite you to extend support, kindness, and empathy to your classmates.

COVID-19-Related | Online Learning for International Students

From UBC Provost and Vice-President Academic, UBC Vancouver, September 2, 2020:

During this pandemic, the shift to online learning has greatly altered teaching and studying at UBC, including changes to health and safety considerations. Keep in mind that some UBC courses might cover topics that are censored or considered illegal by non-Canadian governments. This may include, but is not limited to, human rights, representative government, defamation, obscenity, gender or sexuality, and historical or current geopolitical controversies. If you are a student living abroad, you will be subject to the laws of your local jurisdiction, and your local authorities might limit your access to course material or take punitive action against you. UBC is strongly committed to academic freedom, but has no control over foreign authorities (please visit http://www.calendar.ubc.ca/vancouver/index.cfm?tree=3,33,86,0 for an articulation of the values of the University conveyed in the Senate Statement on Academic Freedom). Thus, we recognize that students will have legitimate reason to exercise caution in studying certain subjects. If you have concerns regarding your personal situation, consider postponing taking a course with manifest risks, until you are back on campus or reach out to your academic advisor to find substitute courses. For further information and support, please visit: http://academic.ubc.ca/support-resources/freedom-expression.

Attendance: The UBC calendar states: “Regular attendance is expected of students in all their classes (including lectures, laboratories, tutorials, seminars, etc.). Students who neglect their academic work and assignments may be excluded from the final examinations. Students who are unavoidably absent because of illness or disability should report to their instructors on return to classes.”

Evaluation: All assignments will be marked using the evaluative criteria given in this syllabus.

Access & Diversity: Access & Diversity works with the University to create an inclusive living and learning environment in which all students can thrive. The University accommodates students with disabilities who have registered with the Access and Diversity unit. You must register with the Disability Resource Centre to be granted special accommodations for any on-going conditions. Religious Accommodation: The University accommodates students whose religious obligations conflict with attendance, submitting assignments, or completing scheduled tests and examinations. Please let your instructor know in advance, preferably in the first week of class, if you will require any accommodation on these grounds. Students who plan to be absent for varsity athletics, family obligations, or other similar commitments, cannot assume they will be accommodated, and should discuss their commitments with the instructor before the course drop date. UBC policy on Religious Holidays.

Academic Integrity

he following material about academic misconduct is copied and pasted from the UBC calendar:

academic misconduct Students are responsible for informing themselves of the guidelines of acceptable and non-acceptable conduct for graded assignments established by their instructors for specific courses and of the examples of academic misconduct set out below. Academic misconduct that is subject to disciplinary measures includes, but is not limited to, engaging in, attempting to engage in, or assisting others to engage, in any of the actions described below.

  • Cheating, which may include, but is not limited to:
  • falsification of any material subject to academic evaluation, including research data;
  • use of or participation in unauthorized collaborative work;
  • use or possession in an examination of any materials (including devices) other than those permitted by the examiner;
  • use, possession, or facilitation of unauthorized means to complete an examination (e.g., receiving unauthorized assistance from another person, or providing that assistance); and
  • dishonest practices that breach rules governing examinations or submissions for academic evaluation (see the Student Conduct during Examinations).
  • Plagiarism, which is intellectual theft, occurs where an individual submits or presents the oral or written work of another person as his or her own. Scholarship quite properly rests upon examining and referring to the thoughts and writings of others. However, when another person's words (i.e. phrases, sentences, or paragraphs), ideas, or entire works are used, the author must be acknowledged in the text, in footnotes, in endnotes, or in another accepted form of academic citation. Where direct quotations are made, they must be clearly delineated (for example, within quotation marks or separately indented). Failure to provide proper attribution is plagiarism because it represents someone else's work as one's own. Plagiarism should not occur in submitted drafts or final works. A student who seeks assistance from a tutor or other scholastic aids must ensure that the work submitted is the student's own. Students are responsible for ensuring that any work submitted does not constitute plagiarism. Students who are in any doubt as to what constitutes plagiarism should consult their instructor before handing in any assignments.

  • Submitting the same, or substantially the same, essay, presentation, or assignment more than once (whether the earlier submission was at this or another institution) unless prior approval has been obtained from the instructor(s) to whom the assignment is to be submitted.

  • Impersonating a candidate at an examination or other evaluation, facilitating the impersonation of a candidate, or availing oneself of the results of an impersonation.

  • ubmitting false records or information, orally or in writing, or failing to provide relevant information when requested.

  • Falsifying or submitting false documents, transcripts, or other academic credentials. Failing to comply with any disciplinary measure imposed for academic misconduct.

Websites to help you understand plagiarism:

Additional UBC resources on plagiarism and academic integrity

If after reading these materials you still are unsure about how to properly use sources in your work, please ask me for clarification. Students are held responsible for knowing and following all University regulations regarding academic dishonesty. If a student does not know how to properly cite a source or what constitutes proper use of a source it is the student's personal responsibility to obtain the needed information and to apply it within University guidelines and policies. If evidence of academic dishonesty is found in a course assignment, previously submitted work in this course may be reviewed for possible academic dishonesty and grades modified as appropriate. UBC policy requires that all suspected cases of academic dishonesty must be forwarded to the Dean for possible action

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published