Skip to content

Instantly share code, notes, and snippets.

View wochinge's full-sized avatar

Tobias Wochinger wochinge

View GitHub Profile
@wochinge
wochinge / constructor1.py
Last active August 26, 2020 07:41
Simple implementation of a TrainingDataImporter (https://rasa.com/docs/rasa/api/training-data-importers/) in Rasa
def __init__(self,
config_path: Optional[Text] = None,
domain_path: Optional[Text] = None,
training_data_paths: Optional[Union[List[Text], Text]] = None,
repository: Text = ""):
github = Github()
self.repository = github.get_repo(repository)
@wochinge
wochinge / migrate_tracker_store_to_rasa_x.py
Last active March 11, 2020 16:06
Migrates a Rasa tracker store (Redis, Mongo, SQL) to Rasa X.
# This gist is deprecated.
# Please follow the guide here
# https://rasa.com/docs/rasa-x/installation-and-setup/existing-deployment/#import-existing-conversations-from-rasa-open-source
# to migrate from Rasa Open Source to Rasa X
@wochinge
wochinge / policy_config_twostagefallback.yml
Last active January 24, 2019 17:01
Policy Configuration TwoStageFallbackPolicy
policies:
 - name: TwoStageFallbackPolicy
nlu_threshold: 0.8
# other policies of yours
@wochinge
wochinge / test_train_split.py
Created January 24, 2019 16:44
Rasa Test Train split
from rasa_nlu.training_data.loading import load_data
data = load_data('<path to your nlu training data>')
train, test = data.train_test_split()
train.persist('<output directory for training data>')
test.persist('<output directory for test data>')
@wochinge
wochinge / ActionDefaultAskAffirmation.py
Last active September 15, 2022 13:02
ActionDefaultAskAffirmation
from rasa_core_sdk import Action
import csv
class ActionDefaultAskAffirmation(Action):
"""Asks for an affirmation of the intent if NLU threshold is not met."""
def name(self):
return "action_default_ask_affirmation"