Skip to content

Commit

Permalink
Merge pull request #755 from snipsco/fix/mutated-config
Browse files Browse the repository at this point in the history
Fix issue with mutated config
  • Loading branch information
adrienball authored Feb 13, 2019
2 parents e24db67 + f502431 commit e9b2b28
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions snips_nlu/slot_filler/crf_slot_filler.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
import shutil
import tempfile
from builtins import range
from copy import deepcopy
from pathlib import Path

from future.utils import iteritems
Expand Down Expand Up @@ -48,6 +49,9 @@ class CRFSlotFiller(SlotFiller):
def __init__(self, config=None, **shared):
"""The CRF slot filler can be configured by passing a
:class:`.CRFSlotFillerConfig`"""
# The CRFSlotFillerConfig must be deep-copied as it is mutated when
# fitting the feature factories
config = deepcopy(config)
super(CRFSlotFiller, self).__init__(config, **shared)
self.crf_model = None
self.features_factories = [
Expand Down

0 comments on commit e9b2b28

Please sign in to comment.