Skip to content
This repository has been archived by the owner on Jul 22, 2024. It is now read-only.

Usability improvements #28

Open
wants to merge 6 commits into
base: master
Choose a base branch
from

Conversation

ooeygui
Copy link
Member

@ooeygui ooeygui commented Sep 8, 2021

No description provided.

<param name="kwregion" value="Enter your location mentioned in the speech studio" />
<param name="keywordpath" value="Enter the location of the of .table file that you downloaded from the speech studio" />
<param name="keyword" value="Enter your custom keyword" />
<param name="luiskey" value="$(arg robotId)" />
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this should be "$(arg azure_cs_luis_key)"

@@ -1,11 +1,23 @@
<launch>
<arg name="azure_cs_luis_key" default="$(env azure_cs_luis_key)"/>
<arg name="azure_cs_luis_endpoint" default="$(env azure_cs_luis_endpoint)"/>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This makes endpoint required to run the launch file, should it be optional?

Copy link
Contributor

@PranavDhulipala PranavDhulipala left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

    if (root_object)
    {
        // is this "topScoringIntent": "Move Arm Backward" on root?

        JSON_Object *topScoringIntent_object = json_object_dotget_object(root_object, "topScoringIntent");
        if (topScoringIntent_object)
        {
            intent.topIntent = json_object_dotget_string(topScoringIntent_object, "intent");
            if (!intent.topIntent.empty())
            {
                intent.score = (float)json_object_get_number(topScoringIntent_object, "score");

                score = intent.score;
            }
        }
        // Process the entities array
        JSON_Array *entities_array = json_object_get_array(root_object, "entities");
        if (entities_array)
        {
            size_t count = json_array_get_count(entities_array);
            for (size_t i = 0; i < count; i++)
            {
                JSON_Object *entity_object = json_array_get_object(entities_array, i);
                if (entity_object)
                {
                    std::string type = json_object_dotget_string(entity_object, "type");
                    std::string entity = json_object_dotget_string(entity_object, "entity");
                    if (type == "builtin.keyPhrase")
                    {
                        intent.dimension.unit = entity;
                    }
                    if (type == "builtin.number")
                    {
                        intent.dimension.value = std::stof(entity);
                    }
                }
            }
        }
    }

@ooeygui
Copy link
Member Author

ooeygui commented Oct 11, 2021

This change needs to be redone.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants