|
@@ -17,7 +17,7 @@ def filter_with_last_ten_reviews(location_id, replies):
|
|
|
similarity = SequenceMatcher(None, s1, s2).ratio()
|
|
|
if similarity > 0.7:
|
|
|
replies.remove(rep)
|
|
|
- print(similarity, '--------------', rep.reply_category)
|
|
|
+ print('%.2f'%similarity, ' -------------- ', rep.reply_category)
|
|
|
|
|
|
return replies
|
|
|
|
|
@@ -37,7 +37,7 @@ def is_a_name(name):
|
|
|
'''
|
|
|
function that decide whether it is a person name or not
|
|
|
:param : name -> a string usually reviewer name
|
|
|
- :return -> a boolean True/False:
|
|
|
+ :return: Boolean -> true or false
|
|
|
'''
|
|
|
|
|
|
response = model_inference(name.title())
|
|
@@ -57,8 +57,8 @@ def analyze_inference(response):
|
|
|
['intent', 'entities', 'intent_ranking', 'text']
|
|
|
we took all intents that has more than 10% of intent confident.
|
|
|
all the intents that has bellow confidence has been omitted.
|
|
|
- :param response: a json response that RASA NLU server respond.
|
|
|
- :return: dictionary with key of intent and value of it's confident.
|
|
|
+ :param response: JSON -> a json response that RASA NLU server respond.
|
|
|
+ :return: DICT ->dictionary with key of intent and value of it's confident.
|
|
|
'''
|
|
|
|
|
|
res_intents = response.get('intent_ranking')
|