2021-04-09 17:24:16 +02:00
|
|
|
# The benchmarks use
|
|
|
|
# - a variant of the Natural Questions Dataset (https://ai.google.com/research/NaturalQuestions) from Google Research
|
|
|
|
# licensed under CC BY-SA 3.0 (https://creativecommons.org/licenses/by-sa/3.0/)
|
|
|
|
# - the SQuAD 2.0 Dataset (https://rajpurkar.github.io/SQuAD-explorer/) from Rajpurkar et al.
|
|
|
|
# licensed under CC BY-SA 4.0 (https://creativecommons.org/licenses/by-sa/4.0/legalcode)
|
|
|
|
|
2020-10-12 13:34:42 +02:00
|
|
|
from retriever import benchmark_indexing, benchmark_querying
|
|
|
|
from reader import benchmark_reader
|
2020-10-15 18:12:17 +02:00
|
|
|
from utils import load_config
|
2020-10-12 13:34:42 +02:00
|
|
|
import argparse
|
|
|
|
|
2020-10-15 18:12:17 +02:00
|
|
|
|
2020-10-12 13:34:42 +02:00
|
|
|
parser = argparse.ArgumentParser()
|
|
|
|
|
2022-02-03 13:43:18 +01:00
|
|
|
parser.add_argument("--reader", default=False, action="store_true", help="Perform Reader benchmarks")
|
|
|
|
parser.add_argument(
|
|
|
|
"--retriever_index", default=False, action="store_true", help="Perform Retriever indexing benchmarks"
|
|
|
|
)
|
|
|
|
parser.add_argument(
|
|
|
|
"--retriever_query", default=False, action="store_true", help="Perform Retriever querying benchmarks"
|
|
|
|
)
|
|
|
|
parser.add_argument(
|
|
|
|
"--ci", default=False, action="store_true", help="Perform a smaller subset of benchmarks that are quicker to run"
|
|
|
|
)
|
|
|
|
parser.add_argument(
|
|
|
|
"--update_json",
|
|
|
|
default=False,
|
|
|
|
action="store_true",
|
|
|
|
help="Update the json file with the results of this run so that the website can be updated",
|
|
|
|
)
|
|
|
|
parser.add_argument(
|
|
|
|
"--save_markdown",
|
|
|
|
default=False,
|
|
|
|
action="store_true",
|
|
|
|
help="Update the json file with the results of this run so that the website can be updated",
|
|
|
|
)
|
2020-10-12 13:34:42 +02:00
|
|
|
args = parser.parse_args()
|
|
|
|
|
2020-12-02 16:59:42 +01:00
|
|
|
# load config
|
|
|
|
params, filenames = load_config(config_filename="config.json", ci=args.ci)
|
|
|
|
|
2020-10-12 13:34:42 +02:00
|
|
|
if args.retriever_index:
|
2022-02-03 13:43:18 +01:00
|
|
|
benchmark_indexing(
|
|
|
|
**params, **filenames, ci=args.ci, update_json=args.update_json, save_markdown=args.save_markdown
|
|
|
|
)
|
2020-10-12 13:34:42 +02:00
|
|
|
if args.retriever_query:
|
2022-02-03 13:43:18 +01:00
|
|
|
benchmark_querying(
|
|
|
|
**params, **filenames, ci=args.ci, update_json=args.update_json, save_markdown=args.save_markdown
|
|
|
|
)
|
2020-10-19 14:40:26 +02:00
|
|
|
if args.reader:
|
2020-11-18 18:28:17 +01:00
|
|
|
benchmark_reader(**params, **filenames, ci=args.ci, update_json=args.update_json, save_markdown=args.save_markdown)
|