code: def filtered_error_rate(hyps_path: Union[str, Path], refs_path: Union[str, Path], labels: Set[str]) -> float:
      
      if isinstance(hyps_path, Path):
          hyps_path = str(hyps_path)
      if isinstance(refs_path, Path):
          refs_path = str(refs_path)
  
      with open(hyps_path) as hyps_f:
          lines = hyps_f.readlines()
          hyps = [filter_labels(line.split(), labels) for line in lines]
      with open(refs_path) as refs_f:
          lines = refs_f.readlines()
          refs = [filter_labels(line.split(), labels) for line in lines]
  
      # For the case where there are no tokens left after filtering.
      only_empty = True
      for entry in hyps:
          if entry is not []:
              only_empty = False
              break # found something so can move on immediately
      if only_empty:
          return -1
  
      return utils.batch_per(hyps, refs)
docs: Returns the error rate of hypotheses in hyps_path against references in refs_path after filtering only for labels in labels.