Monday, 30 March 2015

Week 2 Guiding Questions

What is the typical architecture of a text retrieval system?
A typical architecture of a text retrieval system includes
              - tokenizer -> indexer (offline)
              - tokenizer -> scorer (online)
              - feedback process (offline and online)

What is an inverted index?
Inverted index is a list of documents that match every term in the vocabulary. It is the dominating indexing method for supporting basic search algorithms. 

Why is it desirable for compressing an inverted index?
Inverted index compression is desirable to help improve speed because I/O takes more time than CPU, when compressing, the size will be smaller so we can reduce I/O not to mention saving disk space. 

How can we create an inverted index when the collection of documents does not fit into the memory?
When the collection does not fit into memory, we use sort-based methods on the disk.  
Sort-based methods:
– Step 1: Collect local (termID, docID, freq) tuples
– Step 2: Sort local tuples (to make “runs”)
– Step 3: Pair-wise merge runs
– Step 4: Output inverted file

How can we leverage an inverted index to score documents quickly?
 Exploit inverted index to accumulate scores for documents matching a query term
 Exploit Zipf’s law to avoid touching many documents not matching any query term

Why is evaluation so critical for research and application development in text retrieval?
Reason 1: Assess the actual utility of a TR system
Reason 2: Compare different systems and methods

How does Cranfield evaluation methodology work?
Cranfield evaluation methodolgy works by building reusable test collections & defining measures 

How do we evaluate a set of retrieved documents?
Precision and Recall are the basic measures to evaluate a set of retrieved documents.

Precision to what extent all retrieved results are relevant 
Recall measures the completeness of coverage of relevant documents

Precision: are the retrieved results all relevant?
Recall: have all the relevant documents been retrieved? 

How do you compute precision, recall, and F1?
Below are the formula to compute precision, recall and F1.

















How do we evaluate a ranked list of search results?
We evaluate ranked list of search results by looking at precision and recall at different cut offs (where user will stop).  We also compare PR curves which can showcase the utility of the a TR system between compared systems. We also use a single number called average precision that would accurately depict which one is better. Average precision applies to one query(in contrast to mean average precision) and it is very sensitive to slight changes in PR values hence it is good to use.

How do you compute average precision? 
We compute average precision by getting the sum all precision values at distinct recall levels and divide it by the total number of relevant documents in the collection. 

How do you compute mean average precision (MAP) and geometric mean average precision (gMAP)?
MAP is computed by getting the arithmetic mean of average precision over a set of queries
gMAP is computed by getting the geometric mean of average precision over a set of queries

gMAP tends to be affected more by low values(in contrast to MAP) which are queries that do not have good performance. If you think of improving search engines for difficult queries, gMAP is preferred. User decides preference between MAP and gMAP.

What is mean reciprocal rank?
Mean reciprocal rank is the average reciprocal rank over a set of topics. Reciprocal rank = 1/r
where r is the rank position of the single relevant doc.

Why is MAP more appropriate than precision at k documents when comparing two retrieval methods?
MAP is more appropriate to use as it considers combination of precision and recall and it results to a more sensitivity to the rank of every relevant document.

Why is precision at k documents more meaningful than average precision from a user’s perspective?
Precision at k documents is more meaningful than average precision from a user's perspective because it is the actual precision value assigned to each document. Average precision may be misleading.    

How can we evaluate a ranked list of search results using multi-level relevance judgments?
We can evaluate a ranked list of search results using multi-level relevance judgments by using nDCG.
Main idea of nDCG @k documents
– Measure the total utility of the top k documents(cut off) to a user
– Utility of a lowly ranked document is discounted
– Normalized to ensure comparability across queries 

How do you compute normalized discounted cumulative gain (nDCG)?
You compute nDCG by DCG@k documents 
divided by IdealDCG@k documents

Why is normalization necessary in nDCG? Does MAP need a similar normalization?
Normalization is necessary in order to ensure compatibility across queries.MAP does not evaluate multi-level judgment so it does not need similar normalization process.  

Why is it important to perform a statistical significance test when we compare the retrieval accuracies of two search engine systems?
We need to do statistical significance test to see the actual distribution of precision at k documents. Also, to assess the variance of different queries. This is because average precision may be misleading.
   
Key Phrases/Concepts
- Inverted index; postings
- Binary coding; unary coding; gamma-coding; d-gap
- Zipf’s law
- Cranfield evaluation methodology
- Precision; recall
- Average precision; mean average precision (MAP); geometric mean average precision (gMAP)
- Reciprocal rank; mean reciprocal rank
- F-measure
- Normalized discounted cumulative gain (nDCG)
- Statistical significance test

Saturday, 21 March 2015

Week 1 Guiding Questions

What does a computer have to do in order to understand a natural language sentence?
          In order to understand a natural language sentence, computers need to do the following:
                 1. Lexical Analysis (part-of-speech tagging) - noun, verb, etc
                 2. Syntactic Analysis (parsing) - noun phrase, verb phrase, etc 
                 3. Semantic Analysis - use of symbols to denote structure and give partial meaning to the sentence.
                      Examples
                         - Entity/relation extraction 
                         - Word sense disambiguation 
                         - Sentiment analysis 
                 4. Inference - infer some extra information based on text understanding  
                 5. Pragmatic Analysis (speech act) - understand the speech act of a sentence  

What is ambiguity?
                 Ambiguity is overloading same word with different meanings.  
                 
Why is natural language processing (NLP) difficult for computers?
                 NLP is difficult for computers due to ambiguities
                    1. Word-level ambiguity (eg. “design” can be a noun or a verb)
                    2. Syntactic ambiguity (eg “A man saw a boy with a telescope.”) 
                    3. Anaphora resolution (eg. “John persuaded Bill to buy a TV for himself.”)
                    4. Presupposition (“He has quit smoking.” implies that he smoked before.)

What is bag-of-words representation? Why do modern search engines use this simple representation of text?
                Bag-of-words representation is keeping all individual/duplicated words but will ignore the order of words. Search engines use bag-of-words because normally if the search results show one or more matches of the search string, it is most likely the match.  

What are the two modes of text information access? Which mode does a Web search engine such as Google support?
                Two modes of text information access

                1. Pull Mode (search engines)

                           - Users take initiative 
                           - Ad hoc information            

                2. Push Mode (recommender systems)

                           - Systems take initiative 
                           - Stable information need or system has good knowledge about a user’s need 

                Web search engine such as Google uses the Pull Mode.

                Push Mode example is news subscription depending on interest.

When is browsing more useful than querying to help a user find relevant information?
                Browsing works well when the user wants to explore information in a certain topic, doesn’t know what keywords to use, or can’t conveniently enter a query

Why is a text retrieval task defined as a ranking task?
                 A text retrieval task is defined as a ranking task because it involves returning a ranked list of documents relevant to the given query.

What is a retrieval model?
                 A retrieval model is the formalization of relevance. It is a computational definition of relevance.  

What are the two assumptions made by the Probability Ranking Principle?
Probability Ranking Principle is the optimal strategy under the following two assumptions:
      1. The utility of a document (to a user) is independent of the utility of any other document
      2. A user would browse the results sequentially

What is the Vector Space Retrieval Model? How does it work?
Vector Space Retrieval Model is a framework which includes representation of a set of documents as vectors in a common vector space. 

It works by having terms representing a doc/query. It decides relevance through similarity of query and document. 



How do we define the dimensions of the Vector Space Model?
We define the dimensions of the Vector Space Model using each word in our vocabulary which is basically Bag of Words(BOW). 

What are some different ways to place a document as a vector in the vector space?
We can place a document as a vector in the vector space by some strategies below: 
       1. Using a 0/1 Bit Vector representation where 1 denotes query term presence and 0 denotes query term absence in the document
       2. Using Term Frequency where it denotes the number of times the query term occurs in a document. 
       3. Using IDF weighting which is giving more preference to a word which occurred many times in the document but infrequently in the whole collection.

What is Term Frequency (TF)?
Term Frequency is the number of times a query term occurs in a document. 

What is TF Transformation?
TF Transformation is the process of restricting the contribution of the high count of terms to the overall weighting.

What is Document Frequency (DF)?
Document frequency is the count of documents that contain a particular term. 


What is Inverse Document Frequency (IDF)?
Inverse Document Frequency is when a term that does not occur in many documents. Typically, the higher the IDF the more relevant is the document.

What is TF-IDF Weighting?
TF-IDF weighting is giving more preference to a word which occurred many times in the document but infrequently in the whole collection.

Why do we need to penalize long documents in text retrieval?
We should penalize long documents because they naturally have better chances to match any query.

What is pivoted document length normalization?
Pivoted document length normalization is using the average document length as a 'pivot'(ie. reference point) to determine whether to penalize or reward a long document.  

What are the main ideas behind the retrieval function BM25?
BM25 is a sublinear TF transformation which
- capture the intuition of “diminishing return” from higher TF
- avoid dominance by one single term over all others

Key Phrases/Concepts
- Part-of-speech tagging; syntactic analysis; semantic analysis; ambiguity
-“Bag of words” representation
- Push, pull, querying, browsing
- Probability Ranking Principle
- Relevance- Vector Space Model
- Term Frequency (TF)
- Document Frequency (DF); Inverse Document Frequency (IDF)
- TF Transformation
- Pivoted length normalization
- Dot product
- BM25


Friday, 20 March 2015

Overview

These are some personal answers on guiding questions presented under each weekly topic of Coursera's Text Retrieval and Search Engines Course. You may use this blog as a one of your reviewers in preparation for the quizzes.

Coursera and other terms may be registered trademarks or trademarks of their respective owners. The contents of this blog were produced independently and have not been authorised, sponsored, or otherwise approved by Coursera or any of its affiliated educational institutions.

Thanks to ChengXiang Zhai for sharing his expert knowledge on the topic.