MCPcopy Create free account
hub / github.com/ddbourgin/numpy-ml / words_with_count

Method words_with_count

numpy_ml/preprocessing/nlp.py:1101–1103  ·  view source on GitHub ↗

Return all tokens that occur `k` times in the corpus

(self, k)

Source from the content-addressed store, hash-verified

1099 return self.counts.most_common()[:n]
1100
1101 def words_with_count(self, k):
1102 """Return all tokens that occur `k` times in the corpus"""
1103 return [w for w, c in self.counts.items() if c == k]
1104
1105 def filter(self, words, unk=True): # noqa: A003
1106 """

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected