Skip to content

Commit

Permalink
refer to Transformer instead
Browse files Browse the repository at this point in the history
  • Loading branch information
cmacdonald committed Jan 11, 2022
1 parent dacb19a commit 5c4259c
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions pyterrier/text.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
from pyterrier.transformer import TransformerBase
from . import Transformer
from pyterrier.datasets import IRDSDataset
import more_itertools
from collections import defaultdict
Expand Down Expand Up @@ -248,16 +249,16 @@ def slidingWindow(sequence : list, winSize : int, step : int) -> list:
return [x for x in list(more_itertools.windowed(sequence,n=winSize, step=step)) if x[-1] is not None]

def snippets(
text_scorer_pipe : TransformerBase,
text_scorer_pipe : Transformer,
text_attr : str = "text",
summary_attr : str = "summary",
num_psgs : int = 5,
joinstr : str ='...') -> TransformerBase:
joinstr : str ='...') -> Transformer:
"""
Applies query-biased summarisation (snippet), by applying the specified text scoring pipeline.
Arguments:
- text_scorer_pipe(TransformerBase): the pipeline for scoring passages in response to the query. Normally this applies passaging.
- text_scorer_pipe(Transformer): the pipeline for scoring passages in response to the query. Normally this applies passaging.
- text_attr(str): what is the name of the attribute that contains the text of the document
- summary_attr(str): what is the name of the attribute that should contain the query-biased summary for that document
- num_psgs(int): how many passages to select for the summary of each document
Expand Down

0 comments on commit 5c4259c

Please sign in to comment.