class ActivitySearch:
    def __init__(self):
        self.sounder = Sounder()

    def get_probability(self, given_keywords, user_keywords):
        info = self.sounder.probability(query=user_keywords, dataset=given_keywords, 
                                        prediction=True, metaphone=True, detailed=True)
        return info['chances']
Beispiel #2
0
class ActivitySearch:
    def __init__(self):
        self.sounder = Sounder()

    def get_probability(self, given_keywords, user_keywords):
        info = self.sounder.probability(query=user_keywords,
                                        dataset=given_keywords,
                                        prediction=True,
                                        metaphone=True,
                                        detailed=True)
        return info['chances']
Beispiel #3
0
key_words_array = []
for a in dataset:
    key_words_array.append(a[1])

s = Sounder(key_words_array)


def get_user_words_array(user_string):
    user_array = user_string.split()
    for user_word in user_array:
        if user_word in s.get_reserved_sub_words():
            user_array.remove(user_word)
    return user_array


user_keywords = get_user_words_array(user_string)

print("\n")

index = s.search(user_keywords)
print("Intent Predicted: %s" % dataset[index])

print("\n")

status = s.probability(user_keywords, prediction=True)
print("Status Report: %s" % status)

# https://goo.gl/HZfTWF

print("\n")