diff --git a/l4/TM-L4.ipynb b/l4/TM-L4.ipynb index 43436e53c0ad88b43c8d145fc0b4f177a4ac4375..d10878096dbb7398abdfb54c66c87f4e562678af 100644 --- a/l4/TM-L4.ipynb +++ b/l4/TM-L4.ipynb @@ -16,6 +16,13 @@ "You will use the word vectors that come with [spaCy](http://spacy.io). Note that you will need the ‘large’ English language model; the ‘small’ model that you used in previous labs does not include proper word vectors." ] }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "**Reminder about our [Rules for hand-in assignments](https://www.ida.liu.se/~TDDE16/exam.en.shtml#handins) and the [Policy on cheating and plagiarism](https://www.ida.liu.se/~TDDE16/exam.en.shtml#cheating)**" + ] + }, { "cell_type": "code", "execution_count": null, @@ -367,7 +374,7 @@ "cell_type": "markdown", "metadata": {}, "source": [ - "[Bowman et al., 2015](https://www.aclweb.org/anthology/D15-1075/) evaluate a classifier that uses (among others) **cross-unigram features**. This term is used to refer to pairs of unigrams $(w_1, w_2)$ such that $w_1$ occurs in sentence 1, $w_2$ occurs in sentence 2, and both have been assigned the same part-of-speech tag.\n", + "[Bowman et al. (2015)](https://www.aclweb.org/anthology/D15-1075/) evaluate a classifier that uses (among others) **cross-unigram features**. This term is used to refer to pairs of unigrams $(w_1, w_2)$ such that $w_1$ occurs in sentence 1, $w_2$ occurs in sentence 2, and both have been assigned the same part-of-speech tag.\n", "\n", "Your next task is to implement the cross-unigram classifier. To this end, the next cell contains skeleton code for a transformer that you can use as the first component in a classification pipeline. This transformer converts each row of the SNLI data frame into a space-separated string consisting of\n", "\n", @@ -493,7 +500,7 @@ "cell_type": "markdown", "metadata": {}, "source": [ - "Once you have working code for all problems, re-run Problems 4–6 with the full training data. This will take quite a while (expect approximately 1&;nbsp;hour on Colab). **Make sure to not overwrite your previous results.** What are your results on the full data? How do they differ from the results that you obtained for the smaller training data? How do you interpret this? Summarize your findings in a short text." + "Once you have working code for all problems, re-run Problems 4–6 with the full training data. This will take quite a while (expect approximately 1 hour on Colab). **Make sure to not overwrite your previous results.** What are your results on the full data? How do they differ from the results that you obtained for the smaller training data? How do you interpret this? Summarize your findings in a short text." ] }, { @@ -516,9 +523,39 @@ "cell_type": "markdown", "metadata": {}, "source": [ - "<div class=\"alert alert-info\">\n", - " Please read the section ‘General information’ on the ‘Labs’ page of the course website before submitting this notebook!\n", - "</div>" + "## Reflection questions" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "The following reflection questions are questions that you could be asked in the oral exam. Try to answer each of them in the form of a short text and enter it in the cell below. You will get feedback on your answers from your lab assistant." + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "**RQ 4.1:** In Problem 3, you manipulated word vectors using addition and subtraction, getting intermediate vectors which are still valid embeddings. Consider the difference vector *Stockholm* $-$ *Sweden*. What does that vector intuitively represent? What words do you think it should be most similar to?\n", + "\n", + "**RQ 4.2:** Manually engineering features is a fairly time-consuming task, but as shown in Problem 5, can result in systems which are on par with embedding-based systems. Conversely, embedding-based systems avoid manual feature engineering, but often require significantly more computational resources. Looking at your results from Problem 7, are embedding-based systems worth the extra resources in the context of this task?\n", + "\n", + "**RQ 4.3:** Throughout the lab, you have been using pre-trained word vectors from spaCy. In Problem 7, you used them to compute the *input* to a neural network. Another common pattern is to use them to initialize an *embedding layer* in a neural network. (Have a look at [this article](https://machinelearningmastery.com/use-word-embedding-layers-deep-learning-keras/) if you are unfamiliar with that pattern.) Explain the difference between the two usage patterns. What advantages/disadvantages do they have?" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "*TODO: Enter your answers here*" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "**Congratulations on finishing L4! 👍**" ] } ], @@ -538,7 +575,7 @@ "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", - "version": "3.7.6" + "version": "3.8.2" } }, "nbformat": 4,