This is the part of the code:
'''
Don’t leave your dreams to chance.
'''
def _create_frequency_table(text_string) -> dict:
"""
we create a dictionary for the word frequency table.
For this, we should only use the words that are not part of the stopWords array.
Removing stop words and making frequency table
Stemmer - an algorithm to bring words to its root word.
:rtype: dict
"""
stopWords = set(stopwords.words("english"))
words = word_tokenize(text_string)
ps = PorterStemmer()
This is the part of code I'm trying to understand.. and below is the error.
line 29
def _create_frequency_table(text_string) -> dict:
^
SyntaxError: invalid syntax
Any help will be greatly appreciated,