# ngram_overlap_score

> **Function** in `langchain_community`

📖 [View in docs](https://reference.langchain.com/python/langchain-community/example_selectors/ngram_overlap/ngram_overlap_score)

Compute ngram overlap score of source and example as `sentence_bleu` score
from NLTK package.

Use `sentence_bleu` with `method1` smoothing function and auto reweighting.

Return float value between 0.0 and 1.0 inclusive.

https://www.nltk.org/_modules/nltk/translate/bleu_score.html
https://aclanthology.org/P02-1040.pdf

## Signature

```python
ngram_overlap_score(
    source: List[str],
    example: List[str],
) -> float
```

---

[View source on GitHub](https://github.com/langchain-ai/langchain-community/blob/a6a6079511ac8a5c1293337f88096b8641562e77/libs/community/langchain_community/example_selectors/ngram_overlap.py#L15)