    def _handle_continued_spans(spans: List[TypedStringSpan]) -> List[TypedStringSpan]:
        """
        The official CONLL 2012 evaluation script for SRL treats continued spans (i.e spans which
        have a `C-` prepended to another valid tag) as part of the span that they are continuing.
        This is basically a massive hack to allow SRL models which produce a linear sequence of
        predictions to do something close to structured prediction. However, this means that to
        compute the metric, these continuation spans need to be merged into the span to which
        they refer. The way this is done is to simply consider the span for the continued argument
        to start at the start index of the first occurrence of the span and end at the end index
        of the last occurrence of the span. Handling this is important, because predicting continued
        spans is difficult and typically will effect overall average F1 score by ~ 2 points.

        # Parameters

        spans : `List[TypedStringSpan]`, required.
            A list of (label, (start, end)) spans.

        # Returns

        A `List[TypedStringSpan]` with continued arguments replaced with a single span.
        """
        span_set: Set[TypedStringSpan] = set(spans)
        continued_labels: List[str] = [
            label[2:] for (label, span) in span_set if label.startswith("C-")
        ]
        for label in continued_labels:
            continued_spans = {span for span in span_set if label in span[0]}

            span_start = min(span[1][0] for span in continued_spans)
            span_end = max(span[1][1] for span in continued_spans)
            replacement_span: TypedStringSpan = (label, (span_start, span_end))

            span_set.difference_update(continued_spans)
            span_set.add(replacement_span)

        return list(span_set)
The official CONLL 2012 evaluation script for SRL treats continued spans (i.e spans which
have a `C-` prepended to another valid tag) as part of the span that they are continuing.
This is basically a massive hack to allow SRL models which produce a linear sequence of
predictions to do something close to structured prediction. However, this means that to
compute the metric, these continuation spans need to be merged into the span to which
they refer. The way this is done is to simply consider the span for the continued argument
to start at the start index of the first occurrence of the span and end at the end index
of the last occurrence of the span. Handling this is important, because predicting continued
spans is difficult and typically will effect overall average F1 score by ~ 2 points.

# Parameters

spans : `List[TypedStringSpan]`, required.
A list of (label, (start, end)) spans.

# Returns

A `List[TypedStringSpan]` with continued arguments replaced with a single span.
allennlp/training/metrics/span_based_f1_measure.py