code: def _score_unigram_candidates(
      candidates: Iterable[Token],
      word_freqs: dict[int, int],
      word_scores: dict[int, float],
      term_scores: dict[str, float],
      stop_words: set[str],
      seen_candidates: set[str],
      normalize: Optional[str],
  ):
      attr_name = _get_attr_name(normalize, False)
      attr_name_str = _get_attr_name(normalize, True)
      for word in candidates:
          w_id = getattr(word, attr_name)
          if w_id in stop_words or w_id in seen_candidates:
              continue
          else:
              seen_candidates.add(w_id)
          # NOTE: here i've modified the YAKE algorithm to put less emphasis on term freq
          # term_scores[word.lower_] = word_scores[w_id] / (word_freqs[w_id] * (1 + word_scores[w_id]))
          term_scores[getattr(word, attr_name_str)] = word_scores[
              w_id
          ] / (
              math.log2(1 + word_freqs[w_id]) * (1 + word_scores[w_id])
          )
  
file_path: textacy/src/textacy/extract/keyterms/yake.py
imports: from __future__ import annotations
  import collections
  import functools
  import math
  import operator
  import statistics
  from typing import Collection, Iterable, Optional
  from cytoolz import itertoolz
  from spacy.tokens import Doc, Token
  from ...None import errors, utils
  from ..None import utils
label_desc: Use image node_id 6 for calling a global function with example usage: _score_unigram_candidates(candidates, word_freqs, word_scores, term_scores, stop_words, seen_candidates, normalize) without return types