Skip to content

Instantly share code, notes, and snippets.

@jcabot
Last active March 23, 2022 15:10
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jcabot/0beb16be016a3be726c97aae73c59b22 to your computer and use it in GitHub Desktop.
Save jcabot/0beb16be016a3be726c97aae73c59b22 to your computer and use it in GitHub Desktop.
(Partial) Chatbot DSL
class Intent:
def __init__(self, name: str, training_sentences: list[str]):
self.name: str = name
self.training_sentences: list[str] = training_sentences
class NLUContext:
def __init__(self, name: str):
self.name: str = name
self.intents: list[Intent] = []
self.tokenizer: tf.keras.preprocessing.text.Tokenizer = None
self.nlp_model: tf.keras.models = None
class Bot:
def __init__(self, bot_id: uuid, name: str, configuration: NlpConfiguration = None):
self.bot_id: uuid = bot_id
self.name: str = name
self.contexts: list[NLUContext] = []
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment