class_docstr: interface to Sentiment Analyzer
docstr: ```
  Performs sentiment analysis
  
  This method accepts a list of texts and predicts their sentiment as either 'NEGATIVE', 'NEUTRAL', 'POSITIVE'.
  Args:
      texts: str|list
      return_all_scores(bool): If True, return all labels/scores
      batch_size: size of batches sent to model
  Returns:
      A dictionary of labels and scores
  
  ```
code: def predict(
      self,
      texts: Union[str, list],
      return_all_scores=False,
      batch_size=U.DEFAULT_BS,
      **kwargs,
  ):
      """
      ```
      Performs sentiment analysis
  
      This method accepts a list of texts and predicts their sentiment as either 'NEGATIVE', 'NEUTRAL', 'POSITIVE'.
      Args:
          texts: str|list
          return_all_scores(bool): If True, return all labels/scores
          batch_size: size of batches sent to model
      Returns:
          A dictionary of labels and scores
  
      ```
      """
      str_input = isinstance(texts, str)
      if str_input:
          texts = [texts]
      chunks = U.batchify(texts, batch_size)
      results = []
      for chunk in chunks:
          preds = self.pipeline(
              chunk,
              top_k=len(self.mapping) if return_all_scores else 1,
              **kwargs,
          )
          results.extend(preds)
      results = [self._flatten_prediction(pred) for pred in results]
      return results[0] if str_input else results
  
file_path: ktrain/ktrain/text/sentiment/core.py
imports: from typing import Union
  from transformers import pipeline
  from ...None import utils
  from ...torch_base import TorchBase
label_desc: Use image node_id 2 for calling the SentimentAnalyzer obj's underlying member method code with example usage: obj.predict(texts, return_all_scores, batch_size) and returns: unknown