File size: 1,644 Bytes
39e8c59
adbdb15
 
9d4fe0b
299606a
39e8c59
 
 
 
45473be
 
39e8c59
 
cf494b2
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
adbdb15
 
 
cf494b2
 
 
 
956dd16
cf494b2
 
 
adbdb15
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
---
title: PyTerrier Doc2Query
emoji: ๐Ÿ•
colorFrom: green
colorTo: green
sdk: gradio
sdk_version: 3.7
app_file: app.py
pinned: false
models:
- macavaney/doc2query-t5-base-msmarco
---

<style>
.transformer {
  display: inline-block;
  background: #8facdb;
  position: relative;
  height: 60px;
  line-height: 60px;
  padding: 0 24px;
  margin: 0 18px;
  color: #333;
}
.transformer::before {
  content: "";
  position: absolute;
  bottom: 0;
  top: 0;
  left: -15px;
  border-top: 30px solid #8facdb;
  border-bottom: 30px solid #8facdb;
  border-left: 15px solid transparent;
}
.transformer::after {
  content: "";
  position: absolute;
  bottom: 0;
  top: 0;
  right: -15px;
  border-top: 30px solid transparent;
  border-bottom: 30px solid transparent;
  border-left: 15px solid #8facdb;
}
.df {
  width: 24px;
  line-height: 24px;
  text-align: center;
  border: 3px double #888;
  background-color: #eee;
  color: #333;
  border-radius: 4px;
  display: inline-block;
  box-sizing: content-box;
}
.pipeline {
  text-align: center;
}
</style>

This is a demonstration of [PyTerrier's Doc2Query package](https://github.com/terrierteam/pyterrier_doc2query). Doc2Query generates
queries for a document, which can then be appended to a document's text before indexing to boost important terms and add missing terms.

Doc2Query functions as a `Dโ†’D` (document-to-document) transformer and can be used in pipelines accordingly.

<div class="pipeline">
  <div class="df" title="Document Frame">D</div>
  <div class="transformer" title="Doc2Query transformer">Doc2Query</div>
  <div class="df" title="Document Frame">D</div>
</div>

Try it below!