Created
October 4, 2020 14:32
-
-
Save abhishek-shrm/3650bc2adc9007249dd4aa1de58a89b3 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Function for pre-processing keywords | |
def preprocess_keys(text): | |
# Case Normalization | |
text=text.lower() | |
# Removing hyphen and whitespaces | |
text=re.sub('(\s|-)+',' ',text) | |
# Removing any leading and trailing spaces | |
text=text.strip() | |
return text | |
# Pre-processing Keywords | |
for i in keys: | |
keys[i]=[preprocess_keys(key) for key in keys[i]] | |
# Printing some sample keywords | |
dict(list(keys.items())[:4]) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment