ir_datasets
: SARALanguage: en
Examples:
import ir_datasets
dataset = ir_datasets.load("sara")
for query in dataset.queries_iter():
query # namedtuple<query_id, text>
You can find more details about the Python API here.
import pyterrier as pt
pt.init()
dataset = pt.get_dataset('irds:sara')
index_ref = pt.IndexRef.of('./indices/sara') # assumes you have already built an index
pipeline = pt.BatchRetrieve(index_ref, wmodel='BM25')
# (optionally other pipeline components)
pipeline(dataset.get_topics())
You can find more details about PyTerrier retrieval here.
from datamaestro import prepare_dataset
topics = prepare_dataset('irds.sara.queries') # AdhocTopics
for topic in topics.iter():
print(topic) # An AdhocTopic
This examples requires that experimaestro-ir be installed. For more information about the returned object, see the documentation about AdhocTopics.
Language: en
Examples:
import ir_datasets
dataset = ir_datasets.load("sara")
for doc in dataset.docs_iter():
doc # namedtuple<doc_id, text, sensitivity>
You can find more details about the Python API here.
ir_datasets export sara docs
[doc_id] [text] [sensitivity]
...
You can find more details about the CLI here.
import pyterrier as pt
pt.init()
dataset = pt.get_dataset('irds:sara')
# Index sara
indexer = pt.IterDictIndexer('./indices/sara')
index_ref = indexer.index(dataset.get_corpus_iter(), fields=['text'])
You can find more details about PyTerrier indexing here.
from datamaestro import prepare_dataset
dataset = prepare_dataset('irds.sara')
for doc in dataset.iter_documents():
print(doc) # an AdhocDocumentStore
break
This examples requires that experimaestro-ir be installed. For more information about the returned object, see the documentation about AdhocDocumentStore
Relevance levels
Rel. | Definition | Count | % |
---|---|---|---|
0 | not relevant | 33K | 95.0% |
1 | partially relevant | 999 | 2.9% |
2 | highly relevant | 708 | 2.1% |
Examples:
import ir_datasets
dataset = ir_datasets.load("sara")
for qrel in dataset.qrels_iter():
qrel # namedtuple<query_id, doc_id, relevance, iteration>
You can find more details about the Python API here.
ir_datasets export sara qrels --format tsv
[query_id] [doc_id] [relevance] [iteration]
...
You can find more details about the CLI here.
import pyterrier as pt
from pyterrier.measures import *
pt.init()
dataset = pt.get_dataset('irds:sara')
index_ref = pt.IndexRef.of('./indices/sara') # assumes you have already built an index
pipeline = pt.BatchRetrieve(index_ref, wmodel='BM25')
# (optionally other pipeline components)
pt.Experiment(
[pipeline],
dataset.get_topics(),
dataset.get_qrels(),
[MAP, nDCG@20]
)
You can find more details about PyTerrier experiments here.
from datamaestro import prepare_dataset
qrels = prepare_dataset('irds.sara.qrels') # AdhocAssessments
for topic_qrels in qrels.iter():
print(topic_qrels) # An AdhocTopic
This examples requires that experimaestro-ir be installed. For more information about the returned object, see the documentation about AdhocAssessments.
{ "docs": { "count": 1702, "fields": { "doc_id": { "max_len": 6, "common_prefix": "" } } }, "queries": { "count": 150 }, "qrels": { "count": 34413, "fields": { "relevance": { "counts_by_value": { "0": 32706, "2": 708, "1": 999 } } } } }