Data Acquisition, Extraction & Storage β€” ENS / Inria / PSL

Lecture 1 Recap Q&A

πŸ”’ Answers locked
Q1

What is Information Retrieval?

How would you define Information Retrieval (IR)? Give an example of an IR system you use every day.

Q2

Generalising the F-score

An IR system returns 80 documents; 60 are relevant. The database contains 200 relevant documents.

(a) Compute Precision $P$ and Recall $R$.

(b) The $F_1$ score is the harmonic mean of $P$ and $R$: $F_1 = \dfrac{2PR}{P+R}$. Propose a general family $F_\beta$ where $\beta$ controls how much more important recall is than precision. Derive from the weighted harmonic mean.

(c) In a medical triage system, surfacing an irrelevant document is twice as costly as missing a relevant one. Find $\beta$ and compute the score.

Q3

TF-IDF

What are the two principles behind TF-IDF? Why is it not enough to simply count how many times a word appears in a document?

Q4

Which Similarity Measure Should You Use?

You want to rank documents by similarity to a query $q$. Each is a TF-IDF vector in $\mathbb{R}^V$. Three proposals:

  • A β€” Euclidean distance: $d_E(x,y)=\|x-y\|_2$
  • B β€” Normalised Euclidean: $\hat{x}=x/\|x\|_2$, then $d_N(x,y)=\|\hat{x}-\hat{y}\|_2$
  • C β€” Cosine similarity: $\cos(x,y)=\dfrac{x\cdot y}{\|x\|_2\|y\|_2}$

(a) Which measures are appropriate and which ones are not?

Q5

The Limits of TF-IDF for the Web

Is using cosine similarity on TF-IDF representation an appropriate choice for ranking web documents based on relevance? Cite at least two alternatives.

Q6

About PageRank

PageRank iterates $\pi\leftarrow M\pi$ where $M=d\tilde{G}+(1-d)U$. Here $G$ is the transition matrix: $G_{ij}=1/\deg^+(j)$ if $j\to i$, else $0$ (the column-normalised transpose of the adjacency matrix). $\tilde{G}$ is $G$ with dangling nodes repaired (i.e., probability of leaving a dangling node is uniform to any other node in the graph).

(a) Prove $M$ is column-stochastic and conclude $\pi$ stays a valid probability vector.

(b) Give a 3-node example where raw $G$ causes the computation to fail, with numerical evidence.

Q7

Web Crawling Basics

What are the two fundamental questions any web crawler must answer? What data structures are used to address each one?

Q8

MinHash vs. Random Sampling of Shingles

To estimate Jaccard $J(A,B)=|A\cap B|/|A\cup B|$, two students propose:

  • Student 1 (Sampling): Draw samples $S_A,S_B$ of size $k$. Estimate $\hat{J}_S=|S_A\cap S_B|/|S_A\cup S_B|$.
  • Student 2 (MinHash): Use $k$ hash functions; estimate $\hat{J}_{\text{MH}}=\tfrac{1}{k}\sum_i\mathbf{1}[m_i(A)=m_i(B)]$.

(a) Prove $\Pr[m(A)=m(B)]=J(A,B)$ for one MinHash function.

(b) Derive $\operatorname{MSE}(\hat{J}_{\text{MH}})$ and show MinHash converges to $J$.

(c) Let $n=|A|=|B|$. Derive the bias of $\hat{J}_S$ and show MinHash converges faster.

Q9

Crawl Ordering Policy

Define weighted coverage $\text{WC}(t)=\sum_{p\in R(t)}w(p)$ where $R(t)$ is the set of pages crawled by time $t$.

(a) For general-purpose indexing, propose a principled choice of $w(p)$ and justify it.

(b) What practical complication arises, and how can it be worked around?

Q10

Designing a Wikipedia Path Crawler

You want to find a path from "Python (Programming language)" to "Edgar F. Codd" on Wikipedia. You can only start from the first node (i.e., the Python Wikipedia page).:

  • What kind of graph does Wikipedia form?
  • Propose a solution to find a path (the shortest?).