From e94b29cbd447cd1b82001b8d15a4eb390bcd419e Mon Sep 17 00:00:00 2001 From: Craig Macdonald Date: Sat, 14 Sep 2024 16:39:18 +0100 Subject: [PATCH] fix variable name typos --- README.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index c351f17e..bab2a70e 100644 --- a/README.md +++ b/README.md @@ -36,7 +36,7 @@ See the [indexing documentation](https://pyterrier.readthedocs.io/en/latest/terr topics = pt.io.read_topics(topicsFile) qrels = pt.io.read_qrels(qrelsFile) BM25_r = pt.terrier.Retriever(index, wmodel="BM25") -res = BM25_br.transform(topics) +res = BM25_r.transform(topics) pt.Evaluate(res, qrels, metrics = ['map']) ``` @@ -56,7 +56,7 @@ There is a worked example in the [experiment notebook](examples/notebooks/experi PyTerrier makes it easy to develop complex retrieval pipelines using Python operators such as `>>` to chain different retrieval components. Each retrieval approach is a [transformer](https://pyterrier.readthedocs.io/en/latest/transformer.html), having one key method, `transform()`, which takes a single Pandas dataframe as input, and returns another dataframe. Two examples might encapsulate applying the sequential dependence model, or a query expansion process: ```python sdm_bm25 = pt.rewrite.SDM() >> pt.terrier.Retriever(indexref, wmodel="BM25") -bo1_qe = BM25_br >> pt.rewrite.Bo1QueryExpansion() >> BM25_br +bo1_qe = BM25_r >> pt.rewrite.Bo1QueryExpansion() >> BM25_r ``` There is documentation on [transformer operators](https://pyterrier.readthedocs.io/en/latest/operators.html) as well as [example pipelines](https://pyterrier.readthedocs.io/en/latest/pipeline_examples.html) show other common use cases. For more information, see the [PyTerrier data model](https://pyterrier.readthedocs.io/en/latest/datamodel.html). @@ -81,7 +81,7 @@ You can see examples of how to use these, including notebooks that run on Google Complex learning to rank pipelines, including for learning-to-rank, can be constructed using PyTerrier's operator language. For example, to combine two features and make them available for learning, we can use the `**` operator. ```python -two_features = BM25_br >> ( +two_features = BM25_r >> ( pt.terrier.Retriever(indexref, wmodel="DirichletLM") ** pt.terrier.Retriever(indexref, wmodel="PL2") ) @@ -96,7 +96,7 @@ PyTerrier allows simple access to standard information retrieval test collection ```python topics = pt.get_dataset("trec-robust-2004").get_topics() qrels = pt.get_dataset("trec-robust-2004").get_qrels() -pt.Experiment([BM25_br, PL2_br], topics, qrels, eval_metrics) +pt.Experiment([BM25_r, PL2_r], topics, qrels, eval_metrics) ``` You can index datasets that include a corpus using IterDictIndexer and get_corpus_iter: