class_docstr: This metric is a generalisation of the `SpanFMeasure`,            particularly suitable for measuring entity prediction scores
  in SLU tasks. A distance function is used to smooth the negative            contribution of wrong transcription. In particular,
  for every label match, the lexical distance between gold and predicted            fillers contributes to FPs and FNs count.
  For more information, please see `SLURP: A Spoken Language Understanding            Resource Package` by Bastianelli, Vanzo,
  Swietojanski, and Rieser.
  
  :param average: This determines the type of averaging performed            on the data: 'micro' (calculate metrics globally
  by counting the total true positives, false negatives and false positives),            'macro' (calculate metrics for each
  label, and find their unweighted mean).
  :param distance: The distance function being applied.            `word` applies WER, whereas `char` applies the Levenshtein
  distance.
class_docstr_tok: ["This","metric","is","a","generalisation","of","the","`","SpanFMeasure","`",",","particularly","suitable","for","measuring","entity","prediction","scores","in","SLU","tasks",".","A","distance","function","is","used","to","smooth","the","negative","contribution","of","wrong","transcription",".","In","particular",",","for","every","label","match",",","the","lexical","distance","between","gold","and","predicted","fillers","contributes","to","FPs","and","FNs","count",".","For","more","information",",","please","see","`","SLURP",":","A","Spoken","Language","Understanding","Resource","Package","`","by","Bastianelli",",","Vanzo",",","Swietojanski",",","and","Rieser",".",":","param","average",":","This","determines","the","type","of","averaging","performed","on","the","data",":","'micro","'","(","calculate","metrics","globally","by","counting","the","total","true","positives",",","false","negatives","and","false","positives",")",",","'macro","'","(","calculate","metrics","for","each","label",",","and","find","their","unweighted","mean",")",".",":","param","distance",":","The","distance","function","being","applied",".","`","word","`","applies","WER",",","whereas","`","char","`","applies","the","Levenshtein","distance","."]
code: def __init__(self, average: str = "micro", distance: str = "word"):
      super().__init__(average=average)
      self._distance = Distance.get_instance(distance=distance)
  
imports: from collections import defaultdict
  from copy import copy
  from typing import Dict, List, Set, Tuple
  from .distance import Distance
label_desc: Use image node_id 1 to create a new SpanDistanceFMeasure object from inherited base classes: ErrorMetric with example: obj = SpanDistanceFMeasure(average, distance)