()
| 862 | |
| 863 | |
| 864 | def test_frequency_distribution_is_correct(): |
| 865 | nlp = English() |
| 866 | docs = [ |
| 867 | Doc(nlp.vocab, words=["Bank", "of", "China"]), |
| 868 | Doc(nlp.vocab, words=["China"]), |
| 869 | ] |
| 870 | |
| 871 | expected = Counter({"china": 0.5, "bank": 0.25, "of": 0.25}) |
| 872 | freq_distribution = _get_distribution(docs, normalize=True) |
| 873 | assert freq_distribution == expected |
| 874 | |
| 875 | |
| 876 | def test_kl_divergence_computation_is_correct(): |
nothing calls this directly
no test coverage detected
searching dependent graphs…