[ci] Fix clang-santisers job for GHA change
[xapian.git] / xapian-applications / omega / docs / clickmodel.rst
blobbae7adaff707e92c79ce4c6d96da5b521c9e5203
1 .. Copyright (C) 2017 Vivek Pal
3 ===============================================
4 Simplified Dynamic Bayesian Network Click Model
5 ===============================================
7 .. contents:: Table of Contents
9 Introduction
10 ============
12 Clicks in web search reflect user interests in retrieved documents and by the
13 use of various methods, clicks can be used to improve search results. Click
14 models are one such method. These are probabilistic graphical models that
15 make user clicks easier to understand, define and quantify.
17 There are various kinds of click models among which the dynamic bayesian
18 network (DBN) model is proved to be able to closely mimic the user’s search
19 behavior. The underlying idea of DBN model is that if a user is satisfied
20 with a document in the search engine results page (SERP), he/she stops
21 otherwise, continues to examine more documents with fixed probability.
23 The Simplified DBN model (SDBN), according to the paper_: `Chapelle, Olivier and
24 Zhang, Ya. A dynamic bayesian network click model for web search ranking.
25 Proceedings of WWW, pages 1-10, 2009.`__
26 is a simplified variation of DBN model wherein the inference algorithm is
27 relatively simpler. It contains the set of attractiveness and satisfactoriness
28 parameters, which both depend on a query and a document.
30 .. _paper: https://dl.acm.org/citation.cfm?id=1526711
31 __ paper_
33 Training the SDBN model
34 =======================
36 For training the model, we need the list of search sessions obtained from
37 clickstream log data. Xapian Omega has the clickstream logging functionality
38 which generates click log data in the required format in ``final.log`` file.
40 A few example entries in ``final.log``:
42         QueryID,Query,Hits,Offset,Clicks
43         821f03288846297c2cf43c34766a38f7,book,"45,54",0,"45:0,54:2"
44         098f6bcd4621d373cade4e832627b4f6,test,"35,47",0,"35:1,47:0"
46 ``SimplifiedDBN`` class provides ``train`` function that takes a list of search
47 sessions as its input.
49 To generate search sessions from the log data file, ``SimplifiedDBN`` class
50 also provides ``build_sessions`` function which takes the path to the log data
51 file as its input and returns a list of generated sessions.
53 The training process basically involves learning the values of attractiveness
54 and satisfactoriness parameters modelled by SDBN for each pair of query and
55 a corresponding document from the list of retrieved documents in search result.
57 Predicting the Document Relevance
58 =================================
60 ``SimplifiedDBN`` class provides ``get_predicted_relevances`` function to get
61 the predicted relevance of all documents in a given search session based on
62 the trained SDBN model.
64 Use ``build_sessions`` function to generate a list of search sessions from an
65 input log data file as described above and then pass any particular search
66 session from the list for which you want the predicted relevances of the
67 documents in that session to ``get_predicted_relevances`` function which creates
68 a list of those predicted relevances.
70 Predicted relevances are the estimations of the relevance of each document in
71 a given session based on a trained model with their values ranging from 0.0 to
72 1.0. The relevance of the document is the probability that the user is satisfied
73 given that he examined and clicked on the document in the list of search results
74 presented to them by a search engine. An ideal search engine would show documents
75 with higher relevance on the top of search results.