Skip to content

Commit

Permalink
fix bug
Browse files Browse the repository at this point in the history
  • Loading branch information
omukazu committed Apr 20, 2024
1 parent 043d883 commit 054ee32
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
2 changes: 1 addition & 1 deletion configs/word_module.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
configs/word_module.yamldefaults:
defaults:
- base
- callbacks: [word_module_writer, early_stopping, lr_monitor, model_checkpoint, model_summary, progress_bar]
- datamodule: word
Expand Down
5 changes: 4 additions & 1 deletion src/kwja/metrics/char.py
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,10 @@ def _build_documents(self) -> Tuple[List[Document], List[Document], List[Documen
doc_id2predicted_sentences: Dict[str, List[Sentence]] = defaultdict(list)
doc_id2partly_gold_sentences: Dict[str, List[Sentence]] = defaultdict(list)
doc_id2gold_sentences: Dict[str, List[Sentence]] = defaultdict(list)
special_ids = set(self.dataset.tokenizer.all_special_ids) - {self.dataset.tokenizer.unk_token_id}
special_ids = {
getattr(self.dataset.tokenizer, f"{prefix}_token_id")
for prefix in ["bos", "eos", "sep", "pad", "cls", "mask"]
}
for (
example_id,
sent_segmentation_predictions,
Expand Down

0 comments on commit 054ee32

Please sign in to comment.