(
        self,
        text: str,
        with_probs: bool = False,
    )
return result[0] if with_probs is False else result
Identify the most probable language identified in ``text``,
        with or without the corresponding probability.

        Args:
            text
            with_probs

        Returns:
            ISO 639-1 standard language code of the most probable language,
            optionally with its probability.
Identify the most probable language identified in ``text``,
        with or without the corresponding probability.
Identify the most probable language identified in text with or without the corresponding probability .
def identify_lang(
        self,
        text: str,
        with_probs: bool = False,
    ) -> str | Tuple[str, float]:
        """
        Identify the most probable language identified in ``text``,
        with or without the corresponding probability.

        Args:
            text
            with_probs

        Returns:
            ISO 639-1 standard language code of the most probable language,
            optionally with its probability.
        """
        if not self._is_valid_text(text):
            result = ("un", 1.0)
        else:
            text_ = utils.to_collection(text, str, list)
            result = models.get_topn_preds_and_probs(
                self.model.predict(text_), 1, self.classes
            )[0][0]
        return result[0] if with_probs is False else result
def identify_lang ( self , text : str , with_probs : bool = False , ) -> str | Tuple [ str , float ] : if not self . _is_valid_text ( text ) : result = ( "un" , 1.0 ) else : text_ = utils . to_collection ( text , str , list ) result = models . get_topn_preds_and_probs ( self . model . predict ( text_ ) , 1 , self . classes ) [ 0 ] [ 0 ] return result [ 0 ] if with_probs is False else result