Skip to content

Commit

Permalink
Merge pull request dennybritz#154 from BrambleXu/master
Browse files Browse the repository at this point in the history
fix unicode error
  • Loading branch information
dennybritz authored Jun 25, 2018
2 parents 1b3587a + 8e18944 commit 58ecd1e
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions data_helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,9 @@ def load_data_and_labels(positive_data_file, negative_data_file):
Returns split sentences and labels.
"""
# Load data from files
positive_examples = list(open(positive_data_file, "r").readlines())
positive_examples = list(open(positive_data_file, "r", encoding='utf-8').readlines())
positive_examples = [s.strip() for s in positive_examples]
negative_examples = list(open(negative_data_file, "r").readlines())
negative_examples = list(open(negative_data_file, "r", encoding='utf-8').readlines())
negative_examples = [s.strip() for s in negative_examples]
# Split by words
x_text = positive_examples + negative_examples
Expand Down

0 comments on commit 58ecd1e

Please sign in to comment.