Advertisement
Guest User

Untitled

a guest
Jan 18th, 2020
82
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.44 KB | None | 0 0
  1. sorry
  2. this is the code :
  3. B = 65521
  4. T = {}
  5. for datasetPath in directories:
  6. samples = [f for f in listdir(datasetPath)]
  7. for file in samples:
  8. filePath = datasetPath+"/"+file
  9. fileByteSequence = readFile(filePath)
  10. fileNgrams = byteSequenceToNgrams(fileByteSequence,N)
  11. hashFileNgramsIntoDictionary(fileNgrams,T)
  12. K1 = 1000
  13. import heapq
  14. K1_most_common_Ngrams_Using_Hash_Grams = heapq.nlargest(K1, T)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement