Skip to content

Commit

Permalink
fix unicode error
Browse files Browse the repository at this point in the history
  • Loading branch information
Ubuntu committed Jun 22, 2018
1 parent 1b3587a commit 8e18944
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 8e18944

Please sign in to comment.