Library for working with TREC run files
Project description
TRECRun
TRECRun
is a library for working with TREC run files, with an API heavily inspired by PyTerrier's pipeline operators.
API | Operator | Description |
---|---|---|
TRECRun(results) |
Create a TRECRun object from a dictionary of results or a path to a run file in TREC format. |
|
add(self, other) , subtract , multiply , divide |
+ , - , * , / |
Perform the given operation between self's document scores and other , which can be a TRECRun or a scalar. |
topk(self, k) |
% |
Retain only the top-k documents for each qid after sorting by score. |
intersect(self, other) |
& |
Retain only the queries and documents that appear in both self and other . |
concat(self, other) |
Concat the documents in other and self , with those in other appearing at the end. Their scores will be modified to accomplish this. |
|
normalize(self, method='rr') |
Normalize scores in self using RRF (rr ), sklearn's min-max scaling (minmax ), or sklearn's scaling (standard ). |
|
write_trec_run(self, outf) |
Write self to outfn in TREC format. |
|
evaluate(self, qrels, metrics) |
Compute metrics for self using qrels and return a dict mapping metric names to their values for each QID. Metrics are computed by ir_measures . |
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
trecrun-0.3.0.tar.gz
(11.1 kB
view details)
Built Distribution
File details
Details for the file trecrun-0.3.0.tar.gz
.
File metadata
- Download URL: trecrun-0.3.0.tar.gz
- Upload date:
- Size: 11.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/5.1.0 CPython/3.12.4
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | a7f26f104d6dc3320f6fbc026c51194038fb7d79e603514675593d7544b7cdeb |
|
MD5 | 393b083d84a9b1ab2edb85d111389b13 |
|
BLAKE2b-256 | 4035235f9d3997b3854e509d655b492d1f8c0a29dc61f06493ab00d8eb893333 |
File details
Details for the file trecrun-0.3.0-py3-none-any.whl
.
File metadata
- Download URL: trecrun-0.3.0-py3-none-any.whl
- Upload date:
- Size: 8.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/5.1.0 CPython/3.12.4
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 0380066aede4d82c90b9d9fac1a714ac43c0ac950b1196b2a777c8d188a88486 |
|
MD5 | 965f7de8c4d2270b14f0f06f8536abda |
|
BLAKE2b-256 | 069d4eb52a9c32527ece944f57fb6ecdcd0556f22f1e8be16aa77aa6a31c7d63 |