class_docstr: Detect the language of the input corpus.
  
  We currently support three pretrained models:
  
      - model='langid'
          Use the langid implementation from
           https://github.com/saffsd/langid.py
      - model='fasttext'
          Use the fasttext model "lid.176.bin" from
           https://fasttext.cc/docs/en/language-identification.html
      - model='fasttext_compressed'
          Use the compressed fasttext model "lid.176.ftz"
          from  https://fasttext.cc/docs/en/language-identification.html
  
  .. code-block:: none
  
      References:
  
      @article{joulin2016bag,
        title={Bag of Tricks for Efficient Text Classification},
        author={Joulin, Armand and Grave, Edouard and Bojanowski, Piotr and Mikolov, Tomas},
        journal={arXiv preprint arXiv:1607.01759},
        year={2016}
      }
  
      @article{joulin2016fasttext,
        title={FastText.zip: Compressing text classification models},
        author={Joulin, Armand and Grave, Edouard and Bojanowski, Piotr and Douze, Matthijs and J{\'e}gou, H{\'e}rve and Mikolov, Tomas},
        journal={arXiv preprint arXiv:1612.03651},
        year={2016}
      }
  
      @inproceedings{lui2012langid,
        title={langid. py: An off-the-shelf language identification tool},
        author={Lui, Marco and Baldwin, Timothy},
        booktitle={Proceedings of the ACL 2012 system demonstrations},
        pages={25--30},
        year={2012},
        organization={Association for Computational Linguistics}
      }
code: def __init__(self, algo="fasttext_compressed", model_path=None):
      assert algo in ["langid", "fasttext", "fasttext_compressed"]
      self._algo = algo
      self._use_fasttext = algo.startswith("fasttext")
      if algo in ["fasttext", "fasttext_compressed"]:
          fasttext = try_import_fasttext()
          if model_path is None:
              if algo == "fasttext":
                  model_path = download(
                      get_repo_url()
                      + "models/fasttext_langid/lid.176.bin",
                      os.path.join(
                          get_model_zoo_home_dir(),
                          "fasttext_langid",
                          "lid.176.bin",
                      ),
                      sha1_hash="e613bda316ecb4f5e1924140eedf81b81c087d9a",
                  )
              elif algo == "fasttext_compressed":
                  model_path = download(
                      get_repo_url()
                      + "models/fasttext_langid/lid.176.ftz",
                      os.path.join(
                          get_model_zoo_home_dir(),
                          "fasttext_langid",
                          "lid.176.ftz",
                      ),
                      sha1_hash="86d1b630ba55a5040231eda9fe24a7befdc411f2",
                  )
              else:
                  raise NotImplementedError
          self._model_path = model_path
          with warnings.catch_warnings():
              # Ignore the DeprecationWarning. For more details,
              # See issue: https://github.com/facebookresearch/fastText/issues/1056
              warnings.filterwarnings("ignore", category=Warning)
              model = fasttext.load_model(model_path)
          self._model = model
      elif algo == "langid":
          langid = try_import_langid()
          self._model_str = langid.langid.model
          self._model_path = model_path
          self._model = (
              langid.langid.LanguageIdentifier.from_modelstring(
                  self._model_str
              )
          )
      else:
          raise NotImplementedError
  
imports: import re
  import regex
  import requests
  import unicodedata
  import os
  import warnings
  from typing import List, Pattern, Union, Tuple, Optional
  from sacremoses.normalize import MosesPunctNormalizer
  from ..utils.lazy_imports import try_import_fasttext, try_import_langid
  from ..utils.misc import download
  from ..base import get_model_zoo_home_dir, get_repo_url
label_desc: Use image node_id 1 to create a new LanguageIdentifier object  with example: obj = LanguageIdentifier(algo, model_path)