Skip to content

Commit

Permalink
add constant for training_data.json
Browse files Browse the repository at this point in the history
  • Loading branch information
wochinge committed Mar 4, 2019
1 parent e668743 commit 7604f32
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions rasa_nlu/training_data/training_data.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@
from rasa_nlu.training_data.util import check_duplicate_synonym
from rasa_nlu.utils import lazyproperty, list_to_str, write_to_file

DEFAULT_TRAINING_DATA_OUTPUT_PATH = "training_data.json"

logger = logging.getLogger(__name__)


Expand Down Expand Up @@ -125,7 +127,8 @@ def as_markdown(self) -> Text:
from rasa_nlu.training_data.formats import MarkdownWriter
return MarkdownWriter().dumps(self)

def persist(self, dir_name: Text, filename: Text = "training_data.json"
def persist(self, dir_name: Text,
filename: Text = DEFAULT_TRAINING_DATA_OUTPUT_PATH
) -> Dict[Text, Any]:
"""Persists this training data to disk and returns necessary
information to load it again."""
Expand All @@ -137,7 +140,7 @@ def persist(self, dir_name: Text, filename: Text = "training_data.json"
write_to_file(data_file, self.as_json(indent=2))

return {
"training_data": "training_data.json"
"training_data": DEFAULT_TRAINING_DATA_OUTPUT_PATH
}

def sorted_entities(self) -> List[Any]:
Expand Down

0 comments on commit 7604f32

Please sign in to comment.