Skip to main content

Statistics collection extension for Dialog Flow Framework (https://github.com/deepmipt/dialog_flow_framework).

Project description

Statistics collection extension for Dialog Flow Framework

dff_node_stats is package, that extends basic dff by adding statistic collection and dashboard for visualization.

Installation

Installation:

# install dialog flow framework
pip install dff
# Install dff_node_stats
pip install dff_node_stats #basic
# pip install dff_node_stats[api] # version with rest-api, that provides access to stats by http requests
# pip install dff_node_stats[dashboard] # version with dashboard, that provides access to stats by web-UI
# pip install dff_node_stats[all] # version with both

Code snippets

Insert stats in your dff code:

# import
import dff_node_stats
# ....
# Define a plot
# Define an actor
# ....

# Define file for stats saving
stats = dff_node_stats.Stats(csv_file=STATS_FILE_PATH)
# Add handlers to actor
stats.update_actor_handlers(actor, auto_save=False)

# ....
# Handle user requests
# ....

Dashboard on stored data:

import dff_node_stats

stats = dff_node_stats.Stats(csv_file=STATS_FILE_PATH)

stats.streamlit_run()

http-api on stored data:

import dff_node_stats

stats = dff_node_stats.Stats(csv_file=STATS_FILE_PATH)

stats.api_run()

Run Examples:

# install addition reqs
pip install tqdm
# run dff dialog bot and collect stats
python examples/1.collect_stats.py
# or this one, they have differences only in a dialog scripts
python examples/1.collect_stats_vscode_demo.py
# run dashboard and go to http://localhost:8501 to get it
streamlit run examples/2.run_dashboard_for_stats.py
# and run api and follow to swagger by http://localhost:8000/docs
python examples/2.get_stats_by_api.py

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

dff_node_stats-0.1a1.tar.gz (9.0 kB view hashes)

Uploaded Source

Built Distribution

dff_node_stats-0.1a1-py3-none-any.whl (9.4 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page