Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fixed radom state in splitting and train #4907

Closed
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions rasa/nlu/training_data/training_data.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
from rasa.nlu.training_data.message import Message
from rasa.nlu.training_data.util import check_duplicate_synonym
from rasa.nlu.utils import list_to_str
from sklearn.model_selection import train_test_split

DEFAULT_TRAINING_DATA_OUTPUT_PATH = "training_data.json"

Expand Down Expand Up @@ -349,6 +350,7 @@ def train_test_split(
preserving the fraction of examples per intent."""

# collect all nlu data

test, train = self.split_nlu_examples(train_frac, random_seed)

# collect all nlg stories
Expand Down Expand Up @@ -395,6 +397,7 @@ def build_nlg_stories_from_examples(examples) -> Dict[Text, list]:
]
return nlg_stories


def split_nlu_examples(
self, train_frac: float, random_seed: Optional[int] = None
) -> Tuple[list, list]:
Expand Down