question
stringlengths
6
3.53k
text
stringlengths
17
2.05k
source
stringclasses
1 value
To support very large scale neural networks in limited amount of memory, one may want to use floating point numbers with very few bits. Here we consider substantially simplified operations on such numbers, Float8. A value Float8(mant,exp) represents the non-negative integer mant * 2^exp. We call mant a mantissa (which gives significant digits) whereas exp is the exponent. This allows us to represent both smaller and larger integers, keeping a similar number of significant digits. (The larger integers can only be represented up to a given power of two.) In our simple example, we use only four bits for both mantissa and the exponent, and we assume they are both non-negative. final case class Float8(mant: Int, exp: Int): require(0 <= mant && mant <= 15 && 0 <= exp && exp <= 15) def value: Int = mant << exp val a = Float8(15, 8) val b = Float8(5, 10) We look at the operation plus, of adding such numbers. When the exponent is smaller than another one, the operation shifts mantissa and then performs addition. If mantissa gets too large, we reduce it an increase the exponent. extension (x: Float8) def +(y: Float8): Float8 = if x.exp <= y.exp then val shift = y.exp - x.exp val mant = (x.mant >> shift) + y.mant if mant < 16 then Float8(mant, y.exp) else val exp1 = y.exp + 1 if exp1 < 16 then Float8(mant / 2, y.exp + 1) else Float8(15, 15) else y + x Is this operation associative? Prove or give a counterexample.
A 2-bit float with 1-bit exponent and 1-bit mantissa would only have 0, 1, Inf, NaN values. If the mantissa is allowed to be 0-bit, a 1-bit float format would have a 1-bit exponent, and the only two values would be 0 and Inf. The exponent must be at least 1 bit or else it no longer makes sense as a float (it would just be a signed number).
https://www.kaggle.com/datasets/conjuring92/wiki-stem-corpus
To support very large scale neural networks in limited amount of memory, one may want to use floating point numbers with very few bits. Here we consider substantially simplified operations on such numbers, Float8. A value Float8(mant,exp) represents the non-negative integer mant * 2^exp. We call mant a mantissa (which gives significant digits) whereas exp is the exponent. This allows us to represent both smaller and larger integers, keeping a similar number of significant digits. (The larger integers can only be represented up to a given power of two.) In our simple example, we use only four bits for both mantissa and the exponent, and we assume they are both non-negative. final case class Float8(mant: Int, exp: Int): require(0 <= mant && mant <= 15 && 0 <= exp && exp <= 15) def value: Int = mant << exp val a = Float8(15, 8) val b = Float8(5, 10) We look at the operation plus, of adding such numbers. When the exponent is smaller than another one, the operation shifts mantissa and then performs addition. If mantissa gets too large, we reduce it an increase the exponent. extension (x: Float8) def +(y: Float8): Float8 = if x.exp <= y.exp then val shift = y.exp - x.exp val mant = (x.mant >> shift) + y.mant if mant < 16 then Float8(mant, y.exp) else val exp1 = y.exp + 1 if exp1 < 16 then Float8(mant / 2, y.exp + 1) else Float8(15, 15) else y + x Is this operation associative? Prove or give a counterexample.
Floating-point numbers are typically packed into a computer datum as the sign bit, the exponent field, and the significand or mantissa, from left to right. For the IEEE 754 binary formats (basic and extended) which have extant hardware implementations, they are apportioned as follows: While the exponent can be positive or negative, in binary formats it is stored as an unsigned number that has a fixed "bias" added to it. Values of all 0s in this field are reserved for the zeros and subnormal numbers; values of all 1s are reserved for the infinities and NaNs. The exponent range for normal numbers is for single precision, for double, or for quad.
https://www.kaggle.com/datasets/conjuring92/wiki-stem-corpus
Once paging is enabled, load instruction / CR3 register / Page Table entry uses Virtual or Physical address?
In protected mode with paging enabled (bit 31, PG, of control register CR0 is set), but without PAE, x86 processors use a two-level page translation scheme. Control register CR3 holds the page-aligned physical address of a single 4 KB long page directory. This is divided into 1024 four-byte page directory entries that in turn, if valid, hold the page-aligned physical addresses of page tables, each 4 KB in size. These similarly consist of 1024 four-byte page table entries which, if valid, hold the page-aligned physical addresses of 4 KB long pages of physical memory (RAM).
https://www.kaggle.com/datasets/conjuring92/wiki-stem-corpus
Once paging is enabled, load instruction / CR3 register / Page Table entry uses Virtual or Physical address?
Used when virtual addressing is enabled, hence when the PG bit is set in CR0. CR3 enables the processor to translate linear addresses into physical addresses by locating the page directory and page tables for the current task. Typically, the upper 20 bits of CR3 become the page directory base register (PDBR), which stores the physical address of the first page directory. If the PCIDE bit in CR4 is set, the lowest 12 bits are used for the process-context identifier (PCID).
https://www.kaggle.com/datasets/conjuring92/wiki-stem-corpus
Which of the execution of an application are possible on a single-core machine?
A single-core processor is a microprocessor with a single core on its die. It performs the fetch-decode-execute cycle once per clock-cycle, as it only runs on one thread. A computer using a single core CPU is generally slower than a multi-core system.
https://www.kaggle.com/datasets/conjuring92/wiki-stem-corpus
Which of the execution of an application are possible on a single-core machine?
A single kernel execution can run on all or many of the PEs in parallel. How a compute device is subdivided into compute units and PEs is up to the vendor; a compute unit can be thought of as a "core", but the notion of core is hard to define across all the types of devices supported by OpenCL (or even within the category of "CPUs"),: 49–50 and the number of compute units may not correspond to the number of cores claimed in vendors' marketing literature (which may actually be counting SIMD lanes).In addition to its C-like programming language, OpenCL defines an application programming interface (API) that allows programs running on the host to launch kernels on the compute devices and manage device memory, which is (at least conceptually) separate from host memory. Programs in the OpenCL language are intended to be compiled at run-time, so that OpenCL-using applications are portable between implementations for various host devices.
https://www.kaggle.com/datasets/conjuring92/wiki-stem-corpus
Which of the following lock acquisition orders (locks are acquired from left to right), for thread 1 (T1) and thread 2 (T2), will result in a deadlock ? Assume that A, B, C, D are lock instances.
Thus, the programmer must think of all possible combinations of one thread giving up a lock and another thread getting it next, and make sure their code only allows valid combinations. Note that the only effect is that A-post-gain-lock statements come before B-post-gain-lock statements. No other effect happens, and no other relative ordering can be relied upon.
https://www.kaggle.com/datasets/conjuring92/wiki-stem-corpus
Which of the following lock acquisition orders (locks are acquired from left to right), for thread 1 (T1) and thread 2 (T2), will result in a deadlock ? Assume that A, B, C, D are lock instances.
The notion of fairness in lock acquisition applies to the order in which threads acquire a lock successfully. If some type of fairness is implemented, it prevents a thread from being starved out of execution for a long time due to inability to acquire a lock in favor of other threads. With no fairness guarantees, a situation can arise where a thread (or multiple threads) can take a disproportionately long time to execute as compared to others. A simple example will now be presented to show how a thread could be excessively delayed due to a lack of fairness in lock acquisition.
https://www.kaggle.com/datasets/conjuring92/wiki-stem-corpus
There are N philosphers sitting around a circular table eating spaghetti and discussing philosphy. The problem is that each philosopher needs two forks to eat, and there are only $N$ forks, one between each pair of philosophers. We want to design an algorithm that the philosophers can use, that ensures that no one starves as long as each philosopher eventually stops eating, and such that the maximum number of philosophers can eat at once. Assume now that you have $N/2$ forks and $N$ philosophers (assuming $N$ is even). Similar to Q1, each philosopher p takes fork p%n and (p+1)%n. Does your solution for question 1 prevent deadlocks ?
Each philosopher can only alternately think and eat. Moreover, a philosopher can only eat their spaghetti when they have both a left and right fork. Thus two forks will only be available when their two nearest neighbors are thinking, not eating. After an individual philosopher finishes eating, they will put down both forks. The problem is how to design a regimen (a concurrent algorithm) such that no philosopher will starve; i.e., each can forever continue to alternate between eating and thinking, assuming that no philosopher can know when others may want to eat or think (an issue of incomplete information).
https://www.kaggle.com/datasets/conjuring92/wiki-stem-corpus
There are N philosphers sitting around a circular table eating spaghetti and discussing philosphy. The problem is that each philosopher needs two forks to eat, and there are only $N$ forks, one between each pair of philosophers. We want to design an algorithm that the philosophers can use, that ensures that no one starves as long as each philosopher eventually stops eating, and such that the maximum number of philosophers can eat at once. Assume now that you have $N/2$ forks and $N$ philosophers (assuming $N$ is even). Similar to Q1, each philosopher p takes fork p%n and (p+1)%n. Does your solution for question 1 prevent deadlocks ?
A solution presented by William Stallings is to allow a maximum of n-1 philosophers to sit down at any time. The last philosopher would have to wait (for example, using a semaphore) for someone to finish dining before they "sit down" and request access to any fork. This guarantees at least one philosopher may always acquire both forks, allowing the system to make progress.
https://www.kaggle.com/datasets/conjuring92/wiki-stem-corpus
In an x86 multiprocessor system with JOS, select all the correct options. Assume every Env has a single thread.
OS-9's real-time kernel allows multiple independent applications to execute simultaneously through task switching and inter-process communication facilities. All OS-9 programs run as processes containing at least one lightweight process (thread) but may contain an effectively unlimited number of threads. Within a process, these lightweight processes share memory, I/O paths, and other resources in accordance with the POSIX threads specification and API. OS-9 schedules the threads using a fixed-priority preemptive scheduling algorithm with round-robin scheduling within each priority.
https://www.kaggle.com/datasets/conjuring92/wiki-stem-corpus
In an x86 multiprocessor system with JOS, select all the correct options. Assume every Env has a single thread.
Used to modify/check the number of threads, detect if the execution context is in a parallel region, how many processors in current system, set/unset locks, timing functions, etc
https://www.kaggle.com/datasets/conjuring92/wiki-stem-corpus
Freshly graduated from EPFL, you have been hired as contractors for a successful and rapidly growing bank. The bank has been experiencing problems with their money management system recently, which is written in Scala, and so they hired the best and brightest young engineer they could find: you! The system had been working perfectly fine so far, they tell you. In the past days, due to an increased number of customers, they had to switch from a single-threaded sequential execution environment to a multi-threaded concurrent one, in which the threads may perform transactions concurrently. That's when problems started, your manager says... Here is the code responsible to withdraw money from the account from and transfer it to the account to, within the same bank: def transfer(from: Account, to: Account, amount: BigInt): Unit = { require(amount >= 0) val balanceFrom = from.balance if (balanceFrom >= amount) { from.balance = balanceFrom - amount val balanceTo = to.balance to.balance = balanceTo + amount } } For the bank, it is very important that the following two properties hold after any sequence of completed transfer transactions: The balance of an account never goes below 0. The total sum of money held by the bank is constant. Does anything change in the setting where multiple threads can execute the transfer method concurrently? For each of the two desired properties of the system, check if it holds in this concurrent environment. If not, come up with an example execution which exhibits a violation of the property.
One of lock-based programming's biggest problems is that "locks don't compose": it is hard to combine small, correct lock-based modules into equally correct larger programs without modifying the modules or at least knowing about their internals. Simon Peyton Jones (an advocate of software transactional memory) gives the following example of a banking application: design a class Account that allows multiple concurrent clients to deposit or withdraw money to an account; and give an algorithm to transfer money from one account to another. The lock-based solution to the first part of the problem is: class Account: member balance: Integer member mutex: Lock method deposit(n: Integer) mutex.lock() balance ← balance + n mutex.unlock() method withdraw(n: Integer) deposit(−n) The second part of the problem is much more complicated. A transfer routine that is correct for sequential programs would be function transfer(from: Account, to: Account, amount: Integer) from.withdraw(amount) to.deposit(amount) In a concurrent program, this algorithm is incorrect because when one thread is halfway through transfer, another might observe a state where amount has been withdrawn from the first account, but not yet deposited into the other account: money has gone missing from the system. This problem can only be fixed completely by taking locks on both account prior to changing any of the two accounts, but then the locks have to be taken according to some arbitrary, global ordering to prevent deadlock: function transfer(from: Account, to: Account, amount: Integer) if from < to // arbitrary ordering on the locks from.lock() to.lock() else to.lock() from.lock() from.withdraw(amount) to.deposit(amount) from.unlock() to.unlock() This solution gets more complicated when more locks are involved, and the transfer function needs to know about all of the locks, so they cannot be hidden.
https://www.kaggle.com/datasets/conjuring92/wiki-stem-corpus
Freshly graduated from EPFL, you have been hired as contractors for a successful and rapidly growing bank. The bank has been experiencing problems with their money management system recently, which is written in Scala, and so they hired the best and brightest young engineer they could find: you! The system had been working perfectly fine so far, they tell you. In the past days, due to an increased number of customers, they had to switch from a single-threaded sequential execution environment to a multi-threaded concurrent one, in which the threads may perform transactions concurrently. That's when problems started, your manager says... Here is the code responsible to withdraw money from the account from and transfer it to the account to, within the same bank: def transfer(from: Account, to: Account, amount: BigInt): Unit = { require(amount >= 0) val balanceFrom = from.balance if (balanceFrom >= amount) { from.balance = balanceFrom - amount val balanceTo = to.balance to.balance = balanceTo + amount } } For the bank, it is very important that the following two properties hold after any sequence of completed transfer transactions: The balance of an account never goes below 0. The total sum of money held by the bank is constant. Does anything change in the setting where multiple threads can execute the transfer method concurrently? For each of the two desired properties of the system, check if it holds in this concurrent environment. If not, come up with an example execution which exhibits a violation of the property.
Consider a banking application as an example, and a transaction in it—the transfer function, which takes money from one account, and puts it into another account. In the IO monad, this might look like: This causes problems in concurrent situations where multiple transfers might be taking place on the same account at the same time. If there were two transfers transferring money from account from, and both calls to transfer ran line (A) before either of them had written their new values, it is possible that money would be put into the other two accounts, with only one of the amounts being transferred being removed from account from, thus creating a race condition.
https://www.kaggle.com/datasets/conjuring92/wiki-stem-corpus
In this week's lecture, you have been introduced to the aggregate method of ParSeq[A] (and other parallel data structures). It has the following signature: def aggregate[B](z: B)(f: (B, A) => B, g: (B, B) => B): B Discuss, as a group, what aggregate does and what its arguments represent. Discuss the implementations from questions 4 and 5. Which one do you think would be more efficient?
There are no readily available heuristics available that are accurate with large databases. This method has only been used by Ringe's group.In these two methods there are often several trees found with the same score so the usual practice is to find a consensus tree via an algorithm. A majority consensus has bipartitions in more than half of the input trees while a greedy consensus adds bipartitions to the majority tree.
https://www.kaggle.com/datasets/conjuring92/wiki-stem-corpus
In this week's lecture, you have been introduced to the aggregate method of ParSeq[A] (and other parallel data structures). It has the following signature: def aggregate[B](z: B)(f: (B, A) => B, g: (B, B) => B): B Discuss, as a group, what aggregate does and what its arguments represent. Discuss the implementations from questions 4 and 5. Which one do you think would be more efficient?
It has been claimed that for complex queries OLAP cubes can produce an answer in around 0.1% of the time required for the same query on OLTP relational data. The most important mechanism in OLAP which allows it to achieve such performance is the use of aggregations. Aggregations are built from the fact table by changing the granularity on specific dimensions and aggregating up data along these dimensions, using an aggregate function (or aggregation function). The number of possible aggregations is determined by every possible combination of dimension granularities.
https://www.kaggle.com/datasets/conjuring92/wiki-stem-corpus
Consider the following contains function defined on Iterable (in particular, it accepts both Vector and List). def contains[A](l: Iterable[A], elem: A): Boolean = val n = l.size if n <= 5 then for i <- l do if i == elem then return true false else val (p0, p1) = parallel( contains(l.take(n / 2), elem), contains(l.drop(n / 2), elem) ) p0 || p1 Let $n$ be the size of l. Assume that drop and take run in $\Theta(1)$ on Vector and $\Theta(n)$ on List. What is the asymptotic work of contains if it is called on a List?
This can happen for at most 2K(x,y)-l = 2k different strings. These strings can be enumerated given k,l and hence x can be specified by its index in this enumeration. The corresponding program for x has size k + O(1). Theorem proved.
https://www.kaggle.com/datasets/conjuring92/wiki-stem-corpus
Consider the following contains function defined on Iterable (in particular, it accepts both Vector and List). def contains[A](l: Iterable[A], elem: A): Boolean = val n = l.size if n <= 5 then for i <- l do if i == elem then return true false else val (p0, p1) = parallel( contains(l.take(n / 2), elem), contains(l.drop(n / 2), elem) ) p0 || p1 Let $n$ be the size of l. Assume that drop and take run in $\Theta(1)$ on Vector and $\Theta(n)$ on List. What is the asymptotic work of contains if it is called on a List?
An exact cover problem is defined by the binary relation "contains" between subsets in S and elements in X. There are different equivalent ways to represent this relation.
https://www.kaggle.com/datasets/conjuring92/wiki-stem-corpus
In JOS, suppose a value is passed between two Envs. What is the minimum number of executed system calls?
Hence 0 ≤ i ≤ u, and 0 ≤ j ≤ u. Let A be the number of ways of assigning the j output calls to the m middle stage switches. Let B be the number of these assignments which result in blocking. This is the number of cases in which the remaining m−j middle stage switches coincide with m−j of the i input calls, which is the number of subsets containing m−j of these calls.
https://www.kaggle.com/datasets/conjuring92/wiki-stem-corpus
In JOS, suppose a value is passed between two Envs. What is the minimum number of executed system calls?
As an example of one of the more elaborate IPL-handling systems ever deployed, the VAX computer and associated VMS operating system supports 32 priority levels, from 0 to 31. Priorities 16 and above are for requests from external hardware, while values below 16 are available for software interrupts (used internally by the operating system to schedule its own activities). Not all values are actually used, but here are some of the more important ones: level 31 is for the "power-fail" interrupt.
https://www.kaggle.com/datasets/conjuring92/wiki-stem-corpus
What strace tool does?
strace is a diagnostic, debugging and instructional userspace utility for Linux. It is used to monitor and tamper with interactions between processes and the Linux kernel, which include system calls, signal deliveries, and changes of process state. The operation of strace is made possible by the kernel feature known as ptrace. Some Unix-like systems provide other diagnostic tools similar to strace, such as truss.
https://www.kaggle.com/datasets/conjuring92/wiki-stem-corpus
What strace tool does?
The most common use is to start a program using strace, which prints a list of system calls made by the program. This is useful if the program continually crashes, or does not behave as expected; for example using strace may reveal that the program is attempting to access a file which does not exist or cannot be read. An alternative application is to use the -p flag to attach to a running process. This is useful if a process has stopped responding, and might reveal, for example, that the process is blocking whilst attempting to make a network connection.
https://www.kaggle.com/datasets/conjuring92/wiki-stem-corpus
Consider the following grammar: S -> NP VP NP -> Det N VP -> VBe Adj NP -> NP PP VP -> V N -> Adj N VP -> VP PP Adj -> Adj PP V -> VBe Adj -> Ving PP -> Prep NP and the following lexicon: at:Prep is:VBe old:Adj black:Adj looking:Ving the:Det cat:N mouse:N under:Prep former:Adj nice:Adj with:Prep The above grammar over-generates. One reason is that some adjectives, e.g. former, can only occur before a noun. For instance the cat is former is incorrect in English (but accepted by the above grammar). Another reason for over-generation is that PPs do not combine with adjectives occurring before a noun. For instance: the looking at the mouse cat is black is incorrect in English (but accepted by the above grammar). Explain how the above grammar might be modified to prevent these two types of over-generation.
At the time, PPs were considered to immediately dominate P and NP, and APs and AdvPs were seen as dominating or being dominated by NPs. Ross' constraints apply to English, but they are not universally applicable to all languages. The fact that pied-piping varies so much across languages is a major challenge facing theories of syntax.
https://www.kaggle.com/datasets/conjuring92/wiki-stem-corpus
Consider the following grammar: S -> NP VP NP -> Det N VP -> VBe Adj NP -> NP PP VP -> V N -> Adj N VP -> VP PP Adj -> Adj PP V -> VBe Adj -> Ving PP -> Prep NP and the following lexicon: at:Prep is:VBe old:Adj black:Adj looking:Ving the:Det cat:N mouse:N under:Prep former:Adj nice:Adj with:Prep The above grammar over-generates. One reason is that some adjectives, e.g. former, can only occur before a noun. For instance the cat is former is incorrect in English (but accepted by the above grammar). Another reason for over-generation is that PPs do not combine with adjectives occurring before a noun. For instance: the looking at the mouse cat is black is incorrect in English (but accepted by the above grammar). Explain how the above grammar might be modified to prevent these two types of over-generation.
This rule requires the tense-marked verb of a main clause to occur in the second position of the sentence, even if that means it comes before the subject (e.g. there is an adverb at the beginning of the sentence). These speakers' ability to form sentences with V2 word order was compared against L2 learners who often overproduce the rigid SVO word order rather than applying the V2 rule. Although the study did not show evidence for attrition of syntax of the person's L1, there was evidence for attrition in the expatriates' morphology, especially in terms of agreement.
https://www.kaggle.com/datasets/conjuring92/wiki-stem-corpus
The goal of this question is to illustrate how to use transducers to implement a simplified version of the conjugation of English verbs. We will restrict to the conjugated forms corresponding to the indicative mode and the present tense. The idea is to build a transducer corresponding to the composition of three transducers: \item a transducer $T_1$ that defines the morphological paradigm, i.e. identifies the various cases to consider for conjugating a regular verb; \item a transducer $T_2$ that implements the identified cases in the form of transformation rules to be applied for the considered morphological paradigm; \item a transducer $T_3$ that handles all the exceptions to be implemented. Provide a formal definition for transducer $T_1$:
The following table presents a comparison of conjugations of the thematic present indicative of the verbal root *bʰer- of the English verb to bear and its reflexes in various early attested IE languages and their modern descendants or relatives, showing that all languages had in the early stage an inflectional verb system. While similarities are still visible between the modern descendants and relatives of these ancient languages, the differences have increased over time. Some IE languages have moved from synthetic verb systems to largely periphrastic systems. In addition, the pronouns of periphrastic forms are in parentheses when they appear.
https://www.kaggle.com/datasets/conjuring92/wiki-stem-corpus
The goal of this question is to illustrate how to use transducers to implement a simplified version of the conjugation of English verbs. We will restrict to the conjugated forms corresponding to the indicative mode and the present tense. The idea is to build a transducer corresponding to the composition of three transducers: \item a transducer $T_1$ that defines the morphological paradigm, i.e. identifies the various cases to consider for conjugating a regular verb; \item a transducer $T_2$ that implements the identified cases in the form of transformation rules to be applied for the considered morphological paradigm; \item a transducer $T_3$ that handles all the exceptions to be implemented. Provide a formal definition for transducer $T_1$:
In general, the following transformations take place: ô → o, o → u, æ → e, e → i, and a → e (the latter only in the perfect tenses), where the verbal noun features the first vowel but certain conjugations use the second. In addition, the verbs দেওয়া (dêoa , to give) and নেওয়া (nêoa, to take) switch between e, i, a, and æ. If verbs are classified by stem vowel and if the stem ends in a consonant or vowel, there are nine basic classes in which most verbs can be placed; all verbs in a class will follow the same pattern. A prototype verb from each of these classes will be used to demonstrate conjugation for that class; bold will be used to indicate mutation of the stem vowel.
https://www.kaggle.com/datasets/conjuring92/wiki-stem-corpus
According to your knowledge of English, split the following sentence into words and punctuation: M. O'Connel payed $ 12,000 (V.T.A. not included) with his credit card. Which of these words won't usually be in a standard lexicon? Justify your answer. Assuming separators are: whitespace, quote ('), full-stop/period (.), parenthesis, and that separators a kept as tokens, tokenize the former sentence. How would you propose to go from tokens to words? (propose concreat implementations)
Typically, lexical tokenization occurs at the word level. However, it is sometimes difficult to define what is meant by a "word". Often a tokenizer relies on simple heuristics, for example: Punctuation and whitespace may or may not be included in the resulting list of tokens. All contiguous strings of alphabetic characters are part of one token; likewise with numbers.
https://www.kaggle.com/datasets/conjuring92/wiki-stem-corpus
According to your knowledge of English, split the following sentence into words and punctuation: M. O'Connel payed $ 12,000 (V.T.A. not included) with his credit card. Which of these words won't usually be in a standard lexicon? Justify your answer. Assuming separators are: whitespace, quote ('), full-stop/period (.), parenthesis, and that separators a kept as tokens, tokenize the former sentence. How would you propose to go from tokens to words? (propose concreat implementations)
Lexical analysis mainly segments the input stream of characters into tokens, simply grouping the characters into pieces and categorizing them. However, the lexing may be significantly more complex; most simply, lexers may omit tokens or insert added tokens. Omitting tokens, notably whitespace and comments, is very common, when these are not needed by the compiler. Less commonly, added tokens may be inserted. This is done mainly to group tokens into statements, or statements into blocks, to simplify the parser.
https://www.kaggle.com/datasets/conjuring92/wiki-stem-corpus
Consider the following context-free grammar \(G\) (where \(\text{S}\) is the top-level symbol): \(R_{01}: \text{S} \rightarrow \text{NP VP}\) \(R_{02}: \text{NP} \rightarrow \text{NP0}\) \(R_{03}: \text{NP} \rightarrow \text{Det NP0}\) \(R_{04}: \text{NP0} \rightarrow \text{N}\) \(R_{05}: \text{NP0} \rightarrow \text{Adj N}\) \(R_{06}: \text{NP0} \rightarrow \text{NP0 PNP}\) \(R_{07}: \text{VP} \rightarrow \text{V}\) \(R_{08}: \text{VP} \rightarrow \text{V NP}\) \(R_{09}: \text{VP} \rightarrow \text{V NP PNP}\) \(R_{10}: \text{PNP} \rightarrow \text{Prep NP}\) complemented by the lexicon \(L\): a : Det blue : Adj, N drink : N, V drinks : N, V friends : N from : Prep gave : V letter : N my : Det neighbor : N nice : Adj, N of : Prep postman : N ran : V the : Det to : PrepHow many (syntactic and lexical) rules does the extended Chomsky Normal Form grammar equivalent to \(G\) contain, if produced as described in the parsing lecture?
In formal language theory, a context-free grammar, G, is said to be in Chomsky normal form (first described by Noam Chomsky) if all of its production rules are of the form: A → BC, or A → a, or S → ε,where A, B, and C are nonterminal symbols, the letter a is a terminal symbol (a symbol that represents a constant value), S is the start symbol, and ε denotes the empty string. Also, neither B nor C may be the start symbol, and the third production rule can only appear if ε is in L(G), the language produced by the context-free grammar G.: 92–93, 106 Every grammar in Chomsky normal form is context-free, and conversely, every context-free grammar can be transformed into an equivalent one which is in Chomsky normal form and has a size no larger than the square of the original grammar's size.
https://www.kaggle.com/datasets/conjuring92/wiki-stem-corpus
Consider the following context-free grammar \(G\) (where \(\text{S}\) is the top-level symbol): \(R_{01}: \text{S} \rightarrow \text{NP VP}\) \(R_{02}: \text{NP} \rightarrow \text{NP0}\) \(R_{03}: \text{NP} \rightarrow \text{Det NP0}\) \(R_{04}: \text{NP0} \rightarrow \text{N}\) \(R_{05}: \text{NP0} \rightarrow \text{Adj N}\) \(R_{06}: \text{NP0} \rightarrow \text{NP0 PNP}\) \(R_{07}: \text{VP} \rightarrow \text{V}\) \(R_{08}: \text{VP} \rightarrow \text{V NP}\) \(R_{09}: \text{VP} \rightarrow \text{V NP PNP}\) \(R_{10}: \text{PNP} \rightarrow \text{Prep NP}\) complemented by the lexicon \(L\): a : Det blue : Adj, N drink : N, V drinks : N, V friends : N from : Prep gave : V letter : N my : Det neighbor : N nice : Adj, N of : Prep postman : N ran : V the : Det to : PrepHow many (syntactic and lexical) rules does the extended Chomsky Normal Form grammar equivalent to \(G\) contain, if produced as described in the parsing lecture?
The dynamic programming algorithm requires the context-free grammar to be rendered into Chomsky normal form (CNF), because it tests for possibilities to split the current sequence into two smaller sequences. Any context-free grammar that does not generate the empty string can be represented in CNF using only production rules of the forms A → α {\displaystyle A\rightarrow \alpha } , A → B C {\displaystyle A\rightarrow BC} , and S → ε {\displaystyle S\to \varepsilon } where S {\displaystyle S} is the start symbol.
https://www.kaggle.com/datasets/conjuring92/wiki-stem-corpus
Explain the difference between inflectional and derivational morphology. Illustrate your explanation with concrete examples in English or French.
Derivation can be contrasted with inflection, in that derivation produces a new word (a distinct lexeme), whereas inflection produces grammatical variants (or forms) of the same word. Generally speaking, inflection applies in more or less regular patterns to all members of a part of speech (for example, nearly every English verb adds -s for the third person singular present tense), while derivation follows less consistent patterns (for example, the nominalizing suffix -ity can be used with the adjectives modern and dense, but not with open or strong). However, it is important to note that derivations and inflections can share homonyms, that being, morphemes that have the same sound, but not the same meaning.
https://www.kaggle.com/datasets/conjuring92/wiki-stem-corpus
Explain the difference between inflectional and derivational morphology. Illustrate your explanation with concrete examples in English or French.
Bound morphemes can be further classified as derivational or inflectional morphemes. The main difference between them is their function in relation to words.
https://www.kaggle.com/datasets/conjuring92/wiki-stem-corpus
Select the answer that correctly describes the differences between formal and natural languages. 
A formalization is correct if its explicit logical features fit the implicit logical features of the original sentence. The logical form of ordinary language sentences is often not obvious since there are many differences between natural languages and the formal languages used by logicians.
https://www.kaggle.com/datasets/conjuring92/wiki-stem-corpus
Select the answer that correctly describes the differences between formal and natural languages. 
A formalization is correct if its explicit logical features fit the implicit logical features of the original sentence. The logical form of ordinary language sentences is often not obvious since there are many differences between natural languages and the formal languages used by logicians.
https://www.kaggle.com/datasets/conjuring92/wiki-stem-corpus
You have been hired to evaluate an email monitoring system aimed at detecting potential security issues. The targeted goal of the application is to decide whether a given email should be further reviewed or not. You have been given the results of three different systems that have been evaluated on the same panel of 157 different emails. Here are the classification errors and their standard deviations: system 1 (error=0.079, stddev=0.026) system 2 (error=0.081, stddev=0.005) system 3 (error=0.118, stddev=0.004) What should be the minimal size of a test set to ensure, at a 95% confidence level, that a system has an error 0.02 lower (absolute difference) than system 3? Justify your answer.
E-mail spam problem is a common classification problem, in this problem, 57 features are used to classify spam e-mail and non-spam e-mail. Applying IJ-U variance formula to evaluate the accuracy of models with m=15,19 and 57. The results shows in paper( Confidence Intervals for Random Forests: The jackknife and the Infinitesimal Jackknife ) that m = 57 random forest appears to be quite unstable, while predictions made by m=5 random forest appear to be quite stable, this results is corresponding to the evaluation made by error percentage, in which the accuracy of model with m=5 is high and m=57 is low. Here, accuracy is measured by error rate, which is defined as: E r r o r R a t e = 1 N ∑ i = 1 N ∑ j = 1 M y i j , {\displaystyle ErrorRate={\frac {1}{N}}\sum _{i=1}^{N}\sum _{j=1}^{M}y_{ij},} Here N is also the number of samples, M is the number of classes, y i j {\displaystyle y_{ij}} is the indicator function which equals 1 when i t h {\displaystyle ith} observation is in class j, equals 0 when in other classes.
https://www.kaggle.com/datasets/conjuring92/wiki-stem-corpus
You have been hired to evaluate an email monitoring system aimed at detecting potential security issues. The targeted goal of the application is to decide whether a given email should be further reviewed or not. You have been given the results of three different systems that have been evaluated on the same panel of 157 different emails. Here are the classification errors and their standard deviations: system 1 (error=0.079, stddev=0.026) system 2 (error=0.081, stddev=0.005) system 3 (error=0.118, stddev=0.004) What should be the minimal size of a test set to ensure, at a 95% confidence level, that a system has an error 0.02 lower (absolute difference) than system 3? Justify your answer.
As data is entered, the system includes new rules; if we consider that this data can generalize the training data information, then we have to evaluate the system development and measure the system's ability to correctly predict the categories of new information. This step is simplified by separating the training data in a new series called "test data" that we will use to measure the error rate. As a general rule it is important to distinguish between types of errors (false positives and false negatives). For example, in the case on an aggregator of content for children, it doesn't have the same gravity to allow the passage of information not suitable for them, that shows violence or pornography, than the mistake to discard some appropriated information. To improve the system to lower error rates and have these systems with learning capabilities similar to humans we require development of systems that simulate human cognitive abilities, such as natural-language understanding, capturing meaning Common and other forms of advanced processing to achieve the semantics of information.
https://www.kaggle.com/datasets/conjuring92/wiki-stem-corpus
In an automated email router of a company, we want to make the distinction between three kind of emails: technical (about computers), financial, and the rest ('irrelevant'). For this we plan to use a Naive Bayes approach. What is the main assumption made by Naive Bayes classifiers? Why is it 'Naive'? We will consider the following three messages: The Dow industrials tumbled 120.54 to 10924.74, hurt by GM's sales forecast and two economic reports. Oil rose to $71.92. BitTorrent Inc. is boosting its network capacity as it prepares to become a centralized hub for legal video content. In May, BitTorrent announced a deal with Warner Brothers to distribute its TV and movie content via the BT platform. It has now lined up IP transit for streaming videos at a few gigabits per second Intel will sell its XScale PXAxxx applications processor and 3G baseband processor businesses to Marvell for $600 million, plus existing liabilities. The deal could make Marvell the top supplier of 3G and later smartphone processors, and enable Intel to focus on its core x86 and wireless LAN chipset businesses, the companies say. Suppose we have collected the following statistics $3^{3}$ about the word frequencies within the corresponding classes, where '0.00...' stands for some very small value: \begin{center} \begin{tabular}{|c|c|c|c|c|c|c|c|} \hline & technical & financial & irrelevant & & technical & financial & irrelevan \\ \hline $\$<$ number $>$ & 0.01 & 0.07 & 0.05 & deal & 0.01 & 0.02 & $0.00 \ldots$ \\ \hline Dow & $0.00 \ldots$ & 0.08 & $0.00 \ldots$ & forecast & $0.00 \ldots$ & 0.03 & 0.01 \\ \hline GM & $0.00 \ldots$ & 0.03 & $0.00 \ldots$ & gigabit & 0.03 & $0.00 \ldots$ & $0.00 \ldots$ \\ \hline IP & 0.03 & $0.00 \ldots$ & $0.00 \ldots$ & hub & 0.06 & $0.00 \ldots$ & 0.01 \\ \hline Intel & 0.02 & 0.02 & $0.00 \ldots$ & network & 0.04 & 0.01 & $0.00 \ldots$ \\ \hline business & 0.01 & 0.07 & 0.04 & processor & 0.07 & 0.01 & $0.00 \ldots$ \\ \hline capacity & 0.01 & $0.00 \ldots$ & $0.00 \ldots$ & smartphone & 0.04 & 0.04 & 0.01 \\ \hline chipset & 0.04 & 0.01 & $0.00 \ldots$ & wireless & 0.02 & 0.01 & $0.00 \ldots$ \\ \hline company & 0.01 & 0.04 & 0.05 & sen & re & . & . \\ \hline \end{tabular} \end{center} In a typical NLP architecture, where/how would you store this information? Explicit your answer, e.g. provide an illustrative example.
Naive Bayes classifiers are a popular statistical technique of e-mail filtering. They typically use bag-of-words features to identify email spam, an approach commonly used in text classification. Naive Bayes classifiers work by correlating the use of tokens (typically words, or sometimes other things), with spam and non-spam e-mails and then using Bayes' theorem to calculate a probability that an email is or is not spam. Naive Bayes spam filtering is a baseline technique for dealing with spam that can tailor itself to the email needs of individual users and give low false positive spam detection rates that are generally acceptable to users. It is one of the oldest ways of doing spam filtering, with roots in the 1990s.
https://www.kaggle.com/datasets/conjuring92/wiki-stem-corpus
In an automated email router of a company, we want to make the distinction between three kind of emails: technical (about computers), financial, and the rest ('irrelevant'). For this we plan to use a Naive Bayes approach. What is the main assumption made by Naive Bayes classifiers? Why is it 'Naive'? We will consider the following three messages: The Dow industrials tumbled 120.54 to 10924.74, hurt by GM's sales forecast and two economic reports. Oil rose to $71.92. BitTorrent Inc. is boosting its network capacity as it prepares to become a centralized hub for legal video content. In May, BitTorrent announced a deal with Warner Brothers to distribute its TV and movie content via the BT platform. It has now lined up IP transit for streaming videos at a few gigabits per second Intel will sell its XScale PXAxxx applications processor and 3G baseband processor businesses to Marvell for $600 million, plus existing liabilities. The deal could make Marvell the top supplier of 3G and later smartphone processors, and enable Intel to focus on its core x86 and wireless LAN chipset businesses, the companies say. Suppose we have collected the following statistics $3^{3}$ about the word frequencies within the corresponding classes, where '0.00...' stands for some very small value: \begin{center} \begin{tabular}{|c|c|c|c|c|c|c|c|} \hline & technical & financial & irrelevant & & technical & financial & irrelevan \\ \hline $\$<$ number $>$ & 0.01 & 0.07 & 0.05 & deal & 0.01 & 0.02 & $0.00 \ldots$ \\ \hline Dow & $0.00 \ldots$ & 0.08 & $0.00 \ldots$ & forecast & $0.00 \ldots$ & 0.03 & 0.01 \\ \hline GM & $0.00 \ldots$ & 0.03 & $0.00 \ldots$ & gigabit & 0.03 & $0.00 \ldots$ & $0.00 \ldots$ \\ \hline IP & 0.03 & $0.00 \ldots$ & $0.00 \ldots$ & hub & 0.06 & $0.00 \ldots$ & 0.01 \\ \hline Intel & 0.02 & 0.02 & $0.00 \ldots$ & network & 0.04 & 0.01 & $0.00 \ldots$ \\ \hline business & 0.01 & 0.07 & 0.04 & processor & 0.07 & 0.01 & $0.00 \ldots$ \\ \hline capacity & 0.01 & $0.00 \ldots$ & $0.00 \ldots$ & smartphone & 0.04 & 0.04 & 0.01 \\ \hline chipset & 0.04 & 0.01 & $0.00 \ldots$ & wireless & 0.02 & 0.01 & $0.00 \ldots$ \\ \hline company & 0.01 & 0.04 & 0.05 & sen & re & . & . \\ \hline \end{tabular} \end{center} In a typical NLP architecture, where/how would you store this information? Explicit your answer, e.g. provide an illustrative example.
In statistics, naive Bayes classifiers are a family of simple "probabilistic classifiers" based on applying Bayes' theorem with strong (naive) independence assumptions between the features (see Bayes classifier). They are among the simplest Bayesian network models, but coupled with kernel density estimation, they can achieve high accuracy levels.Naive Bayes classifiers are highly scalable, requiring a number of parameters linear in the number of variables (features/predictors) in a learning problem. Maximum-likelihood training can be done by evaluating a closed-form expression,: 718 which takes linear time, rather than by expensive iterative approximation as used for many other types of classifiers. In the statistics literature, naive Bayes models are known under a variety of names, including simple Bayes and independence Bayes. All these names reference the use of Bayes' theorem in the classifier's decision rule, but naive Bayes is not (necessarily) a Bayesian method.
https://www.kaggle.com/datasets/conjuring92/wiki-stem-corpus
Which of the following are parameters involved in the choice made by an order-1 HMM model for PoS tagging knowing that its output isthis/Pron is/V a/Det good/Adj question/Nand that neither "is" nor "question" can be adjectives, and that "question" can also not be a determiner.(Penalty for wrong ticks.)
Those tag questions which expect an affirmative answer may employ the particle xom in second position within the sentence. Comparing statement, yes/no question, and tag question expecting an affirmative answer: Dghes k'argi amindia, 'The weather is good today' Dghes k'argi amindia?, 'is the weather good today?' Dghes xom k'argi amindia?, 'the weather is good today, isn't it? 'These sentences contain an -a suffixed to the word amindi 'weather'.
https://www.kaggle.com/datasets/conjuring92/wiki-stem-corpus
Which of the following are parameters involved in the choice made by an order-1 HMM model for PoS tagging knowing that its output isthis/Pron is/V a/Det good/Adj question/Nand that neither "is" nor "question" can be adjectives, and that "question" can also not be a determiner.(Penalty for wrong ticks.)
The same method can, of course, be used to benefit from knowledge about the following words. More advanced ("higher-order") HMMs learn the probabilities not only of pairs but triples or even larger sequences. So, for example, if you've just seen a noun followed by a verb, the next item may be very likely a preposition, article, or noun, but much less likely another verb.
https://www.kaggle.com/datasets/conjuring92/wiki-stem-corpus
For each of the sub-questions of this question (next page), tick/check the corresponding box if the presented sentence is correct at the corresponding level (for a human). There will be a penalty for wrong boxes ticked/checked.Some sentences is hard understand to.
The respondent is required to click on the box next to the answer that corresponds to the desired choice. A checkmark will appear in the box once an answer is chosen. More than one answer can be selected. If there are many options, a simple matrix is recommended. When using check boxes, if more than one answer can be checked, it should be specified in the instructions. If “none of the above” is required, provide it with a radio button to prevent an erroneous check on this choice in case another answer has been chosen.
https://www.kaggle.com/datasets/conjuring92/wiki-stem-corpus
For each of the sub-questions of this question (next page), tick/check the corresponding box if the presented sentence is correct at the corresponding level (for a human). There will be a penalty for wrong boxes ticked/checked.Some sentences is hard understand to.
It occurs often in English in tag questions, as in "It's too late, isn't it?" If the tag question ("isn't it") is spoken with rising intonation, an answer is expected (the speaker is expressing doubt), while if it is spoken with falling intonation, no answer is necessarily expected and no doubt is being expressed. Sentences can also be marked as questions when they are written down.
https://www.kaggle.com/datasets/conjuring92/wiki-stem-corpus
You have been hired to evaluate an email monitoring system aimed at detecting potential security issues. The targeted goal of the application is to decide whether a given email should be further reviewed or not. You have been given the results of three different systems that have been evaluated on the same panel of 157 different emails. Here are the classification errors and their standard deviations: system 1 (error=0.079, stddev=0.026) system 2 (error=0.081, stddev=0.005) system 3 (error=0.118, stddev=0.004) Which system would you recommend? Why?
E-mail spam problem is a common classification problem, in this problem, 57 features are used to classify spam e-mail and non-spam e-mail. Applying IJ-U variance formula to evaluate the accuracy of models with m=15,19 and 57. The results shows in paper( Confidence Intervals for Random Forests: The jackknife and the Infinitesimal Jackknife ) that m = 57 random forest appears to be quite unstable, while predictions made by m=5 random forest appear to be quite stable, this results is corresponding to the evaluation made by error percentage, in which the accuracy of model with m=5 is high and m=57 is low. Here, accuracy is measured by error rate, which is defined as: E r r o r R a t e = 1 N ∑ i = 1 N ∑ j = 1 M y i j , {\displaystyle ErrorRate={\frac {1}{N}}\sum _{i=1}^{N}\sum _{j=1}^{M}y_{ij},} Here N is also the number of samples, M is the number of classes, y i j {\displaystyle y_{ij}} is the indicator function which equals 1 when i t h {\displaystyle ith} observation is in class j, equals 0 when in other classes.
https://www.kaggle.com/datasets/conjuring92/wiki-stem-corpus
You have been hired to evaluate an email monitoring system aimed at detecting potential security issues. The targeted goal of the application is to decide whether a given email should be further reviewed or not. You have been given the results of three different systems that have been evaluated on the same panel of 157 different emails. Here are the classification errors and their standard deviations: system 1 (error=0.079, stddev=0.026) system 2 (error=0.081, stddev=0.005) system 3 (error=0.118, stddev=0.004) Which system would you recommend? Why?
Once trained, the learned patterns would be applied to the test set of e-mails on which it had not been trained. The accuracy of the patterns can then be measured from how many e-mails they correctly classify. Several statistical methods may be used to evaluate the algorithm, such as ROC curves. If the learned patterns do not meet the desired standards, it is necessary to re-evaluate and change the pre-processing and data mining steps. If the learned patterns do meet the desired standards, then the final step is to interpret the learned patterns and turn them into knowledge.
https://www.kaggle.com/datasets/conjuring92/wiki-stem-corpus
Select the morpho-syntactic categories that do not carry much semantic content and are thus usually filtered-out from indexing.
See demonstrative. Note that some categories are regular and some are not. They may be regular or irregular also depending on languages.
https://www.kaggle.com/datasets/conjuring92/wiki-stem-corpus
Select the morpho-syntactic categories that do not carry much semantic content and are thus usually filtered-out from indexing.
Direct systems depend on the notion of filtered categories. For example, the category N, whose objects are natural numbers, and with exactly one morphism from n to m whenever n ≤ m {\displaystyle n\leq m} , is a filtered category.
https://www.kaggle.com/datasets/conjuring92/wiki-stem-corpus
Consider the following CFG \(\text{S} \rightarrow \text{NP VP PNP}\) \(\text{NP} \rightarrow \text{Det N}\) \(\text{NP} \rightarrow \text{Det Adj N}\) \(\text{VP} \rightarrow \text{V}\) \(\text{VP} \rightarrow \text{Aux Ving}\) \(\text{VP} \rightarrow \text{VP NP}\) \(\text{VP} \rightarrow \text{VP PNP}\) \(\text{PNP} \rightarrow \text{Prep NP}\) and the following lexicon: the:Det, red:Adj, cat:N, is:Aux, meowing:Ving, on:Prep, roof:N The next four questions ask you the content of a given cell of the chart used by the CYK algorithm (used here as a recognizer) for the input sentence the red cat is meowing on the roof Simply answer "empty'' if the corresponding cell is empty and use a comma to separate your answers when the cell contains several objects.What is the content of the cell at row 3 column 1 (indexed as in the lectures)?
This is an example grammar: S ⟶ NP VP VP ⟶ VP PP VP ⟶ V NP VP ⟶ eats PP ⟶ P NP NP ⟶ Det N NP ⟶ she V ⟶ eats P ⟶ with N ⟶ fish N ⟶ fork Det ⟶ a {\displaystyle {\begin{aligned}{\ce {S}}&\ {\ce {->NP\ VP}}\\{\ce {VP}}&\ {\ce {->VP\ PP}}\\{\ce {VP}}&\ {\ce {->V\ NP}}\\{\ce {VP}}&\ {\ce {->eats}}\\{\ce {PP}}&\ {\ce {->P\ NP}}\\{\ce {NP}}&\ {\ce {->Det\ N}}\\{\ce {NP}}&\ {\ce {->she}}\\{\ce {V}}&\ {\ce {->eats}}\\{\ce {P}}&\ {\ce {->with}}\\{\ce {N}}&\ {\ce {->fish}}\\{\ce {N}}&\ {\ce {->fork}}\\{\ce {Det}}&\ {\ce {->a}}\end{aligned}}} Now the sentence she eats a fish with a fork is analyzed using the CYK algorithm. In the following table, in P {\displaystyle P} , i is the number of the row (starting at the bottom at 1), and j is the number of the column (starting at the left at 1). For readability, the CYK table for P is represented here as a 2-dimensional matrix M containing a set of non-terminal symbols, such that Rk is in M {\displaystyle M} if, and only if, P {\displaystyle P} . In the above example, since a start symbol S is in M {\displaystyle M} , the sentence can be generated by the grammar.
https://www.kaggle.com/datasets/conjuring92/wiki-stem-corpus
Consider the following CFG \(\text{S} \rightarrow \text{NP VP PNP}\) \(\text{NP} \rightarrow \text{Det N}\) \(\text{NP} \rightarrow \text{Det Adj N}\) \(\text{VP} \rightarrow \text{V}\) \(\text{VP} \rightarrow \text{Aux Ving}\) \(\text{VP} \rightarrow \text{VP NP}\) \(\text{VP} \rightarrow \text{VP PNP}\) \(\text{PNP} \rightarrow \text{Prep NP}\) and the following lexicon: the:Det, red:Adj, cat:N, is:Aux, meowing:Ving, on:Prep, roof:N The next four questions ask you the content of a given cell of the chart used by the CYK algorithm (used here as a recognizer) for the input sentence the red cat is meowing on the roof Simply answer "empty'' if the corresponding cell is empty and use a comma to separate your answers when the cell contains several objects.What is the content of the cell at row 3 column 1 (indexed as in the lectures)?
Input: Received word y = ( y 0 , … , y 2 n − 1 ) {\displaystyle y=(y_{0},\dots ,y_{2^{n}-1})} For each i ∈ { 1 , … , n } {\displaystyle i\in \{1,\dots ,n\}}: Pick j ∈ { 0 , … , 2 n − 1 } {\displaystyle j\in \{0,\dots ,2^{n}-1\}} uniformly at random. Pick k ∈ { 0 , … , 2 n − 1 } {\displaystyle k\in \{0,\dots ,2^{n}-1\}} such that j + k = e i {\displaystyle j+k=e_{i}} , where e i {\displaystyle e_{i}} is the i {\displaystyle i} -th standard basis vector and j + k {\displaystyle j+k} is the bitwise xor of j {\displaystyle j} and k {\displaystyle k} . x i ← y j + y k {\displaystyle x_{i}\gets y_{j}+y_{k}} .Output: Message x = ( x 1 , … , x n ) {\displaystyle x=(x_{1},\dots ,x_{n})}
https://www.kaggle.com/datasets/conjuring92/wiki-stem-corpus
Give well chosen examples of applications that can be evaluated with the single metric derived from Precision/Recall and illustrate: • a situation where more weight should be given to Precision; • a situation where more weight should be given to Recall.
This raises the need for evaluation metrics which can quantify performance on large, ranked lists. LBD works have used metrics popular in Information Retrieval which include Precision, Recall, Area Under the Curve (AUC), Precision at k, Mean Average Precision (MAP) and others.The approach of Proposing new discoveries or treatments goes beyond replicating past discoveries or predicting time-sliced instances of a particular relationship and shows that a system is capable of being used in realistic situations. This is usually accompanied by peer-reviewed publication in the domain or vetting by a domain expert.
https://www.kaggle.com/datasets/conjuring92/wiki-stem-corpus
Give well chosen examples of applications that can be evaluated with the single metric derived from Precision/Recall and illustrate: • a situation where more weight should be given to Precision; • a situation where more weight should be given to Recall.
During the evaluation of WSD systems two main performance measures are used: Precision: the fraction of system assignments made that are correct Recall: the fraction of total word instances correctly assigned by a systemIf a system makes an assignment for every word, then precision and recall are the same, and can be called accuracy. This model has been extended to take into account systems that return a set of senses with weights for each occurrence.
https://www.kaggle.com/datasets/conjuring92/wiki-stem-corpus
The company finally decides to implement a hybrid model consisting of a 4-gram character model combined (independently) with a 3-gram word model.How many parameters would such a hybrid model have in total?Provide the answer in the form 10^A + 10^B (for instance, write "10^7 + 10^9").
This would give a model perplexity of 2190 per sentence. However, it is more common to normalize for sentence length. Thus, if the test sample's sentences comprised a total of 1,000 words, and could be coded using 7.95 bits per word, one could report a model perplexity of 27.95 = 247 per word. In other words, the model is as confused on test data as if it had to choose uniformly and independently among 247 possibilities for each word.
https://www.kaggle.com/datasets/conjuring92/wiki-stem-corpus
The company finally decides to implement a hybrid model consisting of a 4-gram character model combined (independently) with a 3-gram word model.How many parameters would such a hybrid model have in total?Provide the answer in the form 10^A + 10^B (for instance, write "10^7 + 10^9").
One gets n 2 − n 2 + n − 1 = 1 2 n 2 + 1 2 n − 1. {\displaystyle {{n^{2}-n} \over 2}+n-1={1 \over 2}n^{2}+{1 \over 2}n-1.} For example, for an amino acid sequence (there are 20 "standard" amino acids that make up proteins), one would find there are 209 parameters.
https://www.kaggle.com/datasets/conjuring92/wiki-stem-corpus
Give some concrete examples of NLP applications that might benefit from the semantic vectorial representations.
This approach was also extended to multilingual domains, fine entity typing and other problems. Moreover, beyond relying solely on representations, the computational approach has been extended to depend on transfer from other tasks, such as textual entailment and question answering.The original paper also points out that, beyond the ability to classify a single example, when a collection of examples is given, with the assumption that they come from the same distribution, it is possible to bootstrap the performance in a semi-supervised like manner (or transductive learning). Unlike standard generalization in machine learning, where classifiers are expected to correctly classify new samples to classes they have already observed during training, in ZSL, no samples from the classes have been given during training the classifier. It can therefore be viewed as an extreme case of domain adaptation.
https://www.kaggle.com/datasets/conjuring92/wiki-stem-corpus
Give some concrete examples of NLP applications that might benefit from the semantic vectorial representations.
Hans van Halteren, Jakub Zavrel, Walter Daelemans. 2001. Improving Accuracy in NLP Through Combination of Machine Learning Systems.
https://www.kaggle.com/datasets/conjuring92/wiki-stem-corpus
Consider the following lexicon \(L\): boy : Adj, N boys : N blue : Adj, N drink : N, V drinks : N, V Nice : Adj, N When using an order-1 HMM model (using \(L\)) to tag the word sequence:"Nice boys drink blue drinks"does the tag of drink depend on the tag of nice?
Sequence tagging is a class of problems prevalent in natural language processing, where input data are often sequences (e.g. sentences of text). The sequence tagging problem appears in several guises, e.g. part-of-speech tagging and named entity recognition. In POS tagging, for example, each word in a sequence must receive a "tag" (class label) that expresses its "type" of word: The main challenge of this problem is to resolve ambiguity: the word "sentence" can also be a verb in English, and so can "tagged". While this problem can be solved by simply performing classification of individual tokens, that approach does not take into account the empirical fact that tags do not occur independently; instead, each tag displays a strong conditional dependence on the tag of the previous word. This fact can be exploited in a sequence model such as a hidden Markov model or conditional random field that predicts the entire tag sequence for a sentence, rather than just individual tags, by means of the Viterbi algorithm.
https://www.kaggle.com/datasets/conjuring92/wiki-stem-corpus
Consider the following lexicon \(L\): boy : Adj, N boys : N blue : Adj, N drink : N, V drinks : N, V Nice : Adj, N When using an order-1 HMM model (using \(L\)) to tag the word sequence:"Nice boys drink blue drinks"does the tag of drink depend on the tag of nice?
In the mid-1980s, researchers in Europe began to use hidden Markov models (HMMs) to disambiguate parts of speech, when working to tag the Lancaster-Oslo-Bergen Corpus of British English. HMMs involve counting cases (such as from the Brown Corpus) and making a table of the probabilities of certain sequences. For example, once you've seen an article such as 'the', perhaps the next word is a noun 40% of the time, an adjective 40%, and a number 20%. Knowing this, a program can decide that "can" in "the can" is far more likely to be a noun than a verb or a modal.
https://www.kaggle.com/datasets/conjuring92/wiki-stem-corpus
Up to which linguistic processing level can each of the following sentences be considered as correct? The glass broke its leg, I no go rain, The cook put cherry stones in the cake, Cars flow beautifully; syntactic, pragmatic, syntactic, semantic, lexical
Several syntactic hypotheses can be considered at a time. The interactive model demonstrates an on-line interaction between the structural and lexical and phonetic levels of sentence processing. Each word, as it is heard in the context of normal discourse, is immediately entered into the processing system at all levels of description, and is simultaneously analyzed at all these levels in the light of whatever information is available at each level at that point in the processing of the sentence.
https://www.kaggle.com/datasets/conjuring92/wiki-stem-corpus
Up to which linguistic processing level can each of the following sentences be considered as correct? The glass broke its leg, I no go rain, The cook put cherry stones in the cake, Cars flow beautifully; syntactic, pragmatic, syntactic, semantic, lexical
Several syntactic hypotheses can be considered at a time. The interactive model demonstrates an on-line interaction between the structural and lexical and phonetic levels of sentence processing. Each word, as it is heard in the context of normal discourse, is immediately entered into the processing system at all levels of description, and is simultaneously analyzed at all these levels in the light of whatever information is available at each level at that point in the processing of the sentence.
https://www.kaggle.com/datasets/conjuring92/wiki-stem-corpus
Describe the main principles of the standard vector space model for semantics.
Models based on and extending the vector space model include: Generalized vector space model Latent semantic analysis Term Rocchio Classification Random indexing Search Engine Optimization
https://www.kaggle.com/datasets/conjuring92/wiki-stem-corpus
Describe the main principles of the standard vector space model for semantics.
1999. Foundations of Statistical Natural Language Processing. Cambridge, MA: MIT Press.
https://www.kaggle.com/datasets/conjuring92/wiki-stem-corpus
You are responsible for a project aiming at providing on-line recommendations to the customers of a on-line book selling company. The general idea behind this recommendation system is to cluster books according to both customers and content similarities, so as to propose books similar to the books already bought by a given customer. The core of the recommendation system is a clustering algorithm aiming at regrouping books likely to be appreciate by the same person. This clustering should not only be achieved based on the purchase history of customers, but should also be refined by the content of the books themselves. It's that latter aspect we want to address in this exam question. The chosen clustering algorithm is the dendrogram. What other algorithms could you propose for the same task? Briefly review advantages and disadvantages of each of them (including dendrograms). Which one would you recommend for the targeted task?
Recommender systems Recommender systems are designed to recommend new items based on a user's tastes. They sometimes use clustering algorithms to predict a user's preferences based on the preferences of other users in the user's cluster. Markov chain Monte Carlo methods Clustering is often utilized to locate and characterize extrema in the target distribution.
https://www.kaggle.com/datasets/conjuring92/wiki-stem-corpus
You are responsible for a project aiming at providing on-line recommendations to the customers of a on-line book selling company. The general idea behind this recommendation system is to cluster books according to both customers and content similarities, so as to propose books similar to the books already bought by a given customer. The core of the recommendation system is a clustering algorithm aiming at regrouping books likely to be appreciate by the same person. This clustering should not only be achieved based on the purchase history of customers, but should also be refined by the content of the books themselves. It's that latter aspect we want to address in this exam question. The chosen clustering algorithm is the dendrogram. What other algorithms could you propose for the same task? Briefly review advantages and disadvantages of each of them (including dendrograms). Which one would you recommend for the targeted task?
Recommender systems Recommender systems are designed to recommend new items based on a user's tastes. They sometimes use clustering algorithms to predict a user's preferences based on the preferences of other users in the user's cluster. Markov chain Monte Carlo methods Clustering is often utilized to locate and characterize extrema in the target distribution.
https://www.kaggle.com/datasets/conjuring92/wiki-stem-corpus
If there are {t} PoS tags, what is the maximum number of (not necessarily free) parameters the probabilistic model needs to consider to determine the best possible PoS tag sequence given a word sequence of length {w}, subjected to the limited lexical conditioning and limited scope for syntactic dependencies (1 neighbor) hypotheses.Give your answer as a numerical value (not as a formula).
A statistical tagger looks for the most probable tag for an ambiguously tagged text σ σ … σ {\displaystyle \sigma \sigma \ldots \sigma }: γ ∗ … γ ∗ = arg m a x γ ∈ T ( σ ) ⁡ p ( γ … γ σ … σ ) {\displaystyle \gamma ^{*}\ldots \gamma ^{*}=\operatorname {\arg \,max} _{\gamma \in T(\sigma )}p(\gamma \ldots \gamma \sigma \ldots \sigma )} Using Bayes formula, this is converted into: γ ∗ … γ ∗ = arg m a x γ ∈ T ( σ ) ⁡ p ( γ … γ ) p ( σ … σ γ … γ ) {\displaystyle \gamma ^{*}\ldots \gamma ^{*}=\operatorname {\arg \,max} _{\gamma \in T(\sigma )}p(\gamma \ldots \gamma )p(\sigma \ldots \sigma \gamma \ldots \gamma )} where p ( γ γ … γ ) {\displaystyle p(\gamma \gamma \ldots \gamma )} is the probability that a particular tag (syntactic probability) and p ( σ … σ γ … γ ) {\displaystyle p(\sigma \dots \sigma \gamma \ldots \gamma )} is the probability that this tag corresponds to the text σ … σ {\displaystyle \sigma \ldots \sigma } (lexical probability). In a Markov model, these probabilities are approximated as products. The syntactic probabilities are modelled by a first order Markov process: p ( γ γ … γ ) = ∏ t = 1 t = L p ( γ γ ) {\displaystyle p(\gamma \gamma \ldots \gamma )=\prod _{t=1}^{t=L}p(\gamma \gamma )} where γ {\displaystyle \gamma } and γ {\displaystyle \gamma } are delimiter symbols.
https://www.kaggle.com/datasets/conjuring92/wiki-stem-corpus
If there are {t} PoS tags, what is the maximum number of (not necessarily free) parameters the probabilistic model needs to consider to determine the best possible PoS tag sequence given a word sequence of length {w}, subjected to the limited lexical conditioning and limited scope for syntactic dependencies (1 neighbor) hypotheses.Give your answer as a numerical value (not as a formula).
This version of the halting problem is among the simplest, most-easily described undecidable decision problems: Given an arbitrary positive integer n and a list of n+1 arbitrary words P1,P2,...,Pn,Q on the alphabet {1,2,...,n}, does repeated application of the tag operation t: ijX → XPi eventually convert Q into a word of length less than 2? That is, does the sequence Q, t1(Q), t2(Q), t3(Q), ... terminate?
https://www.kaggle.com/datasets/conjuring92/wiki-stem-corpus
Select the statements that are true.A penalty will be applied to any incorrect answers selected.
In computer languages it is expected that any truth-valued expression be permitted as the selection condition rather than restricting it to be a simple comparison. In SQL, selections are performed by using WHERE definitions in SELECT, UPDATE, and DELETE statements, but note that the selection condition can result in any of three truth values (true, false and unknown) instead of the usual two. In SQL, general selections are performed by using WHERE definitions with AND, OR, or NOT operands in SELECT, UPDATE, and DELETE statements.
https://www.kaggle.com/datasets/conjuring92/wiki-stem-corpus
Select the statements that are true.A penalty will be applied to any incorrect answers selected.
Suppose a student is to write a multiple-choice test; for simplicity, assume the test is a list of statements which are either true or false. To prepare for the test, the student comes up with two games, or strategies: Game A: given a statement, answer "true". Game B: given a statement, answer "false".By sticking to Game A or B, the student will always answer true, or always answer false.
https://www.kaggle.com/datasets/conjuring92/wiki-stem-corpus
Your aim is to evaluate a movie review analysis system, the purpose of which is to determine whether a review is globally positive or negative. For each movie review, such a system outputs one of the following classes: positive and negative. To perform your evaluation, you collect a large set of reviews and have it annotated by two human annotators. This corpus contains 95% of negative reviews (this 95% ratio is for this first question only and may change in the next questions). What metrics do you think are appropriate to evaluate the system on this corpus? You will get a penalty for wrong ticks.
It is necessary for the critic to do so as some reviews are qualitative and do not grant a numeric score, making it impossible for the system to be automatic.The website keeps track of all the reviews counted for each film and calculates the percentage of positive reviews. Major recently released films can attract more than 400 reviews. If the positive reviews make up 60% or more, the film is considered "fresh".
https://www.kaggle.com/datasets/conjuring92/wiki-stem-corpus
Your aim is to evaluate a movie review analysis system, the purpose of which is to determine whether a review is globally positive or negative. For each movie review, such a system outputs one of the following classes: positive and negative. To perform your evaluation, you collect a large set of reviews and have it annotated by two human annotators. This corpus contains 95% of negative reviews (this 95% ratio is for this first question only and may change in the next questions). What metrics do you think are appropriate to evaluate the system on this corpus? You will get a penalty for wrong ticks.
Websites such as Rotten Tomatoes and Metacritic seek to improve the usefulness of film reviews by compiling them and assigning a score to each in order to gauge the general reception a film receives. Another aggregator is the Movie Review Query Engine, which is a large data storage on the internet that stores interviews, reviews about movies, news, and other kinds of materials that pertain to specific films. These areas of storage are not intended to help people find specific films or movie content that has aired on television, but the storages are able to help people find reliable film criticisms that can be used as readings for students.
https://www.kaggle.com/datasets/conjuring92/wiki-stem-corpus
You have been publishing a daily column for the Gazette over the last few years and have recently reached a milestone --- your 1000th column! Realizing you'd like to go skiing more often, you decide it might be easier to automate your job by training a story generation system on the columns you've already written. Then, whenever your editor pitches you a title for a column topic, you'll just be able to give the title to your story generation system, produce the text body of the column, and publish it to the website! Given that you have published 1000 columns at the Gazette, you have around 800 training examples that you can use for your system. Given the size of your dataset, do you think it would be helpful to pretrain your model on other text? Why or why not?
An individual or small business might have this publishing process: Brainstorm content ideas to publish, where to publish, and when to publish Write each piece of content based on the publication schedule Edit each piece of content Publish each piece of contentA larger group might have this publishing process: Brainstorm content ideas to publish, where to publish, and when to publish; include backup content items for each piece of content; include dates to determine whether to delay or kill each content item (for example, if a writer becomes ill or an interview subject is unavailable) Assign each piece of content based on the publication schedule Write each piece of content Review the first draft of each piece of content Give "go" or "no go" decision based on first draft edit and other criteria (then adjust the publishing schedule as needed) If you go, finish writing each piece of content and submit draft content to the layout team, so they can plan their work Perform final edit, copy edit, fact checking, and rewrites as needed Submit piece of content for review by legal team Make changes if or as needed based on legal input Submit piece of content formally to layout team for their creation of artwork to be included with the published content Post content on a development or test server and make final changes if needed Publish content on the production server or other mediaWhether the publishing process is simple or complex, the movement is forward and iterative. Publishers encounter and cross a number of hurdles before a piece of content appears in print, on a website or blog, or in a social media outlet like Twitter or Facebook. The details included and tracked in an editorial calendar depend upon the steps involved in publishing content for a publication, as well as what is useful to track. Too little or too much data make editorial calendars difficult to maintain and use. Some amount of tweaking of editorial calendar elements, while using the calendar to publish content, is required before they can be truly useful.
https://www.kaggle.com/datasets/conjuring92/wiki-stem-corpus
You have been publishing a daily column for the Gazette over the last few years and have recently reached a milestone --- your 1000th column! Realizing you'd like to go skiing more often, you decide it might be easier to automate your job by training a story generation system on the columns you've already written. Then, whenever your editor pitches you a title for a column topic, you'll just be able to give the title to your story generation system, produce the text body of the column, and publish it to the website! Given that you have published 1000 columns at the Gazette, you have around 800 training examples that you can use for your system. Given the size of your dataset, do you think it would be helpful to pretrain your model on other text? Why or why not?
The subject matter of the (now fortnightly, earlier weekly) magazine ranges from articles about techniques and tools to profiles of full-size prototypes of modelling subjects. The main content is, however, 'constructional articles' describing projects at various levels of detail. Such articles range from single pages to long-running series in successive or alternate issues, some of which can last for many months, if not years. These more detailed series generally appeal to a wider audience than those engaged in the project. It is often as much in the (often loosely) related anecdotes alongside as in the processes described.
https://www.kaggle.com/datasets/conjuring92/wiki-stem-corpus
For each of the following pairs, what kind of morphology is involved? cat+N => cats, break+V => breakable , freeze+V => frozen , translate+V => translation, modify+V => modifies ; inflectional, inflectional, derivational, inflectional, derivational
For example, in the word "cat", the component "cat" makes sense as does "at", but "at" does not mean the same thing as "cat". In this example, "ca" does not mean anything. Morphology is the study of words and how they are formed.
https://www.kaggle.com/datasets/conjuring92/wiki-stem-corpus
For each of the following pairs, what kind of morphology is involved? cat+N => cats, break+V => breakable , freeze+V => frozen , translate+V => translation, modify+V => modifies ; inflectional, inflectional, derivational, inflectional, derivational
Morphology is the study of word formation and structure. Words may undergo different morphological processes which are traditionally classified into two broad groups: derivation and inflection. Derivation is a process in which a new word is created from existing ones, with an adjustment to its meaning and often with a change of word class.
https://www.kaggle.com/datasets/conjuring92/wiki-stem-corpus
The first annotator rated {a} reviews as positive and the rest as negative. The second annotator rated {b} reviews as positive and the rest as negative. 80 reviews were rated as positive by both annotators. Compute the quality of the above reference using Cohen's Kappa.Give your answer as a numerical value to three decimal places.
Landis and Koch (1977) gave the following table for interpreting κ {\displaystyle \kappa } values for a 2-annotator 2-class example. This table is however by no means universally accepted. They supplied no evidence to support it, basing it instead on personal opinion. It has been noted that these guidelines may be more harmful than helpful, as the number of categories and subjects will affect the magnitude of the value. For example, the kappa is higher when there are fewer categories.
https://www.kaggle.com/datasets/conjuring92/wiki-stem-corpus
The first annotator rated {a} reviews as positive and the rest as negative. The second annotator rated {b} reviews as positive and the rest as negative. 80 reviews were rated as positive by both annotators. Compute the quality of the above reference using Cohen's Kappa.Give your answer as a numerical value to three decimal places.
Confusion matrix for two annotators, three categories {Yes, No, Maybe} and 45 items rated (90 ratings for 2 annotators): To calculate the expected agreement, sum marginals across annotators and divide by the total number of ratings to obtain joint proportions. Square and total these: To calculate observed agreement, divide the number of items on which annotators agreed by the total number of items. In this case, Pr ( a ) = 1 + 5 + 9 45 = 0.333. {\displaystyle \Pr(a)={\frac {1+5+9}{45}}=0.333.} Given that Pr(e) = 0.369, Scott's pi is then π = 0.333 − 0.369 1 − 0.369 = − 0.057. {\displaystyle \pi ={\frac {0.333-0.369}{1-0.369}}=-0.057.}
https://www.kaggle.com/datasets/conjuring92/wiki-stem-corpus
You have been publishing a daily column for the Gazette over the last few years and have recently reached a milestone --- your 1000th column! Realizing you'd like to go skiing more often, you decide it might be easier to automate your job by training a story generation system on the columns you've already written. Then, whenever your editor pitches you a title for a column topic, you'll just be able to give the title to your story generation system, produce the text body of the column, and publish it to the website! You consider using either a transformer or a recurrent neural network (RNN) as the underlying model for your text generator. Assuming there are no practical issues with selecting either one (such as the amount of data available), which one would you choose for this task? Give two reasons why.
Recently the rise of transformer models replacing more traditional RNN (LSTM) have provided a flexibility in the mapping of text sequences to text sequences of a different type, which is well suited to automatic summarization. This includes models such as T5 and Pegasus.
https://www.kaggle.com/datasets/conjuring92/wiki-stem-corpus
You have been publishing a daily column for the Gazette over the last few years and have recently reached a milestone --- your 1000th column! Realizing you'd like to go skiing more often, you decide it might be easier to automate your job by training a story generation system on the columns you've already written. Then, whenever your editor pitches you a title for a column topic, you'll just be able to give the title to your story generation system, produce the text body of the column, and publish it to the website! You consider using either a transformer or a recurrent neural network (RNN) as the underlying model for your text generator. Assuming there are no practical issues with selecting either one (such as the amount of data available), which one would you choose for this task? Give two reasons why.
The original paper on generative pre-training of a transformer-based language model was written by Alec Radford and his colleagues, and published in preprint on OpenAI's website on June 11, 2018. It showed how a generative model of language is able to acquire world knowledge and process long-range dependencies by pre-training on a diverse corpus with long stretches of contiguous text.
https://www.kaggle.com/datasets/conjuring92/wiki-stem-corpus
Consider the following context-free grammar \(G\) (where \(\text{S}\) is the top-level symbol): \(R_{01}: \text{S} \rightarrow \text{NP VP}\) \(R_{02}: \text{NP} \rightarrow \text{NP0}\) \(R_{03}: \text{NP} \rightarrow \text{Det NP0}\) \(R_{04}: \text{NP0} \rightarrow \text{N}\) \(R_{05}: \text{NP0} \rightarrow \text{Adj N}\) \(R_{06}: \text{NP0} \rightarrow \text{NP0 PNP}\) \(R_{07}: \text{VP} \rightarrow \text{V}\) \(R_{08}: \text{VP} \rightarrow \text{V NP}\) \(R_{09}: \text{VP} \rightarrow \text{V NP PNP}\) \(R_{10}: \text{PNP} \rightarrow \text{Prep NP}\) complemented by the lexicon \(L\): a : Det blue : Adj, N drink : N, V drinks : N, V friends : N from : Prep gave : V letter : N my : Det neighbor : N nice : Adj, N of : Prep postman : N ran : V the : Det to : PrepIf the notation \(T(w)\) is used to refer to the rule \(T \rightarrow w\), which of the following correspond to valid derivations according to the grammar \(G\)?(Penalty for wrong ticks.)
The grammar G = ( { S , A , B , C , D } , { a , b , c } , R , S ) {\displaystyle G=(\{S,A,B,C,D\},\{a,b,c\},R,S)} , with productions S → A B & D C {\displaystyle S\rightarrow AB\&DC} , A → a A | ϵ {\displaystyle A\rightarrow aA\ |\ \epsilon } , B → b B c | ϵ {\displaystyle B\rightarrow bBc\ |\ \epsilon } , C → c C | ϵ {\displaystyle C\rightarrow cC\ |\ \epsilon } , D → a D b | ϵ {\displaystyle D\rightarrow aDb\ |\ \epsilon } ,is conjunctive. A typical derivation is S ⇒ ( A B & D C ) ⇒ ( a A B & D C ) ⇒ ( a B & D C ) ⇒ ( a b B c & D C ) ⇒ ( a b c & D C ) ⇒ ( a b c & a D b C ) ⇒ ( a b c & a b C ) ⇒ ( a b c & a b c C ) ⇒ ( a b c & a b c ) ⇒ a b c {\displaystyle S\Rightarrow (AB\&DC)\Rightarrow (aAB\&DC)\Rightarrow (aB\&DC)\Rightarrow (abBc\&DC)\Rightarrow (abc\&DC)\Rightarrow (abc\&aDbC)\Rightarrow (abc\&abC)\Rightarrow (abc\&abcC)\Rightarrow (abc\&abc)\Rightarrow abc} It can be shown that L ( G ) = { a n b n c n: n ≥ 0 } {\displaystyle L(G)=\{a^{n}b^{n}c^{n}:n\geq 0\}} . The language is not context-free, proved by the pumping lemma for context-free languages.
https://www.kaggle.com/datasets/conjuring92/wiki-stem-corpus
Consider the following context-free grammar \(G\) (where \(\text{S}\) is the top-level symbol): \(R_{01}: \text{S} \rightarrow \text{NP VP}\) \(R_{02}: \text{NP} \rightarrow \text{NP0}\) \(R_{03}: \text{NP} \rightarrow \text{Det NP0}\) \(R_{04}: \text{NP0} \rightarrow \text{N}\) \(R_{05}: \text{NP0} \rightarrow \text{Adj N}\) \(R_{06}: \text{NP0} \rightarrow \text{NP0 PNP}\) \(R_{07}: \text{VP} \rightarrow \text{V}\) \(R_{08}: \text{VP} \rightarrow \text{V NP}\) \(R_{09}: \text{VP} \rightarrow \text{V NP PNP}\) \(R_{10}: \text{PNP} \rightarrow \text{Prep NP}\) complemented by the lexicon \(L\): a : Det blue : Adj, N drink : N, V drinks : N, V friends : N from : Prep gave : V letter : N my : Det neighbor : N nice : Adj, N of : Prep postman : N ran : V the : Det to : PrepIf the notation \(T(w)\) is used to refer to the rule \(T \rightarrow w\), which of the following correspond to valid derivations according to the grammar \(G\)?(Penalty for wrong ticks.)
Let us notate a formal grammar as G = ( N , Σ , P , S ) {\displaystyle G=(N,\Sigma ,P,S)} , with N {\displaystyle N} a set of nonterminal symbols, Σ {\displaystyle \Sigma } a set of terminal symbols, P {\displaystyle P} a set of production rules, and S ∈ N {\displaystyle S\in N} the start symbol. A string u ∈ ( N ∪ Σ ) ∗ {\displaystyle u\in (N\cup \Sigma )^{*}} directly yields, or directly derives to, a string v ∈ ( N ∪ Σ ) ∗ {\displaystyle v\in (N\cup \Sigma )^{*}} , denoted as u ⇒ v {\displaystyle u\Rightarrow v} , if v can be obtained from u by an application of some production rule in P, that is, if u = γ L δ {\displaystyle u=\gamma L\delta } and v = γ R δ {\displaystyle v=\gamma R\delta } , where ( L → R ) ∈ P {\displaystyle (L\to R)\in P} is a production rule, and γ , δ ∈ ( N ∪ Σ ) ∗ {\displaystyle \gamma ,\delta \in (N\cup \Sigma )^{*}} is the unaffected left and right part of the string, respectively. More generally, u is said to yield, or derive to, v, denoted as u ⇒ ∗ v {\displaystyle u\Rightarrow ^{*}v} , if v can be obtained from u by repeated application of production rules, that is, if u = u 1 ⇒ . .
https://www.kaggle.com/datasets/conjuring92/wiki-stem-corpus
Select all statements that are true.A penalty will be applied for any wrong answers.
In computer languages it is expected that any truth-valued expression be permitted as the selection condition rather than restricting it to be a simple comparison. In SQL, selections are performed by using WHERE definitions in SELECT, UPDATE, and DELETE statements, but note that the selection condition can result in any of three truth values (true, false and unknown) instead of the usual two. In SQL, general selections are performed by using WHERE definitions with AND, OR, or NOT operands in SELECT, UPDATE, and DELETE statements.
https://www.kaggle.com/datasets/conjuring92/wiki-stem-corpus
Select all statements that are true.A penalty will be applied for any wrong answers.
Then, all result sets returned by the executed statements must be fetched. The MySQL server allows having statements that do return result sets and statements that do not return result sets in one multiple statement. See examples in
https://www.kaggle.com/datasets/conjuring92/wiki-stem-corpus
The edit distance between “piece” and “peace” is(Penalty for wrong ticks)
In this case, two remote strings σ A {\displaystyle \sigma _{A}} and σ B {\displaystyle \sigma _{B}} need to be reconciled. Typically, it is assumed that these strings differ by up to a fixed number of edits (i.e. character insertions, deletions, or modifications). Then data synchronization is the process of reducing edit distance between σ A {\displaystyle \sigma _{A}} and σ B {\displaystyle \sigma _{B}} , up to the ideal distance of zero.
https://www.kaggle.com/datasets/conjuring92/wiki-stem-corpus
The edit distance between “piece” and “peace” is(Penalty for wrong ticks)
Arsenikk:, you seem to have added the length (as 372 km, later changed to 371) with this edit. Do you, or anyone, object to a change to one of the values outlined above?
https://www.kaggle.com/datasets/conjuring92/wiki-stem-corpus
It is often desirable to be able to express the performance of an NLP system in the form of a single number, which is not the case when the Precision/Recall framework is used. Indicate what scores can be used to convert Precision/Recall measures into a unique number. For each score, give the corresponding formula.
Precision and recall are combined using the harmonic mean in the following fashion, with recall weighted 9 times more than precision: F m e a n = 10 P R R + 9 P {\displaystyle F_{mean}={\frac {10PR}{R+9P}}} The measures that have been introduced so far only account for congruity with respect to single words but not with respect to larger segments that appear in both the reference and the candidate sentence. In order to take these into account, longer n-gram matches are used to compute a penalty p for the alignment. The more mappings there are that are not adjacent in the reference and the candidate sentence, the higher the penalty will be.
https://www.kaggle.com/datasets/conjuring92/wiki-stem-corpus
It is often desirable to be able to express the performance of an NLP system in the form of a single number, which is not the case when the Precision/Recall framework is used. Indicate what scores can be used to convert Precision/Recall measures into a unique number. For each score, give the corresponding formula.
It has been pointed out that precision is usually twinned with recall to overcome this problem , as the unigram recall of this example would be 3 / 6 {\displaystyle 3/6} or 2 / 7 {\displaystyle 2/7} . The problem being that as there are multiple reference translations, a bad translation could easily have an inflated recall, such as a translation which consisted of all the words in each of the references.To produce a score for the whole corpus, the modified precision scores for the segments are combined using the geometric mean multiplied by a brevity penalty to prevent very short candidates from receiving too high a score. Let r be the total length of the reference corpus, and c the total length of the translation corpus.
https://www.kaggle.com/datasets/conjuring92/wiki-stem-corpus
Consider an HMM Part-of-Speech tagger, the tagset of which contains, among others: DET, N, V, ADV and ADJ, and some of the parameters of which are: $$ \begin{gathered} P_{1}(\mathrm{a} \mid \mathrm{DET})=0.1, \quad P_{1}(\text { accurately } \mid \mathrm{ADV})=0.1, \quad P_{1}(\text { computer } \mid \mathrm{N})=0.1, \\ P_{1}(\text { process } \mid \mathrm{N})=0.095, \quad P_{1}(\text { process } \mid \mathrm{V})=0.005, \\ P_{1}(\text { programs } \mid \mathrm{N})=0.080, \quad P_{1}(\text { programs } \mid \mathrm{V})=0.020, \end{gathered} $$ \begin{center} \begin{tabular}{|c|c|c|c|c|c|c|} \hline & & \multicolumn{5}{|l|}{$\mathrm{Y} \rightarrow$} \\ \hline & & $\mathrm{DET}$ & N & V & ADJ & $\mathrm{ADV}$ \\ \hline \multirow[t]{5}{*}{$X \downarrow$} & $\mathrm{DET}$ & 0 & 0.55 & 0 & 0.02 & 0.03 \\ \hline & $\mathrm{N}$ & 0.01 & 0.10 & 0.08 & 0.01 & 0.02 \\ \hline & V & 0.16 & 0.11 & 0.06 & 0.08 & 0.08 \\ \hline & ADJ & 0.01 & 0.65 & 0 & 0.05 & 0 \\ \hline & ADV & 0.08 & 0.02 & 0.09 & 0.04 & 0.04 \\ \hline \end{tabular} \end{center} $P_{2}(\mathrm{Y} \mid \mathrm{X}):\left(\right.$ for instance $\left.P_{2}(\mathrm{~N} \mid \mathrm{DET})=0.55\right)$ and: $P_{3}(\mathrm{DET})=0.20, \quad P_{3}(\mathrm{~N})=0.06, \quad P_{3}(\mathrm{~V})=0.08, \quad P_{3}(\mathrm{ADV})=0.07, \quad P_{3}(\mathrm{ADJ})=0.02$. What are all the possible taggings of the sentence a computer process programs accurately
CLAWS, DeRose's and Church's methods did fail for some of the known cases where semantics is required, but those proved negligibly rare. This convinced many in the field that part-of-speech tagging could usefully be separated from the other levels of processing; this, in turn, simplified the theory and practice of computerized language analysis and encouraged researchers to find ways to separate other pieces as well. Markov Models became the standard method for the part-of-speech assignment.
https://www.kaggle.com/datasets/conjuring92/wiki-stem-corpus
Consider an HMM Part-of-Speech tagger, the tagset of which contains, among others: DET, N, V, ADV and ADJ, and some of the parameters of which are: $$ \begin{gathered} P_{1}(\mathrm{a} \mid \mathrm{DET})=0.1, \quad P_{1}(\text { accurately } \mid \mathrm{ADV})=0.1, \quad P_{1}(\text { computer } \mid \mathrm{N})=0.1, \\ P_{1}(\text { process } \mid \mathrm{N})=0.095, \quad P_{1}(\text { process } \mid \mathrm{V})=0.005, \\ P_{1}(\text { programs } \mid \mathrm{N})=0.080, \quad P_{1}(\text { programs } \mid \mathrm{V})=0.020, \end{gathered} $$ \begin{center} \begin{tabular}{|c|c|c|c|c|c|c|} \hline & & \multicolumn{5}{|l|}{$\mathrm{Y} \rightarrow$} \\ \hline & & $\mathrm{DET}$ & N & V & ADJ & $\mathrm{ADV}$ \\ \hline \multirow[t]{5}{*}{$X \downarrow$} & $\mathrm{DET}$ & 0 & 0.55 & 0 & 0.02 & 0.03 \\ \hline & $\mathrm{N}$ & 0.01 & 0.10 & 0.08 & 0.01 & 0.02 \\ \hline & V & 0.16 & 0.11 & 0.06 & 0.08 & 0.08 \\ \hline & ADJ & 0.01 & 0.65 & 0 & 0.05 & 0 \\ \hline & ADV & 0.08 & 0.02 & 0.09 & 0.04 & 0.04 \\ \hline \end{tabular} \end{center} $P_{2}(\mathrm{Y} \mid \mathrm{X}):\left(\right.$ for instance $\left.P_{2}(\mathrm{~N} \mid \mathrm{DET})=0.55\right)$ and: $P_{3}(\mathrm{DET})=0.20, \quad P_{3}(\mathrm{~N})=0.06, \quad P_{3}(\mathrm{~V})=0.08, \quad P_{3}(\mathrm{ADV})=0.07, \quad P_{3}(\mathrm{ADJ})=0.02$. What are all the possible taggings of the sentence a computer process programs accurately
CLAWS, DeRose's and Church's methods did fail for some of the known cases where semantics is required, but those proved negligibly rare. This convinced many in the field that part-of-speech tagging could usefully be separated from the other levels of processing; this, in turn, simplified the theory and practice of computerized language analysis and encouraged researchers to find ways to separate other pieces as well. Markov Models became the standard method for the part-of-speech assignment.
https://www.kaggle.com/datasets/conjuring92/wiki-stem-corpus
What are the different types of morphologies that can be considered? Briefly describe the main differences between them.
Functions defined at the morphomic level are of many qualitatively different types. One example is the different ways the perfect participle can be realised in English––sometimes, this form is created through suffixation, as in bitten and packed, sometimes through a process of ablaut, as in sung, and sometimes through a combination of these, such as broken, which uses ablaut as well as the suffix -n.Another is the division of lexemes into distinct inflectional classes. Inflectional classes present distinct morphological forms, but these distinctions bear no meaning beyond signalling inflectional patterns; they are internal to morphology, and thus morphomic. Martin Maiden's theory of morphomes has been mostly developed with regard to the Romance languages, where he identified many examples of morphomic stem distributions.A different typology of morphomic patterns has been put forth by Erich Round. He distinguishes rhizomorphomes, which are a property of roots (corresponding to the traditional notion of inflectional class), metamorphomes, which are a property of paradigms, a set of cells which behave in a particular way (corresponding to the morphome in Maiden's terms, such as patterns of stem distribution), and meromorphomes, which are a property of exponents, and have only been identified for now in Kayardild and related languages.
https://www.kaggle.com/datasets/conjuring92/wiki-stem-corpus
What are the different types of morphologies that can be considered? Briefly describe the main differences between them.
TARs also exhibit a range of morphologies, which are interpreted as representing different formative and evolutionary processes. Past efforts have been made to categorize TAR with classification systems primarily focusing on crest morphology. *Established in the literature but not recognized as a distinct morphology
https://www.kaggle.com/datasets/conjuring92/wiki-stem-corpus
Consider the following context-free grammar, where S is the top-level symbol, upper-case letters denotes non-terminals and lower case letters denotes terminals:S → T A S → B A S → A B S → b A → A C A → a T → A B B → b C → c Except the first one, the next questions are based on filling the cells of the chart used by the CYK algorithm for the input sequence acbac. Consider the chart with naming of the cells as follows: CYK is used here for both recognising and analysing purposes. Based on your computation of the CYK, how many parse trees can be constructed for acbac? Give your answer as a numerical value.
The grammar uses these terminal symbols but does not define them. They are always leaf nodes (at the bottom bushy end) of the parse tree. The capitalized terms like Sums are nonterminal symbols.
https://www.kaggle.com/datasets/conjuring92/wiki-stem-corpus
Consider the following context-free grammar, where S is the top-level symbol, upper-case letters denotes non-terminals and lower case letters denotes terminals:S → T A S → B A S → A B S → b A → A C A → a T → A B B → b C → c Except the first one, the next questions are based on filling the cells of the chart used by the CYK algorithm for the input sequence acbac. Consider the chart with naming of the cells as follows: CYK is used here for both recognising and analysing purposes. Based on your computation of the CYK, how many parse trees can be constructed for acbac? Give your answer as a numerical value.
The grammar uses these terminal symbols but does not define them. They are always at the bottom bushy end of the parse tree. The capitalized terms like Sums are nonterminal symbols.
https://www.kaggle.com/datasets/conjuring92/wiki-stem-corpus
In the above, what is the chance agreement between the two annotators?Give your answer as a numerical value to three decimal places.
Confusion matrix for two annotators, three categories {Yes, No, Maybe} and 45 items rated (90 ratings for 2 annotators): To calculate the expected agreement, sum marginals across annotators and divide by the total number of ratings to obtain joint proportions. Square and total these: To calculate observed agreement, divide the number of items on which annotators agreed by the total number of items. In this case, Pr ( a ) = 1 + 5 + 9 45 = 0.333. {\displaystyle \Pr(a)={\frac {1+5+9}{45}}=0.333.} Given that Pr(e) = 0.369, Scott's pi is then π = 0.333 − 0.369 1 − 0.369 = − 0.057. {\displaystyle \pi ={\frac {0.333-0.369}{1-0.369}}=-0.057.}
https://www.kaggle.com/datasets/conjuring92/wiki-stem-corpus
In the above, what is the chance agreement between the two annotators?Give your answer as a numerical value to three decimal places.
{\displaystyle \ {\frac {1}{(1+j\omega {\hat {\tau _{1}}})(1+j\omega {\hat {\tau _{2}}})}}\ .} Of course agreement is good when the assumption τ1 >> τ2 is accurate.
https://www.kaggle.com/datasets/conjuring92/wiki-stem-corpus
You have been hired to evaluate an email monitoring system aimed at detecting potential security issues. The targeted goal of the application is to decide whether a given email should be further reviewed or not. Give four standard measures usually considered for the evaluation of such a system? Explain their meaning. Briefly discuss their advantages/drawbacks.
"This is a benefit because it provides an unbiased method of performance evaluation and prevents the interference of a manager's feelings in an employee's review" (Mishra and Crampton, 1998). Management can review an employee's performance by checking the surveillance to detect and potentially prevent problems". Email monitoring gives employers the ability to look at email messages sent or received by their employees.
https://www.kaggle.com/datasets/conjuring92/wiki-stem-corpus
You have been hired to evaluate an email monitoring system aimed at detecting potential security issues. The targeted goal of the application is to decide whether a given email should be further reviewed or not. Give four standard measures usually considered for the evaluation of such a system? Explain their meaning. Briefly discuss their advantages/drawbacks.
Common Criteria evaluations are performed on computer security products and systems. Target of Evaluation (TOE) – the product or system that is the subject of the evaluation. The evaluation serves to validate claims made about the target. To be of practical use, the evaluation must verify the target's security features.
https://www.kaggle.com/datasets/conjuring92/wiki-stem-corpus
Consider the following toy corpus: the cat cut the hat What is the probability of the following sequences, if the parameters are estimated using MLE (maximum-likelihood estimation) on the above corpus (make use of a calculator or even a short program): - cutthechat - cut the chat Fully justify your answer.
A statistical tagger looks for the most probable tag for an ambiguously tagged text σ σ … σ {\displaystyle \sigma \sigma \ldots \sigma }: γ ∗ … γ ∗ = arg m a x γ ∈ T ( σ ) ⁡ p ( γ … γ σ … σ ) {\displaystyle \gamma ^{*}\ldots \gamma ^{*}=\operatorname {\arg \,max} _{\gamma \in T(\sigma )}p(\gamma \ldots \gamma \sigma \ldots \sigma )} Using Bayes formula, this is converted into: γ ∗ … γ ∗ = arg m a x γ ∈ T ( σ ) ⁡ p ( γ … γ ) p ( σ … σ γ … γ ) {\displaystyle \gamma ^{*}\ldots \gamma ^{*}=\operatorname {\arg \,max} _{\gamma \in T(\sigma )}p(\gamma \ldots \gamma )p(\sigma \ldots \sigma \gamma \ldots \gamma )} where p ( γ γ … γ ) {\displaystyle p(\gamma \gamma \ldots \gamma )} is the probability that a particular tag (syntactic probability) and p ( σ … σ γ … γ ) {\displaystyle p(\sigma \dots \sigma \gamma \ldots \gamma )} is the probability that this tag corresponds to the text σ … σ {\displaystyle \sigma \ldots \sigma } (lexical probability). In a Markov model, these probabilities are approximated as products. The syntactic probabilities are modelled by a first order Markov process: p ( γ γ … γ ) = ∏ t = 1 t = L p ( γ γ ) {\displaystyle p(\gamma \gamma \ldots \gamma )=\prod _{t=1}^{t=L}p(\gamma \gamma )} where γ {\displaystyle \gamma } and γ {\displaystyle \gamma } are delimiter symbols.
https://www.kaggle.com/datasets/conjuring92/wiki-stem-corpus
Consider the following toy corpus: the cat cut the hat What is the probability of the following sequences, if the parameters are estimated using MLE (maximum-likelihood estimation) on the above corpus (make use of a calculator or even a short program): - cutthechat - cut the chat Fully justify your answer.
Let c ( w , w ′ ) {\displaystyle c(w,w')} be the number of occurrences of the word w {\displaystyle w} followed by the word w ′ {\displaystyle w'} in the corpus. The equation for bigram probabilities is as follows: p K N ( w i | w i − 1 ) = max ( c ( w i − 1 , w i ) − δ , 0 ) ∑ w ′ c ( w i − 1 , w ′ ) + λ w i − 1 p K N ( w i ) {\displaystyle p_{KN}(w_{i}|w_{i-1})={\frac {\max(c(w_{i-1},w_{i})-\delta ,0)}{\sum _{w'}c(w_{i-1},w')}}+\lambda _{w_{i-1}}p_{KN}(w_{i})} Where the unigram probability p K N ( w i ) {\displaystyle p_{KN}(w_{i})} depends on how likely it is to see the word w i {\displaystyle w_{i}} in an unfamiliar context, which is estimated as the number of times it appears after any other word divided by the number of distinct pairs of consecutive words in the corpus: p K N ( w i ) = | { w ′: 0 < c ( w ′ , w i ) } | | { ( w ′ , w ″ ): 0 < c ( w ′ , w ″ ) } | {\displaystyle p_{KN}(w_{i})={\frac {|\{w':0
https://www.kaggle.com/datasets/conjuring92/wiki-stem-corpus
Select which statements are true about the CYK algorithm.A penalty will be applied for any incorrect answers.
Note that the term 'CYK algorithm' describes the CYK variant of the inside algorithm that finds an optimal parse tree for a sequence using a PCFG. It extends the actual CYK algorithm used in non-probabilistic CFGs.The inside algorithm calculates α ( i , j , v ) {\displaystyle \alpha (i,j,v)} probabilities for all i , j , v {\displaystyle i,j,v} of a parse subtree rooted at W v {\displaystyle W_{v}} for subsequence x i , . .
https://www.kaggle.com/datasets/conjuring92/wiki-stem-corpus
Select which statements are true about the CYK algorithm.A penalty will be applied for any incorrect answers.
This either leads to a contradiction and a backtracking step, or, if no contradiction is derived, it follows that the choice was a correct one that leads to a satisfying assignment. Therefore, the algorithm either correctly finds a satisfying assignment or it correctly determines that the input is unsatisfiable.Even et al. did not describe in detail how to implement this algorithm efficiently. They state only that by "using appropriate data structures in order to find the implications of any decision", each step of the algorithm (other than the backtracking) can be performed quickly.
https://www.kaggle.com/datasets/conjuring92/wiki-stem-corpus
Select all statements that are true.A penalty will be applied for any wrong answers.
In computer languages it is expected that any truth-valued expression be permitted as the selection condition rather than restricting it to be a simple comparison. In SQL, selections are performed by using WHERE definitions in SELECT, UPDATE, and DELETE statements, but note that the selection condition can result in any of three truth values (true, false and unknown) instead of the usual two. In SQL, general selections are performed by using WHERE definitions with AND, OR, or NOT operands in SELECT, UPDATE, and DELETE statements.
https://www.kaggle.com/datasets/conjuring92/wiki-stem-corpus
Select all statements that are true.A penalty will be applied for any wrong answers.
Then, all result sets returned by the executed statements must be fetched. The MySQL server allows having statements that do return result sets and statements that do not return result sets in one multiple statement. See examples in
https://www.kaggle.com/datasets/conjuring92/wiki-stem-corpus