| --- |
| |
| tags: |
| - pyterrier |
| - pyterrier-artifact |
| - pyterrier-artifact.dense_index |
| - pyterrier-artifact.dense_index.colbert |
| task_categories: |
| - text-retrieval |
| viewer: false |
| --- |
| |
| # bright.sustainable.colbert2 |
|
|
| ## Description |
|
|
| An index of the sustainable-living subset of the BRIGHT dataset. |
|
|
| ## Usage |
|
|
| You'll need http://github.com/cmacdonald/pyterrier_colbert2 |
| |
| |
| ```python |
| # Load the artifact |
| import pyterrier as pt |
| index = pt.Artifact.from_hf('pyterrier-tutorial/bright.sustainable.colbert2') |
| from pyterrier.measures import * |
| topics = pt.get_dataset('irds:bright/sustainable-living').get_topics(variant='text') |
| qrels = pt.get_dataset('irds:bright/sustainable-living').get_qrels() |
|
|
| pt.Experiment( |
| [index.end_to_end()], |
| topics, |
| qrels, |
| eval_metrics=[AP, RR, nDCG@10, P@5, "mrt"], |
| names=["ColBERT v2"], |
| ) |
| ``` |
| |
| ## Benchmarks |
|
|
| *TODO: Provide benchmarks for the artifact.* |
|
|
| ## Reproduction |
|
|
| ```python |
| import pyterrier as pt |
| import pyterrier_colbert |
| dataset = pt.get_dataset('irds:bright/sustainable-living') |
| indexer = pyterrier_colbert.indexing.ColbertV2Indexer("./sustainable-living", "colbert-ir/colbertv2.0", "2bits") |
| index = indexer.index(dataset.get_corpus_iter()) |
| index.to_hf("pyterrier-tutorial/bright.sustainable.colbert2") |
| ``` |
|
|
| ## Metadata |
|
|
| ``` |
| { |
| "type": "dense_index", |
| "format": "colbert", |
| "model_checkpoint": "colbert-ir/colbertv2.0", |
| "nbits": 2 |
| } |
| ``` |
|
|