From be6c481d765cd875757ed676fe9844f22c8826fb Mon Sep 17 00:00:00 2001 From: Konstantin Sering Date: Tue, 28 Nov 2023 11:11:25 +0100 Subject: [PATCH] fixes word_to_word event file creation for line event structure (#246) --- pyndl/preprocess.py | 8 ++++++-- pyproject.toml | 2 +- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/pyndl/preprocess.py b/pyndl/preprocess.py index 7a98af7..8aa1219 100644 --- a/pyndl/preprocess.py +++ b/pyndl/preprocess.py @@ -322,8 +322,12 @@ def gen_occurrences(words): occurrences.append(("_".join(cues), word)) return occurrences elif event_structure == 'line': - # (cues, outcomes) with empty outcomes - return [('_'.join(words), ''), ] + #{"trigrams_to_word", "word_to_word", "bigrams_to_word"} + if cue_structure in ("trigrams_to_word", "bigrams_to_word"): + # (cues, outcomes) with empty outcomes + return [('_'.join(words), ''), ] + else: + return [('_'.join(words), '_'.join(words)), ] else: raise ValueError('gen_occurrences should be one of {"consecutive_words", "word_to_word", "line"}') diff --git a/pyproject.toml b/pyproject.toml index d9e1688..6e9c395 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [tool.poetry] name = "pyndl" -version = "1.1.2" +version = "1.2.0" description = "Naive discriminative learning implements learning and classification models based on the Rescorla-Wagner equations." license = "MIT"