Skip to content

Commit

Permalink
Merge pull request #55 from webis-de/mam10eks-patch-1
Browse files Browse the repository at this point in the history
Update ranking.py
  • Loading branch information
janheinrichmerker authored Sep 2, 2024
2 parents 4212946 + 0f44377 commit ea86402
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 2 deletions.
1 change: 1 addition & 0 deletions ir_axioms/axiom/argumentative.py
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,7 @@ def _sentence_length(
document: RankedDocument,
) -> float:
download_nltk_dependencies("punkt")
download_nltk_dependencies("punkt_tab")
sentences = sent_tokenize(context.contents(document))
if len(sentences) == 0:
return nan
Expand Down
6 changes: 4 additions & 2 deletions ir_axioms/modules/ranking.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,13 +47,15 @@ def kwiksort(
axiom,
query,
context,
vertices_left
vertices_left,
pivot_selection
)
vertices_right = kwiksort(
axiom,
query,
context,
vertices_right
vertices_right,
pivot_selection
)

return [*vertices_left, pivot, *vertices_right]
Expand Down
1 change: 1 addition & 0 deletions tests/unit/util.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ class MemoryIndexContext(IndexContext):
# noinspection PyMethodMayBeStatic
def __post_init__(self):
download_nltk_dependencies("punkt")
download_nltk_dependencies("punkt_tab")

def __hash__(self):
return reduce(
Expand Down

0 comments on commit ea86402

Please sign in to comment.