Skip to content

Instantly share code, notes, and snippets.

Avatar

Justina Petraityte JustinaPetr

View GitHub Profile
View config.yml
pipeline:
- name: "intent_featurizer_count_vectors"
- name: "intent_classifier_tensorflow_embedding"
intent_tokenization_flag: true
intent_split_symbol: "+"
View load_nlu_model.py
interpreter = Interpreter.load('models/current/nlu_model')
print(interpreter.parse("Yes. Can you give me suggestions on how to get there?"))
View output.json
{
'intent':{
'name':'affirm+ask_transport',
'confidence':0.918471097946167
},
'entities':[
],
'intent_ranking':[
{
View domain.yml
templates:
utter_greet:
- "Hey, how can I help you?"
utter_goodbye:
- "Talk to you later!"
- "Goodbye :("
- "Bye!"
utter_affirm:
- "Cool. Let me book the spot for you."
- "Glad to hear. I'll make an RSVP for you."
View actions.py
from rasa_sdk import Action, Tracker
from rasa_sdk.events import SlotSet, AllSlotsReset
import requests
import json
from random import randint
import datetime
import os
import yaml
class ActionPlaceSearch(Action):
View action.json
{
"actions": [
{
"description": "Default Welcome Intent",
"name": "MAIN",
"fulfillment": {
"conversationName": "<INSERT YOUR CONVERSATION NAME HERE>"
},
"intent": {
"name": "actions.intent.MAIN",
View action_completed.json
{
"actions": [
{
"description": "Default Welcome Intent",
"name": "MAIN",
"fulfillment": {
"conversationName": "welcome"
},
"intent": {
"name": "actions.intent.MAIN",
View gist:51ba567f9fea5c69c8c9a2bab86fa512
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals
import logging
from flask import Flask, Response, Blueprint, request, jsonify
from rasa_core.channels.channel import UserMessage, OutputChannel
from rasa_core.channels.channel import InputChannel
View ga_connector_libraries.py
import logging
import json
from sanic import Blueprint, response
from sanic.request import Request
from typing import Text, Optional, List, Dict, Any
from rasa.core.channels.channel import UserMessage, OutputChannel
from rasa.core.channels.channel import InputChannel
from rasa.core.channels.channel import CollectingOutputChannel
View ga_connector_class.py
class GoogleAssistant(InputChannel):
@classmethod
def name(cls):
def blueprint(self, on_new_message):