craigmacdonald commited on
Commit
23afaa1
·
verified ·
1 Parent(s): 846fad0

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +22 -4
README.md CHANGED
@@ -14,15 +14,28 @@ viewer: false
14
 
15
  ## Description
16
 
17
- *TODO: What is the artifact?*
18
 
19
  ## Usage
20
 
 
 
 
21
  ```python
22
  # Load the artifact
23
  import pyterrier as pt
24
- artifact = pt.Artifact.from_hf('pyterrier-tutorial/bright.sustainable.colbert2')
25
- # TODO: Show how you use the artifact
 
 
 
 
 
 
 
 
 
 
26
  ```
27
 
28
  ## Benchmarks
@@ -32,7 +45,12 @@ artifact = pt.Artifact.from_hf('pyterrier-tutorial/bright.sustainable.colbert2')
32
  ## Reproduction
33
 
34
  ```python
35
- # TODO: Show how you constructed the artifact.
 
 
 
 
 
36
  ```
37
 
38
  ## Metadata
 
14
 
15
  ## Description
16
 
17
+ An index of the sustainable-living subset of the BRIGHT dataset.
18
 
19
  ## Usage
20
 
21
+ You'll need http://github.com/cmacdonald/pyterrier_colbert2
22
+
23
+
24
  ```python
25
  # Load the artifact
26
  import pyterrier as pt
27
+ index = pt.Artifact.from_hf('pyterrier-tutorial/bright.sustainable.colbert2')
28
+ from pyterrier.measures import *
29
+ topics = pt.get_dataset('irds:bright/sustainable-living').get_topics(variant='text')
30
+ qrels = pt.get_dataset('irds:bright/sustainable-living').get_qrels()
31
+
32
+ pt.Experiment(
33
+ [index.end_to_end()],
34
+ topics,
35
+ qrels,
36
+ eval_metrics=[AP, RR, nDCG@10, P@5, "mrt"],
37
+ names=["ColBERT v2"],
38
+ )
39
  ```
40
 
41
  ## Benchmarks
 
45
  ## Reproduction
46
 
47
  ```python
48
+ import pyterrier as pt
49
+ import pyterrier_colbert
50
+ dataset = pt.get_dataset('irds:bright/sustainable-living')
51
+ indexer = pyterrier_colbert.indexing.ColbertV2Indexer("./sustainable-living", "colbert-ir/colbertv2.0", "2bits")
52
+ index = indexer.index(dataset.get_corpus_iter())
53
+ index.to_hf("pyterrier-tutorial/bright.sustainable.colbert2")
54
  ```
55
 
56
  ## Metadata