Skip to content

hscells/pybool_ir-ui

Repository files navigation

pybool_ir-ui

Screenshot of pybool_ir-ui in action, with a PubMed index

This is a library for creating search interfaces for indexes created with pybool_ir, however any index created with Lucene is also compatible, including those from pyserini.

DEMO https://pubmed.chatnoir.eu/

Installation

Command line:

pip install -r requirements.txt

Docker:

make docker-build

Usage

First, create a config file which specifies things like the index to use, and how the SERP should be rendered. For an example, take a look at config-pubmed.toml.

Next, edit .env to point to your config file.

Then, if you are running on the command line:

streamlit run app.py

Or, if you are running in Docker:

make docker-run

Example

Want to see it in action?

  1. Download and index the CORD-19 dataset.
pybool_ir ir-datasets index -c cord19/trec-covid -i index-treccovid -s1
  1. Edit the .env file to point to config-treccovid.toml.
PBIRUI_CONFIG_FILE=config-treccovid.toml
  1. Run the UI.
streamlit run app.py

OR

make docker-run

Extending

Implementing a SERP renderer

Implementations of how SERPs are must be included in serp.py. There are already some default implementations.

Implementing a query parser

Implementing new query parsers is a little more tricky than new SERP renderers. This requires implementing the QueryParser class from pybool_ir.

License

MIT

Citing

If you use this library in your research, please cite the following paper:

@inproceedings{scells2023pyboolir,
    author = {Scells, Harrisen and Potthast, Martin},
    title = {Pybool_ir: A Toolkit for Domain-Specific Search Experiments},
    year = {2023},
    booktitle = {Proceedings of the 46th International ACM SIGIR Conference on Research and Development in Information Retrieval},
    pages = {3190–3194},
}