Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fallback api fix #1045

Closed

Conversation

maheshsattala
Copy link
Contributor

Fixed fallback api issue in analytics page.

]))
action_counts = list(conversations.aggregate([{"$match": {"$and": [
{"type": "flattened"},
{"data.intent": {"$nin": ['action_listen', 'action_session_start']}},
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

these are not actions, can be removed

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

also, why is this named as action_count? isnt it actually a count of total conversation steps?

{"$project": {"_id": 1, "count": 1}}
], allowDiskUse=True)
)
new_session = list(conversations.aggregate([
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

revert

]
}
}},
{"$match": {'$or': [{"events.name": fallback_action},
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

use nlu_fallback action for filtering here

{"$sort": {"event.timestamp": 1}},
{"$group": {"_id": "$sender_id", "events": {"$push": "$event"}}},
{"$addFields": {"last_event": {"$last": "$events"}}},
{"$match": {'$or': [{"last_event.name": fallback_action},
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

use nlu_fallback action for filtering here

conversations.aggregate([
{"$match": {"event.timestamp": {"$gte": Utility.get_timestamp_from_date(from_date),
"$lte": Utility.get_timestamp_from_date(to_date)},
"event.name": {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

use nlu_fallback, action_session_start action for filtering here

]
}
}},
{"$match": {'$or': [{"events.name": fallback_action},
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

.

{"$sort": {"event.timestamp": 1}},
{"$group": {"_id": "$sender_id", "events": {"$push": "$event"}}},
{"$addFields": {"last_event": {"$last": "$events"}}},
{"$match": {'$or': [{"last_event.name": fallback_action},
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

.

{"$project": {"_id": 1, "count": 1}}
], allowDiskUse=True)
)
new_session = list(conversations.aggregate([
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

revert


assert hit_fall_back["fallback_count"] == 100
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

tests should pass without modifying them

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants