Skip to main content

Python interface to the Anserini IR toolkit built on Lucene

Project description

Pyserini provides a simple Python interface to the Anserini IR toolkit via pyjnius.

Installation

Install via PyPI:

pip install pyserini

Usage

As a quick start, use the SimpleSearcher for searching, with a pre-built index on TREC Disks 4 & 5 (used in the TREC 2004 Robust Track):

from pyserini.search import SimpleSearcher

searcher = SimpleSearcher.from_prebuilt_index('robust04')
hits = searcher.search('hubble space telescope')

# Print the first 10 hits:
for i in range(0, 10):
    print(f'{i+1:2} {hits[i].docid:15} {hits[i].score:.5f}')

# Grab the actual text:
hits[0].raw

For additional information, please refer to the Pyserini repository.

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

pyserini-0.10.0.0.tar.gz (63.1 MB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

pyserini-0.10.0.0-py3-none-any.whl (63.1 MB view details)

Uploaded Python 3

File details

Details for the file pyserini-0.10.0.0.tar.gz.

File metadata

  • Download URL: pyserini-0.10.0.0.tar.gz
  • Upload date:
  • Size: 63.1 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/2.0.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.6.0 requests-toolbelt/0.9.1 tqdm/4.51.0 CPython/3.6.7

File hashes

Hashes for pyserini-0.10.0.0.tar.gz
Algorithm Hash digest
SHA256 b818108308f08faa2d7f2c9831b67f4c0f219e5c8270983ecf9386f5bbe9a7d0
MD5 202dcf61ae630fb59988e7b2e2269261
BLAKE2b-256 edb055d9c914f1621361f1e91abfef7f6e230bd0b9d4e02b7f8b3cd27dfe54e0

See more details on using hashes here.

File details

Details for the file pyserini-0.10.0.0-py3-none-any.whl.

File metadata

  • Download URL: pyserini-0.10.0.0-py3-none-any.whl
  • Upload date:
  • Size: 63.1 MB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/2.0.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.6.0 requests-toolbelt/0.9.1 tqdm/4.51.0 CPython/3.6.7

File hashes

Hashes for pyserini-0.10.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 329451b5fa1698a27f3d02928a8edc84e11038a4aca641cb4135459284c52b24
MD5 7d307846512cbdb79a97ac3f581dc45e
BLAKE2b-256 e0f93e0a58b1130863276855410e22f94351f45da5516cbabd65ef57fed4348c

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page