def pii_detection(self, text: str) -> float:
        """
        NER model to detect PII.

        Example:
            ```python
            hugs = Huggingface()

            # Define a pii_detection feedback function using HuggingFace.
            f_pii_detection = Feedback(hugs.pii_detection).on_input()
            ```

        Args:
            text: A text prompt that may contain a PII.

        Returns:
            float: The likelihood that a PII is contained in the input text.
        """
        # Initialize a list to store scores for "NAME" entities
        likelihood_scores = self._pii_detection_endpoint(text)

        # Calculate the sum of all individual likelihood scores (P(A) + P(B) + ...)
        sum_individual_probabilities = sum(likelihood_scores)

        # Initialize the total likelihood for at least one name
        total_likelihood = sum_individual_probabilities

        # Calculate the product of pairwise likelihood scores (P(A and B), P(A and C), ...)
        for i in range(len(likelihood_scores)):
            for j in range(i + 1, len(likelihood_scores)):
                pairwise_likelihood = (
                    likelihood_scores[i] * likelihood_scores[j]
                )
                total_likelihood -= pairwise_likelihood

        score = 1 - total_likelihood

        return score

        NER model to detect PII.

        Example:
            ```python
            hugs = Huggingface()

            # Define a pii_detection feedback function using HuggingFace.
            f_pii_detection = Feedback(hugs.pii_detection).on_input()
            ```

        Args:
            text: A text prompt that may contain a PII.

        Returns:
            float: The likelihood that a PII is contained in the input text.
        
src/providers/huggingface/trulens/providers/huggingface/provider.py