Skip to content

Commit

Permalink
Change NamedEntityExample.__str__ (#103, #116)
Browse files Browse the repository at this point in the history
  • Loading branch information
lovit committed Oct 10, 2020
1 parent a00f21d commit 8d910f3
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion Korpora/korpus_modu_ne.py
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ def __str__(self):
return self.__repr__()

def __repr__(self):
return f'NamedEntityExample(attributes=(sentence={self.sentence}, tags={self.tags}, positions={self.positions})'
return f'NamedEntityExample(id={self.sentence_id}, sentence={self.sentence}, tags={self.tags}, positions={self.positions})'


def document_to_examples(document):
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -637,7 +637,7 @@ paths_or_dir = 'path/NIKL_NE(v1.0)'
paths_or_dir = 'path/to/NIKL_NE(v1.0)/NXNE*.json'
corpus = ModuNEKorpus(paths_or_dir)
corpus.train[0]
# NamedEntityExample(attributes=(sentence=[횡설수설/권순활]北 ‘외화벌이’ 뜯어먹기, tags=['AF', 'PS', 'LC'], positions=[(1, 5), (6, 9), (10, 11)])
# NamedEntityExample(id=NWRW1800000029.315.1.1, sentence=[횡설수설/권순활]北 ‘외화벌이’ 뜯어먹기, tags=['AF', 'PS', 'LC'], positions=[(1, 5), (6, 9), (10, 11)])
corpus.train[0].sentence
# '[횡설수설/권순활]北 ‘외화벌이’ 뜯어먹기'
corpus.train[0].tags
Expand Down

0 comments on commit 8d910f3

Please sign in to comment.