class_docstr: Configured metrics for token classification
class_docstr_tok: ["Configured","metrics","for","token","classification"]
docstr: Compute metrics at record level
docstr_tok: ["Compute","metrics","at","record","level"]
code: def record_metrics(
      cls, record: ServiceTokenClassificationRecord
  ) -> Dict[str, Any]:
      """Compute metrics at record level"""
      base_metrics = super(
          TokenClassificationMetrics, cls
      ).record_metrics(record)
  
      tokens_metrics = cls.build_tokens_metrics(record)
      return {
          **base_metrics,
          "tokens": tokens_metrics,
          "predicted": {
              "mentions": cls.mentions_metrics(
                  record, record.predicted_mentions()
              )
          },
          "annotated": {
              "mentions": cls.mentions_metrics(
                  record, record.annotated_mentions()
              )
          },
      }
  
imports: from typing import Any, ClassVar, Dict, Iterable, List, Optional, Set, Tuple
  from argilla.server.pydantic_v1 import BaseModel, Field
  from argilla.server.services.metrics import ServiceBaseMetric, ServicePythonMetric
  from argilla.server.services.metrics.models import CommonTasksMetrics
  from argilla.server.services.search.model import ServiceRecordsQuery
  from argilla.server.services.tasks.token_classification.model import EntitySpan, ServiceTokenClassificationAnnotation, ServiceTokenClassificationRecord
  from argilla.utils import SpanUtils
label_desc: Use image node_id 5 for calling the TokenClassificationMetrics obj's underlying member method code with example usage: obj.record_metrics(cls, record) and returns: dict