watson-developer-cloud / assistant-with-discovery

DEPRECATED: this application is deprecated and thus will not receive fixes or security updates. It is archived for educational purposes, but may not function.
Apache License 2.0
145 stars 342 forks source link

Bot sends back `CEPayload` even when it understood the input #39

Closed MunGell closed 8 years ago

MunGell commented 8 years ago

After once asking bot something it does not know it will always show list of findings instead of real answer.

Steps to reproduce:

  1. Open demo page: http://conversation-enhanced.mybluemix.net/
  2. say switch off the lights (works as expected)
  3. say how are things? (works as expected - bot does not know the answer and shows some random articles that mention "things")
  4. say switch lights on

Expected:

Bot should say "Ok. Turning on the lights."

Actual:

List of articles on "switch on" search query shown.

Example response from Watson:

{
  "context": {
    "conversation_id": "a339359e-0eda-407e-a401-2b1be3048a91",
    "system": {
      "dialog_stack": [
        "root"
      ],
      "dialog_turn_counter": 5,
      "dialog_request_counter": 5
    },
    "default_counter": 0,
    "reprompt": true,
    "call_retrieve_and_rank": true
  },
  "entities": [
    {
      "entity": "appliance",
      "location": [
        7,
        13
      ],
      "value": "lights"
    }
  ],
  "intents": [
    {
      "confidence": 0.7631506905028111,
      "intent": "turn_on"
    }
  ],
  "output": {
    "log_messages": [],
    "text": [
      "",
      "Ok. Turning on the lights."
    ],
    "nodes_visited": [
      "node_1_1467232431348",
      "node_2_1467232480480",
      "node_1_1467749020340"
    ],
    "CEPayload": [
      {
        "title": "Warning Lamps and Indicators",
        "body": "The following warning lamps and indicators will alert you to a vehicle condition that may become serious. Some lamps will light when you start your vehicle to make sure they work. If any lamps remain on after starting your vehicle, refer to the respective system warning lamp for further information.<br><br>On (white light): Lights when you turn the adaptive cruise control system on. Turns off when you turn the speed control system off.<br><br>",
        "sourceUrl": "http://www.fordservicecontent.com/Ford_Content/vdirsnet/OwnerManual/Home/Content?bookCode=O28450&languageCode=en&marketCode=US&viewTech=IE&chapterTitleSelected=G1518901&subTitleSelected=G1746332&topicHRef=G1746333&div=f&vFilteringEnabled=True",
        "highlight": "\" malfunction. Have an authorized dealer check the system immediately.<br><br>To confirm the lamp is working, it will also <em>light</em> momentarily when you <em>switch</em> on\"",
        "id": "73",
        "confidence": "0.9736655289893887"
      },
      {
        "title": "Charging the High Voltage Battery",
        "body": "Your vehicle is equipped with a standard 120 volt convenience cord. Lift the load floor carpet in the rear of your vehicle to access the 120 volt convenience cord.<br><br> We recommend upgrading to the optional 240 volt charging station for faster more efficient charging.  It takes approximately 2.5 hours to completely charge an empty battery using a 240 volt charging station.<br><br>",
        "sourceUrl": "http://www.fordservicecontent.com/Ford_Content/vdirsnet/OwnerManual/Home/Content?bookCode=O28450&languageCode=en&marketCode=US&viewTech=IE&chapterTitleSelected=G1525717&subTitleSelected=G1525718&topicHRef=G1525719&div=f&vFilteringEnabled=True",
        "highlight": "\" thumb to open and close the door.<br><br>The <em>light</em> ring located around the charge port indicates the charge status of the high voltage battery in your\"",
        "id": "110",
        "confidence": "0.18123331239496135"
      },
      {
        "title": "Autolamps",
        "body": "When the lighting control is in the autolamps position, the headlamps automatically turn on in low light situations or when the wipers activate.<br><br>The headlamps remain on for a period of time after you switch the ignition off. Use the information display controls to adjust the period of time that the headlamps remain on. See Information Displays. <br><br>",
        "sourceUrl": "http://www.fordservicecontent.com/Ford_Content/vdirsnet/OwnerManual/Home/Content?bookCode=O28450&languageCode=en&marketCode=US&viewTech=IE&chapterTitleSelected=G1518885&subTitleSelected=G1662500&topicHRef=G1632990&div=f&vFilteringEnabled=True",
        "highlight": "\" windshield wipers on and the <em>lighting</em> control is in the autolamps position. They turn off approximately 60 seconds after you <em>switch</em> the windshield wipers off\"",
        "id": "57",
        "confidence": "0.034579484890305615"
      },
      {
        "title": "Daytime Running Lamps",
        "body": "Switch the daytime running lamps on or off using the information display controls. See  General Information. <br><br>The other lighting control switch positions do not activate the daytime running lamps, and you can use them to temporarily override autolamp control.<br><br>",
        "sourceUrl": "http://www.fordservicecontent.com/Ford_Content/vdirsnet/OwnerManual/Home/Content?bookCode=O28450&languageCode=en&marketCode=US&viewTech=IE&chapterTitleSelected=G1518885&subTitleSelected=G1662501&topicHRef=G1628345&div=f&vFilteringEnabled=True",
        "highlight": "\"<em>Switch</em> the daytime running lamps on or off using the information display controls. See  General Information. <br><br>The other <em>lighting</em> control\"",
        "id": "60",
        "confidence": "0.014238458065079252"
      },
      {
        "title": "Automatic High Beam Control",
        "body": "The system will automatically turn on your high beams if it is dark enough and no other traffic is present. When it detects the headlights of an approaching vehicle, the tail lamps of the preceding vehicle or street lighting, the system will turn off the high beams before they distract other drivers. The low beams remain on.<br><br>A camera sensor, centrally mounted behind the windshield of your vehicle, continuously monitors conditions to decide when to switch the high beams off and on.<br><br>",
        "sourceUrl": "http://www.fordservicecontent.com/Ford_Content/vdirsnet/OwnerManual/Home/Content?bookCode=O28450&languageCode=en&marketCode=US&viewTech=IE&chapterTitleSelected=G1518885&subTitleSelected=G1560458&topicHRef=G1560459&div=f&vFilteringEnabled=True",
        "highlight": "\">Use the information display menu to permanently deactivate the system, or turn the <em>lighting</em> control <em>switch</em> from autolamps to headlamps.<br><br>\"",
        "id": "61",
        "confidence": "0.0"
      }
    ]
  },
  "input": {
    "text": "switch lights on"
  }
}
dgterry commented 8 years ago

Thank you for reporting this. The problem was when Conversation set the call_retrieve_and_rank flag to true, to indicate that the app should call R&R for an answer, the app never reset it to false for subsequent calls. So no matter what happened once we got in that state the app would call R&R. This has been fixed. The app now sets the flag to false before making any call to Conversation and only Conversation is able to set the flag to true.