Hide menu

729G17 Language Technology


This page contains the instructions for the lab assignments. For information about the knowledge requirements for the lab component and the grading criteria, please see the corresponding section on the Examination page.

General information

Lab assignments should be done in pairs. Please contact the examiner in case you want to work on your own. Unfortunately, we do not always have the resources necessary to tutor and give feedback on one-person labs.

Instructions: Submit your labs according to the instructions below. Please also read the general rules for hand-in assignments. Before you submit your first lab, you and your lab partner need to sign up in Webreg.

Format of the subject line: 729G17-2018 lab code your LiU-ID your partner’s LiU-ID your lab assistant’s LiU-ID

Example: 729G17-2018 L1 marjo123 erika456 fooba99

Lab assistants for this course:

  • Marco Kuhlmann (marku61)
  • Robin Kurtz (robku08)

Feedback: For each lab there are a number of scheduled hours where you can get oral feedback on your work from the lab assistants. If you submit in time for the first due date, you will get also get written feedback. In addition to that, you can always get feedback from the examiner (office hours: Wednesdays 13-17 in Building E, Room 3G.476).

Topic 1: Text classification

Text classification is the task of categorising text documents into predefined classes.

Level A

In this lab you will evaluate a text classifier using accuracy, precision, and recall, compare a trained classifier to a simple baseline, and implement the Naive Bayes classification rule. The concrete task that you will be working with is to classify speeches from the Swedish parliament as either right-wing or left-wing.

Lab L1: Text classification (due 2017-01-27)

Concepts
  • accuracy, precision, recall
  • baseline
  • Naive Bayes classifier
Procedures
  • evaluate a text classifier based on accuracy, precision, and recall
  • compare a text classifier to a baseline
  • apply the classification rule of the Naive Bayes classifier to a text

Level B

In this lab you will complete your implementation of the Naive Bayes classifier with a training procedure, and implement a second classifier based on the averaged perceptron. You will evaluate these classifiers using accuracy, and experiment with different document representations. The classification task is to classify movie reviews as either positive or negative.

Lab L1X: Text classification (due 2017-01-27)

Concepts
  • accuracy
  • Naive Bayes classifier
  • averaged perceptron classifier (advanced)
Procedures
  • evaluate a text classifier based on accuracy
  • learn a Naive Bayes classifier from data (advanced)
  • implement an averaged perceptron classifier (advanced)

Topic 2: Language modelling

Language modelling is about building models of what words are more or less likely to occur in some language.

Level A

In this lab you will experiment with n-gram models. You will test various various parameters that influence these model’s quality and estimate models using maximum likelihood estimation with additive smoothing. The data set that you will be working on is the set of Arthur Conan Doyle’s novels about Sherlock Holmes.

Lab L2: Language modelling (due 2017-02-03)

Concepts
  • n-gram model
  • entropy
  • additive smoothing
  • Levenshtein distance
Procedures
  • estimate n-gram probabilities using the Maximum Likelihood method
  • estimate n-gram probabilities using additive smoothing

Level C

In this lab you will implement a simple spelling corrector. The core of the implementation is the Wagner–Fisher algorithm for computing the Levenshtein distance between two input words. The data set that you will be working with is the same collection of Sherlock Holmes novels as for the Level A lab.

Lab L2X: Spelling Correction (due 2017-02-03)

Concepts
  • n-gram model
  • Levenshtein distance
  • Wagner–Fisher algorithm (advanced)
Procedures
  • implement a limited-size language technology system (advanced)
  • implement the Wagner–Fisher algorithm (advanced)

Topic 3: Part-of-speech tagging

Part-of-speech tagging is the task of labelling words (tokens) with parts of speech such as noun, adjective, and verb.

Level A

In this lab you will experiment with POS taggers trained on the Stockholm Umeå Corpus (SUC), a Swedish corpus containing more than 74,000 sentences (1.1 million tokens), which were manually annotated with, among others, parts of speech.

Lab L3: Part-of-speech tagging (due 2017-02-10)

Concepts
  • part-of-speech tagging as a sequence labelling task
  • accuracy, precision, recall
  • confusion matrix, error analysis
  • baseline
Procedures
  • evaluate a part-of-speech tagger based on accuracy, precision, and recall
  • establish a baseline for a part-of-speech tagger

Level B

In the advanced part of this lab, you will practice your skills in feature engineering, the task of identifying useful features for a machine learning system – in this case the part-of-speech tagger that you implemented in the Level A-lab.

Lab L3X: Feature engineering for part-of-speech tagging (due 2017-02-10)

Concepts
  • averaged perceptron classifier
  • feature engineering (advanced)
Procedures
  • improve a part-of-speech tagger using feature engineering (advanced)
  • evaluate a part-of-speech tagger based on accuracy

Topic 4: Syntactic analysis

Syntactic analysis is the task to map a sentence to a formal representation of its syntactic structure.

Level A

In this lab you will experiment with MaltParser, a standard tool for syntactic analysis. You will learn how to train MaltParser on treebank data, write code to evaluate the trained parser using standard evaluation measures, and reflect on how these evaluation measures change when we use automatically predicted tags instead of gold-standard tags for training.

Lab L4: Syntactic analysis (due 2017-02-17)

Concepts
  • dependency tree, dependency parsing
  • attachment score, exact match
Procedures
  • train a state-of-the-art dependency parser on treebank data
  • evaluate a dependency parser based on attachment score and exact match

Level C

In this lab you will use two freely available NLP tools, Stagger and MaltParser, to implement a simple system for information extraction.

Lab L4X: Information extraction (due 2017-02-17)

Concepts
  • part-of-speech tagging, dependency parsing
  • named entities, semantic relations (advanced)
  • IOB-tags (advanced)
Procedures
  • train a state-of-the-art part-of-speech tagger on treebank data
  • train a state-of-the-art dependency parser on treebank data
  • extract semantic triples from running text (advanced)

Topic 5: Semantic analysis

These labs focus on word space models and semantic similarity.

Level A

In this lab you will explore a word space model which trained on the Swedish Wikipedia using Google’s word2vec tool. You will learn how to use the model to measure the semantic similarity between words and apply it to solve a simple word analogy task.

Lab L5: Semantic analysis (due 2017-02-24)

Concepts
  • word space model, cosine distance, semantic similarity
  • accuracy
Procedures
  • use a pre-trained word space model to measure the semantic similarity between two words
  • use a pre-trained word space model to solve word analogy tasks

Level B

In this lab you will use state-of-the-art NLP libraries to train word space models on text data and evaluate them on a standard task, the synonym part of the Test of English as a Foreign Language (TOEFL).

Lab L5X: Semantic analysis (due 2017-02-24)

Concepts
  • word space model, cosine distance, semantic similarity
  • accuracy
Procedures
  • train a word space model on text data (advanced)
  • use a word space model to solve a synonym prediction task (advanced)

Reflection paper

After having completed all labs, you are asked to write an individual reflection paper. The purpose of this assignment is to give you an opportunity to think about what you have learned from the lab assignments. The paper should have three parts:

  • a summary of the content of the labs (in your own words)
  • reflections on the knowledge and skills that you have developed or trained
  • reflections on the collaboration in your lab group

Questions that you may want to discuss include the following:

  • What have you learned by doing the labs?
  • Which connections do you see between the labs and the other parts of the course?
  • Which connections do you see between the labs and other courses on the programme?
  • Which of the knowledge and skills that you have developed or trained may be most relevant for you in the future?
  • Which parts of the labs did you find the most interesting? Which were less interesting?
  • How did you and your lab partner complement each other?

Instructions: Write a paper addressing the above questions. The length of your paper should be around 1,000 words (approximately 2 pages). Submit your paper as a PDF document. Due date: 2017-03-03

Format of the subject line: 729G17-2018 LR your LiU-ID the examiner’s LiU-ID

The examiner is Marco Kuhlmann and his LiU-ID is marku61.

Example: 729G17-2018 LR marjo123 marku61

Feedback: You will get feedback on your paper from the examiner.


Page responsible: Marco Kuhlmann
Last updated: 2017-09-22