Global AI and Data Science

Global AI & Data Science

Train, tune and distribute models with generative AI and machine learning capabilities

 View Only

number comparison in IBM Watson Assistant

  • 1.  number comparison in IBM Watson Assistant

    Posted Mon June 21, 2021 04:16 PM

    I am trying to build a BMI calculator inside Watson but it seems like Watson is not supporting number comparison when you use the "Multiple conditioned responses".

    <? ($weight /  ($height * $height) ) < 18.5  ?>
    

    This code will throw an error:

    SpelParseException when evaluating dialog node ID [response_8_1624288200413]. Condition [<? ($weight / ($height * $height) ) < 18.5 ?>] could not be parsed. Check the syntax of the expression. SpEL syntax error: Expression [<? ($weight / ($height * $height) ) < 18.5 ?>] converted to [<? (context['weight'] / (context['height'] * context['height']) ) < 18.5 ?>] at position 0: EL1070E: Problem parsing left operand
    

    Edit: Solved it. It was my own fault. If you are setting up conditions in "Multiple conditioned responses", do not include .

    In this case, you just put ($weight / ($height * $height) ) < 18.5 in the "If assistant recognizes" section



    ------------------------------
    Anwar Jutt
    ------------------------------

    #GlobalAIandDataScience
    #GlobalDataScience