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
Release history Release notifications | RSS feed
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)
Built Distribution
Close
Hashes for dff_node_stats-0.1a1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 66d79a1db3762c35fad194793dc80c8032388e7e8f0c27f5c8356bce4a13403d |
|
MD5 | b842d8ff209082e2cb12a2b6bdb49bf7 |
|
BLAKE2b-256 | b10694c9dd2f7f7259c614d7f08e5e9f26c15282cf2be06f4f9dcaf5d951dfd0 |