Giter Club home page Giter Club logo

anserini's Introduction

Anserini

Build Status Maven Central LICENSE

Anserini is an open-source information retrieval toolkit built on Lucene that aims to bridge the gap between academic information retrieval research and the practice of building real-world search applications. This effort grew out of a reproducibility study of various open-source retrieval engines in 2016 (Lin et al., ECIR 2016). Additional details can be found in a short paper (Yang et al., SIGIR 2017) and a journal article (Yang et al., JDIQ 2018).

Getting Started

Anserini requires Java 8 (note that there are known issues with Java 10 and Java 11) and Maven 3.3+. Build using Maven:

mvn clean package appassembler:assemble

The eval/ directory contains evaluation tools and scripts, including trec_eval, gdeval.pl, ndeval. Before using trec_eval, unpack and compile it, as follows:

tar xvfz trec_eval.9.0.4.tar.gz && cd trec_eval.9.0.4 && make

Before using ndeval, compile it as follows:

cd ndeval && make

Running Standard IR Experiments

Anserini is designed to support experiments on various standard TREC collections out of the box. Each collection is associated with regression tests for replicability. Note that these regressions capture the "out of the box" experience, based on default parameter settings.

Additional regressions:

Runbooks:

Additional Documentation

  • Axiomatic Reranking

  • IndexUtils is a utility to interact with an index using the command line (e.g., print index statistics). Refer to target/appassembler/bin/IndexUtils -h for more details.

  • MapCollections is a generic mapper framework for processing a document collection in parallel. Developers can write their own mappers for different tasks: one simple example is CountDocumentMapper which counts the number of documents in a collection:

    target/appassembler/bin/MapCollections -collection ClueWeb09Collection \
      -threads 16 -input ~/collections/web/ClueWeb09b/ClueWeb09_English_1/ \
      -mapper CountDocumentMapper -context CountDocumentMapperContext
    

Python Interface

Anserini was designed with Python integration in mind, for connecting with popular deep learning toolkits such as PyTorch. This is accomplished via pyjnius. The SimpleSearcher class provides a simple Python/Java bridge, shown below:

import jnius_config
jnius_config.set_classpath("target/anserini-0.4.1-SNAPSHOT-fatjar.jar")

from jnius import autoclass
JString = autoclass('java.lang.String')
JSearcher = autoclass('io.anserini.search.SimpleSearcher')

searcher = JSearcher(JString('lucene-index.robust04.pos+docvectors+rawdocs'))
hits = searcher.search(JString('hubble space telescope'))

# the docid of the 1st hit
hits[0].docid

# the internal Lucene docid of the 1st hit
hits[0].ldocid

# the score of the 1st hit
hits[0].score

# the full document of the 1st hit
hits[0].content

Release History

References

Acknowledgments

This research has been supported in part by the Natural Sciences and Engineering Research Council (NSERC) of Canada and the U.S. National Science Foundation under IIS-1423002 and CNS-1405688. Any opinions, findings, and conclusions or recommendations expressed do not necessarily reflect the views of the sponsors.

anserini's People

Contributors

andrewyates avatar aroegies avatar borislin avatar catenamatteo avatar chriskamphuis avatar dyshi avatar gauravbaruah avatar impavidity avatar iorixxx avatar jimmy0017 avatar kytabyte avatar lintool avatar luchentan avatar lukuang avatar meng-f avatar minafarid avatar peilin-yang avatar ptkyldz avatar rosequ avatar ryan-clancy avatar salman1993 avatar tiddler avatar tokee avatar tteofili avatar tuzhucheng avatar victor0118 avatar xeniaqian94 avatar xingniu avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.