Skip to content
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Fix indentation mistake
  • Loading branch information
wradstok committed Jul 20, 2020
commit 20c37cdb134642a51e582386fb624239bbc4a180
2 changes: 1 addition & 1 deletion codes/run.py
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ def read_triple(file_path, entity2id, relation2id):
triples = []
with open(file_path) as fin:
for line in fin:
h, r, t = map(lambda x: x.strip(), unicodedata.normalize('NFKC', line).split('\t'))
h, r, t = map(lambda x: x.strip(), unicodedata.normalize('NFKC', line).split('\t'))
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

str.strip could be a shorter replacement for lambda x: x.strip()

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, didn't realize this was possible.

triples.append((entity2id[h], relation2id[r], entity2id[t]))
return triples

Expand Down