class_docstr: Pipeline that learns span boundaries.
  
  DOCS: https://spacy.io/api/spanfinder
class_docstr_tok: ["Pipeline","that","learns","span","boundaries",".","DOCS",":","https",":","\/\/spacy.io\/api\/spanfinder"]
docstr: Modify a batch of Doc objects, using pre-computed scores.
  docs (Iterable[Doc]): The documents to modify.
  scores: The scores to set, produced by SpanFinder predict method.
  
  DOCS: https://spacy.io/api/spanfinder#set_annotations
docstr_tok: ["Modify","a","batch","of","Doc","objects",",","using","pre-computed","scores",".","docs","(","Iterable","[","Doc","]",")",":","The","documents","to","modify",".","scores",":","The","scores","to","set",",","produced","by","SpanFinder","predict","method",".","DOCS",":","https",":","\/\/spacy.io\/api\/spanfinder","#","set_annotations"]
code: def set_annotations(
      self, docs: Iterable[Doc], scores: Floats2d
  ) -> None:
      """Modify a batch of Doc objects, using pre-computed scores.
      docs (Iterable[Doc]): The documents to modify.
      scores: The scores to set, produced by SpanFinder predict method.
  
      DOCS: https://spacy.io/api/spanfinder#set_annotations
      """
      offset = 0
      for i, doc in enumerate(docs):
          doc.spans[self.cfg["spans_key"]] = []
          starts = []
          ends = []
          doc_scores = scores[offset : offset + len(doc)]
  
          for token, token_score in zip(doc, doc_scores):
              if token_score[0] >= self.cfg["threshold"]:
                  starts.append(token.i)
              if token_score[1] >= self.cfg["threshold"]:
                  ends.append(token.i)
  
          for start in starts:
              for end in ends:
                  span_length = end + 1 - start
                  if span_length < 1:
                      continue
                  if (
                      self.cfg["min_length"] is None
                      or self.cfg["min_length"] <= span_length
                  ) and (
                      self.cfg["max_length"] is None
                      or span_length <= self.cfg["max_length"]
                  ):
                      doc.spans[self.cfg["spans_key"]].append(
                          doc[start : end + 1]
                      )
          offset += len(doc)
  
imports: from typing import Any, Callable, Dict, Iterable, List, Optional, Tuple
  from thinc.api import Config, Model, Optimizer, set_dropout_rate
  from thinc.types import Floats2d
  from ..errors import Errors
  from ..language import Language
  from ..scorer import Scorer
  from ..tokens import Doc, Span
  from ..training import Example
  from ..util import registry
  from .spancat import DEFAULT_SPANS_KEY
  from .trainable_pipe import TrainablePipe
label_desc: Use image node_id 3 for calling the SpanFinder obj's underlying member method code with example usage: obj.set_annotations(docs, scores) without return types