class_docstr: CLTK's wrapper for the Stanza project.
class_docstr_tok: ["CLTK","'s","wrapper","for","the","Stanza","project","."]
docstr: Instantiate ``stanza.Pipeline()``.
  
  TODO: Make sure that logging captures what it should from the default stanza printout.
  TODO: Make note that full lemmatization is not possible for Old French
  
  >>> stanza_wrapper = StanzaWrapper(language='grc', stanza_debug_level="INFO", interactive=False, silent=True)
  >>> with suppress_stdout():    nlp_obj = stanza_wrapper._load_pipeline()
  >>> isinstance(nlp_obj, stanza.pipeline.core.Pipeline)
  True
  >>> stanza_wrapper = StanzaWrapper(language='fro', stanza_debug_level="INFO", interactive=False, silent=True)
  >>> with suppress_stdout():    nlp_obj = stanza_wrapper._load_pipeline()
  >>> isinstance(nlp_obj, stanza.pipeline.core.Pipeline)
  True
docstr_tok: ["Instantiate","``","stanza.Pipeline","(",")","``",".","TODO",":","Make","sure","that","logging","captures","what","it","should","from","the","default","stanza","printout",".","TODO",":","Make","note","that","full","lemmatization","is","not","possible","for","Old","French",">",">",">","stanza_wrapper","=","StanzaWrapper","(","language='grc","'",",","stanza_debug_level=","''","INFO","''",",","interactive=False",",","silent=True",")",">",">",">","with","suppress_stdout","(",")",":","nlp_obj","=","stanza_wrapper._load_pipeline","(",")",">",">",">","isinstance","(","nlp_obj",",","stanza.pipeline.core.Pipeline",")","True",">",">",">","stanza_wrapper","=","StanzaWrapper","(","language='fro","'",",","stanza_debug_level=","''","INFO","''",",","interactive=False",",","silent=True",")",">",">",">","with","suppress_stdout","(",")",":","nlp_obj","=","stanza_wrapper._load_pipeline","(",")",">",">",">","isinstance","(","nlp_obj",",","stanza.pipeline.core.Pipeline",")","True"]
code: def _load_pipeline(self):
      """Instantiate ``stanza.Pipeline()``.
  
      TODO: Make sure that logging captures what it should from the default stanza printout.
      TODO: Make note that full lemmatization is not possible for Old French
  
      >>> stanza_wrapper = StanzaWrapper(language='grc', stanza_debug_level="INFO", interactive=False, silent=True)
      >>> with suppress_stdout():    nlp_obj = stanza_wrapper._load_pipeline()
      >>> isinstance(nlp_obj, stanza.pipeline.core.Pipeline)
      True
      >>> stanza_wrapper = StanzaWrapper(language='fro', stanza_debug_level="INFO", interactive=False, silent=True)
      >>> with suppress_stdout():    nlp_obj = stanza_wrapper._load_pipeline()
      >>> isinstance(nlp_obj, stanza.pipeline.core.Pipeline)
      True
      """
      models_dir = os.path.expanduser(
          os.path.join("~", "stanza_resources")
      )  # TODO: Mv this a self. var or maybe even global
      processors = "tokenize,mwt,pos,lemma,depparse"
      lemma_use_identity = False
      if self.language == "fro":
          processors = "tokenize,pos,lemma,depparse"
          lemma_use_identity = True
      if self.language in ["chu", "got", "grc", "lzh"]:
          # Note: MWT not available for several languages
          processors = "tokenize,pos,lemma,depparse"
      nlp = stanza.Pipeline(
          lang=self.stanza_code,
          dir=models_dir,
          package=self.treebank,
          processors=processors,  # these are the default processors
          logging_level=self.stanza_debug_level,
          use_gpu=True,  # default, won't fail if GPU not present
          lemma_use_identity=lemma_use_identity,
      )
      return nlp
  
file_path: cltk/src/cltk/dependency/stanza_wrapper.py
imports: import logging
  import os
  from typing import Dict, Optional
  import stanza
  from stanza.models.common.constant import lang2lcode
  from stanza.resources.prepare_resources import default_treebanks
  from cltk.core.exceptions import CLTKException, UnimplementedAlgorithmError, UnknownLanguageError
  from cltk.utils import file_exists, query_yes_no, suppress_stdout
label_desc: Use image node_id 3 for calling the StanzaWrapper obj's underlying member method code with example usage: obj._load_pipeline() and returns: nlp