flair.splitter.SpacySentenceSplitter#

class flair.splitter.SpacySentenceSplitter(model, tokenizer=None)View on GitHub#

Bases: SentenceSplitter

Sentence Splitter using Spacy.

Implementation of SentenceSplitter, using models from Spacy.

Parameters:
  • model (Union[Any, str]) – Spacy V2 model or the name of the model to load.

  • tokenizer (Optional[Tokenizer]) – Custom tokenizer to use (default SpacyTokenizer)

__init__(model, tokenizer=None)View on GitHub#

Methods

__init__(model[, tokenizer])

split(text[, link_sentences])

Takes as input a text as a plain string and outputs a list of flair.data.Sentence objects.

Attributes

name

A string identifier of the sentence splitter.

tokenizer

The flair.tokenization.Tokenizer class used to tokenize sentences after they are split.

property tokenizer: Tokenizer#

The flair.tokenization.Tokenizer class used to tokenize sentences after they are split.

property name: str#

A string identifier of the sentence splitter.