(
        self,
        text: str,
        topn: int = 3,
        with_probs: bool = False,
    )
return [lang for lang, _ in results] if with_probs is False else results
Identify the ``topn`` most probable languages identified in ``text``,
        with or without the corresponding probabilities.

        Args:
            text
            topn
            with_probs

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

        Args:
            text
            topn
            with_probs

        Returns:
            ISO 639-1 standard language code and optionally with its probability
            of the ``topn`` most probable languages.
        """
        if not self._is_valid_text(text):
            results = [("un", 1.0)]
        else:
            text_ = utils.to_collection(text, str, list)
            results = models.get_topn_preds_and_probs(
                self.model.predict(text_), topn, self.classes
            )[0]
        return [lang for lang, _ in results] if with_probs is False else results
def identify_topn_langs ( self , text : str , topn : int = 3 , with_probs : bool = False , ) -> List [ str ] | List [ Tuple [ str , float ] ] : if not self . _is_valid_text ( text ) : results = [ ( "un" , 1.0 ) ] else : text_ = utils . to_collection ( text , str , list ) results = models . get_topn_preds_and_probs ( self . model . predict ( text_ ) , topn , self . classes ) [ 0 ] return [ lang for lang , _ in results ] if with_probs is False else results