MCPcopy Create free account
hub / github.com/AIS-SNU/Smart-Infinity / shingles

Function shingles

DeepSpeedExample/tools/openwebtext/find_duplicates.py:26–28  ·  view source on GitHub ↗
(text, char_ngram=5)

Source from the content-addressed store, hash-verified

24# This function is adapted from:
25# https://github.com/mattilyra/LSH/blob/master/examples/Introduction.ipynb
26def shingles(text, char_ngram=5):
27 return set(text[head:head + char_ngram]
28 for head in range(0, len(text) - char_ngram))
29
30
31# This function is adapted from:

Callers 1

find_duplicates.pyFile · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected