flair.datasets.base#

class flair.datasets.base.DataLoader(dataset, batch_size=1, shuffle=False, sampler=None, batch_sampler=None, drop_last=False, timeout=0, worker_init_fn=None)View on GitHub#

Bases: DataLoader

class flair.datasets.base.FlairDatapointDataset(datapoints)View on GitHub#

Bases: FlairDataset, Generic[DT]

A simple Dataset object to wrap a List of Datapoints, for example Sentences.

is_in_memory()View on GitHub#
Return type:

bool

class flair.datasets.base.SentenceDataset(sentences)View on GitHub#

Bases: FlairDatapointDataset

class flair.datasets.base.StringDataset(texts, use_tokenizer=<flair.tokenization.SpaceTokenizer object>)View on GitHub#

Bases: FlairDataset

A Dataset taking string as input and returning Sentence during iteration.

abstract is_in_memory()View on GitHub#
Return type:

bool

class flair.datasets.base.MongoDataset(query, host, port, database, collection, text_field, categories_field=None, max_tokens_per_doc=-1, max_chars_per_doc=-1, tokenizer=<flair.tokenization.SegtokTokenizer object>, in_memory=True, tag_type='class')View on GitHub#

Bases: FlairDataset

is_in_memory()View on GitHub#
Return type:

bool

flair.datasets.base.find_train_dev_test_files(data_folder, dev_file, test_file, train_file, autofind_splits=True)View on GitHub#