Created
June 8, 2020 08:52
-
-
Save ferrygun/7229d5b9aea763d2503c8945f119178f 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
articles = [] | |
labels = [] | |
with open("/tmp/bbc-text.csv", 'r') as csvfile: | |
reader = csv.reader(csvfile, delimiter=',') | |
next(reader) | |
for row in reader: | |
labels.append(row[0]) | |
article = row[1] | |
for word in STOPWORDS: | |
token = ' ' + word + ' ' | |
article = article.replace(token, ' ') | |
article = article.replace(' ', ' ') | |
articles.append(article) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment