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.1a2.tar.gz
(9.0 kB
view details)
Built Distribution
File details
Details for the file dff_node_stats-0.1a2.tar.gz
.
File metadata
- Download URL: dff_node_stats-0.1a2.tar.gz
- Upload date:
- Size: 9.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.4.2 importlib_metadata/4.8.1 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.7
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | fe25b152d9a9e0de1a82d30a73f161dc6890b36d3c6483e3417b96131659cb2d |
|
MD5 | 75eca6bf76c962cab47b9497dbf86226 |
|
BLAKE2b-256 | 48df93986e722960530005a0d56106ea25b085d0f047413cc9112888cdba7909 |
Provenance
File details
Details for the file dff_node_stats-0.1a2-py3-none-any.whl
.
File metadata
- Download URL: dff_node_stats-0.1a2-py3-none-any.whl
- Upload date:
- Size: 9.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.4.2 importlib_metadata/4.8.1 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.7
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | ce5cb045ba6386e6b7ded41ae13b1e45e20eb93620b65e0595212186a81f4fd3 |
|
MD5 | 8c6ed1d80a1cc2e5b1199b30bd6244a4 |
|
BLAKE2b-256 | fb09b890609a6896c58c10918cdf5a24de9c7eac8e394fff6d69a446a731046b |