csurfer / rake-nltk

Python implementation of the Rapid Automatic Keyword Extraction algorithm using NLTK.
https://csurfer.github.io/rake-nltk
MIT License
1.06k stars 150 forks source link

improvement for speed and clarity #1

Closed cgratie closed 7 years ago

cgratie commented 7 years ago

Hi, and thanks for writing the RAKE algorithm using NLTK.

I've noticed in the code that you keep phrases as lists of words, which then makes it more difficult to compute the list of unique phrases. What I changed was to use tuples instead of lists, then the list of phrases can be a set instead and you get unique phrases with less code, and faster as well.

coveralls commented 7 years ago

Coverage Status

Coverage decreased (-0.1%) to 98.75% when pulling c0be29399bbc998a3f50b634672fa47cdfed2cc2 on cgratie:master into 4224305426f310928bd8449e11f8604c076559b9 on csurfer:master.

coveralls commented 7 years ago

Coverage Status

Coverage decreased (-0.1%) to 98.75% when pulling c0be29399bbc998a3f50b634672fa47cdfed2cc2 on cgratie:master into 4224305426f310928bd8449e11f8604c076559b9 on csurfer:master.

coveralls commented 7 years ago

Coverage Status

Coverage decreased (-0.1%) to 98.75% when pulling c0be29399bbc998a3f50b634672fa47cdfed2cc2 on cgratie:master into 4224305426f310928bd8449e11f8604c076559b9 on csurfer:master.

coveralls commented 7 years ago

Coverage Status

Coverage increased (+1.1%) to 100.0% when pulling ec8ffe11a13d55b83c8d5d6030e6865b400a3467 on cgratie:master into 4224305426f310928bd8449e11f8604c076559b9 on csurfer:master.

coveralls commented 7 years ago

Coverage Status

Coverage increased (+1.1%) to 100.0% when pulling ec8ffe11a13d55b83c8d5d6030e6865b400a3467 on cgratie:master into 4224305426f310928bd8449e11f8604c076559b9 on csurfer:master.

coveralls commented 7 years ago

Coverage Status

Coverage increased (+1.1%) to 100.0% when pulling ec8ffe11a13d55b83c8d5d6030e6865b400a3467 on cgratie:master into 4224305426f310928bd8449e11f8604c076559b9 on csurfer:master.

coveralls commented 7 years ago

Coverage Status

Coverage increased (+1.1%) to 100.0% when pulling db1bca72302a3d4060711090a1e5754ccda012bf on cgratie:master into 4224305426f310928bd8449e11f8604c076559b9 on csurfer:master.