Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def confidence(raw_input_string):
return get_keyword_confidence(raw_input_string,
SystemMessage.keywords,
3)
def _parse(self, raw_input_string):
"""
Fills out message meta and frame attributes
"""
tokenizer = nltk.WordPunctTokenizer()
tokenized_string = tokenizer.tokenize(raw_input_string)
tagger = utils.combined_taggers
tagged_string = tagger.tag(tokenized_string)
wordActionMap = {'exit':SystemMessage.exit_keywords, 'restart':SystemMessage.restart_keywords}
for action, keywords in wordActionMap.items():
matches = extract_close_keywords(keywords, tokenized_string, 3)
if matches: # synset of keyword was found in the sentence
self.frame['action'] = action