class_docstr: A Dataset taking string as input and returning Sentence during iteration.
class_docstr_tok: ["A","Dataset","taking","string","as","input","and","returning","Sentence","during","iteration","."]
docstr: Instantiate StringDataset.
  
  Args:
      texts: a string or List of string that make up StringDataset
      use_tokenizer:
          Custom tokenizer to use. If instead of providing a function, this parameter is just set to True,
          :class:`flair.tokenization.SegTokTokenizer` will be used.
docstr_tok: ["Instantiate","StringDataset",".","Args",":","texts",":","a","string","or","List","of","string","that","make","up","StringDataset","use_tokenizer",":","Custom","tokenizer","to","use",".","If","instead","of","providing","a","function",",","this","parameter","is","just","set","to","True",",",":","class",":","`","flair.tokenization.SegTokTokenizer","`","will","be","used","."]
code: def __init__(
      self,
      texts: Union[str, List[str]],
      use_tokenizer: Union[bool, Tokenizer] = SpaceTokenizer(),
  ) -> None:
      """Instantiate StringDataset.
  
      Args:
          texts: a string or List of string that make up StringDataset
          use_tokenizer:
              Custom tokenizer to use. If instead of providing a function, this parameter is just set to True,
              :class:`flair.tokenization.SegTokTokenizer` will be used.
      """
      # cast to list if necessary
      if isinstance(texts, str):
          texts = [texts]
      self.texts = texts
      self.use_tokenizer = use_tokenizer
  
imports: import logging
  from abc import abstractmethod
  from pathlib import Path
  from typing import Generic, List, Optional, Union
  import torch.utils.data.dataloader
  from deprecated.sphinx import deprecated
  from flair.data import DT, FlairDataset, Sentence, Tokenizer
  from flair.tokenization import SegtokTokenizer, SpaceTokenizer
label_desc: Use image node_id 1 to create a new StringDataset object from inherited base classes: FlairDataset with example: obj = StringDataset(texts, use_tokenizer)