Method: TfIdfSimilarity::TfIdfModel#augmented_log_term_frequency
- Defined in:
- lib/tf-idf-similarity/extras/tf_idf_model.rb
permalink #augmented_log_term_frequency(document, term) ⇒ Object Also known as: augmented_log_tf
Chisholm LOGG
173 174 175 176 177 178 179 180 |
# File 'lib/tf-idf-similarity/extras/tf_idf_model.rb', line 173 def augmented_log_term_frequency(document, term) count = document.term_count(term) if count > 0 0.2 + 0.8 * log(count + 1) else 0 end end |