def language_match(self, text1: str, text2: str) -> Tuple[float, Dict]:
        """Uses HuggingFace's papluca/xlm-roberta-base-language-detection model.

        A function that uses language detection on `text1` and `text2` and
        calculates the probit difference on the language detected on text1. The
        function is: `1.0 - (|probit_language_text1(text1) -
        probit_language_text1(text2))`

        Example:
            ```python
            from trulens.core import Feedback
            from trulens.providers.huggingface import Huggingface
            huggingface_provider = Huggingface()

            feedback = Feedback(huggingface_provider.language_match).on_input_output()
            ```

        Args:
            text1: Text to evaluate.

            text2: Comparative text to evaluate.

        Returns:
            float: A value between 0 and 1. 0 being "different languages" and 1
                being "same languages".
        """
        with threading_utils.ThreadPoolExecutor(max_workers=2) as tpool:
            max_length = 500
            f_scores1: Future[Dict] = tpool.submit(
                self._language_scores_endpoint, text=text1[:max_length]
            )
            f_scores2: Future[Dict] = tpool.submit(
                self._language_scores_endpoint, text=text2[:max_length]
            )

        wait([f_scores1, f_scores2])

        scores1: Dict = f_scores1.result()
        scores2: Dict = f_scores2.result()

        langs = list(scores1.keys())
        prob1 = np.array([scores1[k] for k in langs])
        prob2 = np.array([scores2[k] for k in langs])
        diff = prob1 - prob2

        l1: float = float(1.0 - (np.linalg.norm(diff, ord=1)) / 2.0)

        return l1, dict(text1_scores=scores1, text2_scores=scores2)
Uses HuggingFace's papluca/xlm-roberta-base-language-detection model.

        A function that uses language detection on `text1` and `text2` and
        calculates the probit difference on the language detected on text1. The
        function is: `1.0 - (|probit_language_text1(text1) -
        probit_language_text1(text2))`

        Example:
            ```python
            from trulens.core import Feedback
            from trulens.providers.huggingface import Huggingface
            huggingface_provider = Huggingface()

            feedback = Feedback(huggingface_provider.language_match).on_input_output()
            ```

        Args:
            text1: Text to evaluate.

            text2: Comparative text to evaluate.

        Returns:
            float: A value between 0 and 1. 0 being "different languages" and 1
                being "same languages".
        
src/providers/huggingface/trulens/providers/huggingface/provider.py