Skip to content

Commit

Permalink
add n-gram support
Browse files Browse the repository at this point in the history
  • Loading branch information
Guest400123064 committed Apr 25, 2024
1 parent 0ff99e2 commit 22804ce
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions scripts/benchmark_beir.py
Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,7 @@ def evaluate_retriever(args: argparse.Namespace) -> None:
b=args.bm25_b,
delta=args.bm25_delta,
sp_file=args.sp_file,
n_grams=args.n_grams,
)
model = BEIRWrapper(store)
retriever = EvaluateRetrieval(model)
Expand Down Expand Up @@ -221,6 +222,13 @@ def get_args() -> argparse.Namespace:
required=False,
help="Path to the SentencePiece model file; default to None (LLaMA2)",
)
parser.add_argument(
"--n-grams",
type=int,
default=1,
required=False,
help="The n-gram size up to n for tokenizations; default to 1",
)
parser.add_argument(
"--split",
type=str,
Expand Down

0 comments on commit 22804ce

Please sign in to comment.