Skip to content

Commit bcabc43

Browse files
committed
Add comment to note use of previous token index
For #1793
1 parent ed12257 commit bcabc43

1 file changed

Lines changed: 3 additions & 0 deletions

File tree

chatterbot/components.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,9 @@ def chatterbot_bigram_indexer(document):
2929
token for token in document if not (token.is_punct)
3030
]
3131

32+
# Pairs consist of the part-of-speech of the first token and the
33+
# lemma of the second token in the bigram. This provides a good
34+
# balance of generalization and specificity for matching.
3235
bigram_pairs = [
3336
f"{tokens[i - 1].pos_}:{tokens[i].lemma_.lower()}"
3437
for i in range(1, len(tokens))

0 commit comments

Comments
 (0)