How to use the nlu.messages.yes_no_message.YesNoMessage function in nlu

To help you get started, we’ve selected a few nlu examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github JoshRosen / cmps140_creative_cooking_assistant / nlu / messages / yes_no_message.py View on Github external
def confidence(raw_input_string):
        tokenizer = nltk.WordPunctTokenizer()
        tokenized_string = tokenizer.tokenize(raw_input_string)
        
        yesDistanceSet = utils.min_synset_distance_in_sentence(
                            YesNoMessage.yes_keywords,
                            tokenized_string)
        noDistanceSet = utils.min_synset_distance_in_sentence(
                            YesNoMessage.no_keywords,
                            tokenized_string)
                            
        # check minDistance
        if yesDistanceSet and yesDistanceSet[1] <= YesNoMessage.minDistance:
            return 1.0
        else:
            yesDistanceSet = None
        if noDistanceSet and noDistanceSet[1] <= YesNoMessage.minDistance:
            return 1.0
        else:
            noDistanceSet = None
        if yesDistanceSet == None and noDistanceSet == None:
            return 0.0
github JoshRosen / cmps140_creative_cooking_assistant / nlu / messages / yes_no_message.py View on Github external
def confidence(raw_input_string):
        tokenizer = nltk.WordPunctTokenizer()
        tokenized_string = tokenizer.tokenize(raw_input_string)
        
        yesDistanceSet = utils.min_synset_distance_in_sentence(
                            YesNoMessage.yes_keywords,
                            tokenized_string)
        noDistanceSet = utils.min_synset_distance_in_sentence(
                            YesNoMessage.no_keywords,
                            tokenized_string)
                            
        # check minDistance
        if yesDistanceSet and yesDistanceSet[1] <= YesNoMessage.minDistance:
            return 1.0
        else:
            yesDistanceSet = None
        if noDistanceSet and noDistanceSet[1] <= YesNoMessage.minDistance:
            return 1.0
        else:
            noDistanceSet = None
        if yesDistanceSet == None and noDistanceSet == None:
            return 0.0
github JoshRosen / cmps140_creative_cooking_assistant / nlu / messages / yes_no_message.py View on Github external
def confidence(raw_input_string):
        tokenizer = nltk.WordPunctTokenizer()
        tokenized_string = tokenizer.tokenize(raw_input_string)
        
        yesDistanceSet = utils.min_synset_distance_in_sentence(
                            YesNoMessage.yes_keywords,
                            tokenized_string)
        noDistanceSet = utils.min_synset_distance_in_sentence(
                            YesNoMessage.no_keywords,
                            tokenized_string)
                            
        # check minDistance
        if yesDistanceSet and yesDistanceSet[1] <= YesNoMessage.minDistance:
            return 1.0
        else:
            yesDistanceSet = None
        if noDistanceSet and noDistanceSet[1] <= YesNoMessage.minDistance:
            return 1.0
        else:
            noDistanceSet = None
        if yesDistanceSet == None and noDistanceSet == None:
            return 0.0