Terrier IR Python API
Project description
Pyterrier
Terrier Python API
Installation
pip install python-terrier
Windows
Linux
Colab notebooks
Indexing
Indexing TREC formatted collections
index_path = "/home/alex/Documents/index"
path = "/home/alex/Downloads/books/doc-text.trec"
index_path = createTRECIndex(index_path, path)
Indexing text files
Indexing a pandas dataframe
df:
text docno url
0 He ran out of money, so he had to stop playing... 1 url1
1 The waves were crashing on the shore; it was a... 2 url2
2 The body may perhaps compensates for the loss ... 3 url3
index = createDFIndex(index_path, df["text"])
index = createDFIndex(index_path, df["text"], df["docno"])
index = createDFIndex(index_path, df["text"], df["docno"], df["url"])
index = createDFIndex(index_path, df["text"], df)
index = createDFIndex(index_path, df["text"], docno=["1","2","3"])
meta_fields={"docno":["1","2","3"],"url":["url1", "url2", "url3"]}
index = createDFIndex(index_path, df["text"], **meta_fields)
Retrieval
Evaluation
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
python-terrier-0.1.0.tar.gz
(6.4 kB
view hashes)
Built Distribution
Close
Hashes for python_terrier-0.1.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | c1f4a6ad8a1a7855cef1584965ecc4f5462e355194726f332e10e2496665cce2 |
|
MD5 | 6e8252937091d0bed4801cb12eab50e5 |
|
BLAKE2b-256 | 5f0f3afff6eae35644d498e225a7d0b7983927ddbffd002b596bec1641ee82a5 |