Skip to content

Commit

Permalink
fix variable name typos
Browse files Browse the repository at this point in the history
  • Loading branch information
cmacdonald authored Sep 14, 2024
1 parent 09d11d6 commit e94b29c
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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'])
```

Expand All @@ -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).
Expand All @@ -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")
)
Expand All @@ -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:
Expand Down

0 comments on commit e94b29c

Please sign in to comment.