docstr: ```
  load text files from folder
  
  Args:
    folder_path(str): path to folder containing documents
                      The supplied folder should contain a subfolder
                      for each category, which will be used as the class label
    subfolders(list): list of subfolders under folder_path to consider
                      Example: If folder_path contains subfolders pos, neg, and
                      unlabeled, then unlabeled folder can be ignored by
                      setting subfolders=['pos', 'neg']
    shuffle(bool):  If True, list of texts will be shuffled
    encoding(str): encoding to use.  default:None (auto-detected)
  Returns:
    tuple: (texts, labels, label_names)
  ```
docstr_tok: ["``","`","load","text","files","from","folder","Args",":","folder_path","(","str",")",":","path","to","folder","containing","documents","The","supplied","folder","should","contain","a","subfolder","for","each","category",",","which","will","be","used","as","the","class","label","subfolders","(","list",")",":","list","of","subfolders","under","folder_path","to","consider","Example",":","If","folder_path","contains","subfolders","pos",",","neg",",","and","unlabeled",",","then","unlabeled","folder","can","be","ignored","by","setting","subfolders=","[","'pos","'",",","'neg","'","]","shuffle","(","bool",")",":","If","True",",","list","of","texts","will","be","shuffled","encoding","(","str",")",":","encoding","to","use",".","default",":","None","(","auto-detected",")","Returns",":","tuple",":","(","texts",",","labels",",","label_names",")","``","`"]
code: def load_texts_from_folder(
      cls, folder_path, subfolders=None, shuffle=True, encoding=None
  ):
      """
      ```
      load text files from folder
  
      Args:
        folder_path(str): path to folder containing documents
                          The supplied folder should contain a subfolder
                          for each category, which will be used as the class label
        subfolders(list): list of subfolders under folder_path to consider
                          Example: If folder_path contains subfolders pos, neg, and
                          unlabeled, then unlabeled folder can be ignored by
                          setting subfolders=['pos', 'neg']
        shuffle(bool):  If True, list of texts will be shuffled
        encoding(str): encoding to use.  default:None (auto-detected)
      Returns:
        tuple: (texts, labels, label_names)
      ```
      """
      bunch = load_files(
          folder_path, categories=subfolders, shuffle=shuffle
      )
      texts = bunch.data
      labels = bunch.target
      label_names = bunch.target_names
      # print('target names:')
      # for idx, label_name in enumerate(bunch.target_names):
      # print('\t%s:%s' % (idx, label_name))
  
      # decode based on supplied encoding
      if encoding is None:
          encoding = U.detect_encoding(texts)
          if encoding != "utf-8":
              print("detected encoding: %s" % (encoding))
  
      try:
          texts = [text.decode(encoding) for text in texts]
      except:
          print(
              "Decoding with %s failed 1st attempt - using %s with skips"
              % (encoding, encoding)
          )
          texts = U.decode_by_line(texts, encoding=encoding)
      return (texts, labels, label_names)
  
imports: from .None import utils
  from .imports import *
label_desc: Use image node_id 3 for calling the Classifier obj's underlying member method code with example usage: obj.load_texts_from_folder(cls, folder_path, subfolders, shuffle, encoding) and returns: texts,  labels,  label_names