class_docstr: Component that uses statistics based error model to find best candidates in a static dictionary.
  Based on An Improved Error Model for Noisy Channel Spelling Correction by Eric Brill and Robert C. Moore
  
  Args:
      dictionary: a :class:`~deeppavlov.vocabs.typos.StaticDictionary` object
      window: maximum context window size
      candidates_count: maximum number of replacement candidates to return for every token in the input
  
  Attributes:
      costs: logarithmic probabilities of character sequences replacements
      dictionary: a :class:`~deeppavlov.vocabs.typos.StaticDictionary` object
      window: maximum context window size
      candidates_count: maximum number of replacement candidates to return for every token in the input
docstr: Save replacements probabilities to a file
  
          
docstr_tok: ["Save","replacements","probabilities","to","a","file"]
code: def save(self):
      """Save replacements probabilities to a file"""
      logger.info("[saving error_model to `{}`]".format(self.save_path))
  
      with open(
          self.save_path, "w", newline="", encoding="utf8"
      ) as tsv_file:
          writer = csv.writer(tsv_file, delimiter="\t")
          for (w, s), log_p in self.costs.items():
              writer.writerow([w, s, exp(log_p)])
  
imports: import csv
  import itertools
  from collections import defaultdict, Counter
  from heapq import heappop, heappushpop, heappush
  from logging import getLogger
  from math import log, exp
  from typing import List, Iterable, Tuple
  from tqdm import tqdm
  from deeppavlov.core.common.errors import ConfigError
  from deeppavlov.core.common.registry import register
  from deeppavlov.core.models.estimator import Estimator
  from deeppavlov.vocabs.typos import StaticDictionary
label_desc: Use image node_id 8 for calling the ErrorModel obj's underlying member method code with example usage: obj.save() without return types