Class SequencePostProcessor
Applies multiple IPostProcessor.
Implements
Inherited Members
Namespace: Unity.InferenceEngine.Tokenization.PostProcessors
Assembly: Unity.InferenceEngine.Tokenization.dll
Syntax
public class SequencePostProcessor : IPostProcessor
Constructors
SequencePostProcessor(params IPostProcessor[])
Initializes a new instance of the SequencePostProcessor type.
Declaration
public SequencePostProcessor(params IPostProcessor[] processors)
Parameters
| Type | Name | Description |
|---|---|---|
| IPostProcessor[] | processors | The IPostProcessor instances to call in sequence. |
Methods
GetNumAddedTokens(bool)
Determines the number of tokens that this IPostProcessor will add to the sequence of tokens.
Declaration
public int GetNumAddedTokens(bool isPair)
Parameters
| Type | Name | Description |
|---|---|---|
| bool | isPair | Tells if we want the number of added tokens for a pair of sequences of tokens (true), of a single sequence (false). |
Returns
| Type | Description |
|---|---|
| int | Number of tokens that this IPostProcessor will add to the sequence of tokens |
PostProcess(IReadOnlyList<IReadOnlyList<Token>>, IReadOnlyList<IReadOnlyList<Token>>, bool, Output<IEnumerable<IEnumerable<Token>>>)
Processes the sequence of tokens.
Declaration
public void PostProcess(IReadOnlyList<IReadOnlyList<Token>> sequenceA, IReadOnlyList<IReadOnlyList<Token>> sequenceB, bool addSpecialTokens, Output<IEnumerable<IEnumerable<Token>>> output)
Parameters
| Type | Name | Description |
|---|---|---|
| IReadOnlyList<IReadOnlyList<Token>> | sequenceA | The single, or first sequence of tokens. |
| IReadOnlyList<IReadOnlyList<Token>> | sequenceB | The second sequence of a pair. |
| bool | addSpecialTokens | Tells whether adding a special tokens in the result sequences. |
| Output<IEnumerable<IEnumerable<Token>>> | output | The recipient of processed sequences. |