Ejemplo n.º 1
0
def test_add_folder():
    verbaliser.add_folder(
        join(dirname(realpath(__file__)), "verbaliser_testfiles"))
    assert_phrases_file()
    assert_qa_file()
    assert_mixed_file()
    assert_nosection_file()
Ejemplo n.º 2
0
import ravestate as rs
import ravestate_nlp as nlp
import ravestate_interloc as interloc
import ravestate_rawio as rawio
import ravestate_idle as idle
import ravestate_phrases_basic_en as lang
import numpy as np
import time
from os.path import realpath, dirname, join
from ravestate_verbaliser import verbaliser
from enum import IntEnum
from reggol import get_logger

logger = get_logger(__name__)
verbaliser.add_folder(join(dirname(realpath(__file__)) + "/phrases"))

ROS_AVAILABLE = True
try:
    import rospy
    import actionlib
    import ravestate_ros1 as ros1
    from roboy_cognition_msgs.msg import OrderIceCreamAction, OrderIceCreamGoal
    from roboy_cognition_msgs.srv import Payment
    from std_msgs.msg import Bool
except ImportError:
    logger.error(
        "Could not import ROS1 dependencies. Please make sure to have ROS1 installed."
    )
    ROS_AVAILABLE = False

DESCRIPTOR_SYNONYMS = {"good", "amazing", "happy"}
Ejemplo n.º 3
0
from ravestate.state import state, Resign
from ravestate.constraint import s
from ravestate_nlp.question_word import QuestionWord
import ravestate_ontology
from ravestate_verbaliser import verbaliser

from os.path import realpath, dirname, join
import random
import datetime

import ravestate_idle

from reggol import get_logger
logger = get_logger(__name__)

verbaliser.add_folder(join(dirname(realpath(__file__)), "answering_phrases"))

ROBOY_NODE_CONF_KEY = "roboy_node_id"

with Module(name="roboyqa", config={ROBOY_NODE_CONF_KEY: 356}):

    @state(cond=s("idle:bored"), write="rawio:out")
    def hello_world_roboyqa(ctx):
        ctx["rawio:out"] = "Ask me something about myself!"

    @state(cond=s("nlp:contains-roboy") & s("nlp:is-question"),
           read="nlp:triples",
           write="rawio:out")
    def roboyqa(ctx):
        """
        answers question regarding roboy by retrieving the information out of the neo4j roboy memory graph
Ejemplo n.º 4
0
from ravestate_verbaliser import verbaliser
from os.path import realpath, dirname, join

verbaliser.add_folder(join(dirname(realpath(__file__)), "en"))