Sean MacAvaney commited on
Commit
8f05d21
1 Parent(s): 1051b11

rename factory -> splade

Browse files
Files changed (2) hide show
  1. app.py +4 -4
  2. wrapup.md +3 -3
app.py CHANGED
@@ -58,9 +58,9 @@ def predict_query(input, agg):
58
  import pyterrier as pt ; pt.init()
59
  import pyt_splade
60
 
61
- factory = pyt_splade.SpladeFactory(agg={repr(agg)})
62
 
63
- query_pipeline = factory.query()
64
 
65
  query_pipeline({df2code(input)})
66
  '''
@@ -77,9 +77,9 @@ def predict_doc(input, agg):
77
  import pyterrier as pt ; pt.init()
78
  import pyt_splade
79
 
80
- factory = pyt_splade.SpladeFactory(agg={repr(agg)})
81
 
82
- doc_pipeline = factory.indexing()
83
 
84
  doc_pipeline({df2code(input)})
85
  '''
 
58
  import pyterrier as pt ; pt.init()
59
  import pyt_splade
60
 
61
+ splade = pyt_splade.SpladeFactory(agg={repr(agg)})
62
 
63
+ query_pipeline = splade.query()
64
 
65
  query_pipeline({df2code(input)})
66
  '''
 
77
  import pyterrier as pt ; pt.init()
78
  import pyt_splade
79
 
80
+ splade = pyt_splade.SpladeFactory(agg={repr(agg)})
81
 
82
+ doc_pipeline = splade.indexing()
83
 
84
  doc_pipeline({df2code(input)})
85
  '''
wrapup.md CHANGED
@@ -16,11 +16,11 @@ pt.init(version='snapshot')
16
  import pyt_splade
17
 
18
  dataset = pt.get_dataset('irds:msmarco-passage')
19
- factory = pyt_splade.SpladeFactory()
20
 
21
  indexer = pt.IterDictIndexer('./msmarco_psg', pretokenized=True)
22
 
23
- indxer_pipe = factory.indexing() >> indexer
24
  indxer_pipe.index(dataset.get_corpus_iter())
25
  ```
26
 
@@ -36,7 +36,7 @@ and then performs retrieval:
36
  </div>
37
 
38
  ```python
39
- splade_retr = factory.query() >> pt.BatchRetrieve('./msmarco_psg', wmodel='Tf')
40
  ```
41
 
42
  ### References & Credits
 
16
  import pyt_splade
17
 
18
  dataset = pt.get_dataset('irds:msmarco-passage')
19
+ splade = pyt_splade.SpladeFactory()
20
 
21
  indexer = pt.IterDictIndexer('./msmarco_psg', pretokenized=True)
22
 
23
+ indxer_pipe = splade.indexing() >> indexer
24
  indxer_pipe.index(dataset.get_corpus_iter())
25
  ```
26
 
 
36
  </div>
37
 
38
  ```python
39
+ splade_retr = splade.query() >> pt.BatchRetrieve('./msmarco_psg', wmodel='Tf')
40
  ```
41
 
42
  ### References & Credits