code: def test_metrics_for_text_classification(mocked_client):
      dataset = "test_metrics_for_text_classification"
  
      log(
          [
              TextClassificationRecord(
                  id=1,
                  text="my first argilla example",
                  prediction=[("spam", 0.8), ("ham", 0.2)],
                  annotation=["spam"],
              ),
              TextClassificationRecord(
                  id=2,
                  inputs={"text": "my first argilla example"},
                  prediction=[("ham", 0.8), ("spam", 0.2)],
                  annotation=["ham"],
              ),
          ],
          name=dataset,
      )
  
      results = f1(dataset)
      assert results and results.data == {
          "f1_macro": 1.0,
          "f1_micro": 1.0,
          "ham_f1": 1.0,
          "ham_precision": 1.0,
          "ham_recall": 1.0,
          "ham_support": 1,
          "precision_macro": 1.0,
          "precision_micro": 1.0,
          "recall_macro": 1.0,
          "recall_micro": 1.0,
          "spam_f1": 1.0,
          "spam_precision": 1.0,
          "spam_recall": 1.0,
          "spam_support": 1,
      }
      results.visualize()
  
      results = f1_multilabel(dataset)
      assert results and results.data == {
          "f1_macro": 1.0,
          "f1_micro": 1.0,
          "ham_f1": 1.0,
          "ham_precision": 1.0,
          "ham_recall": 1.0,
          "ham_support": 1,
          "precision_macro": 1.0,
          "precision_micro": 1.0,
          "recall_macro": 1.0,
          "recall_micro": 1.0,
          "spam_f1": 1.0,
          "spam_precision": 1.0,
          "spam_recall": 1.0,
          "spam_support": 1,
      }
      results.visualize()
  
file_path: argilla/tests/integration/metrics/test_text_classification.py
imports: import argilla
  from argilla.client import singleton
  from argilla.client.api import log
  from argilla.client.models import TextClassificationRecord
  from argilla.metrics.text_classification import f1, f1_multilabel
label_desc: Use image node_id 1 for calling a global function with example usage: test_metrics_for_text_classification(mocked_client) without return types