hse-aml / natural-language-processing

Resources for "Natural Language Processing" Coursera course.

Home Page:https://www.coursera.org/learn/language-processing

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Week 1: Invalid Syntax

ashraf21c opened this issue · comments

Hello,
This code returns an "Invalid Syntax" error.

`REPLACE_BY_SPACE_RE = re.compile('[/(){}[]|@,;]')
BAD_SYMBOLS_RE = re.compile('[^0-9a-z #+_]')
STOPWORDS = set(stopwords.words('english'))

def text_prepare(text):
"""
text: a string

    return: modified initial string
"""
text = # lowercase text
text = # replace REPLACE_BY_SPACE_RE symbols by space in text
text = # delete symbols which are in BAD_SYMBOLS_RE from text
text = # delete stopwords from text
return text`

The problem is in this specific line of code:

text = # lowercase text

I found the solution at course`s forum.
You have to uncomment it and type your answer.