Skip to content
Python scripts to perform bulk and single tests against chatbot using IBM Watson
Python
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
README.md
changemessage.py
config.example.conf
extractwordsmatchingcount.py
getallintents.py
getallmessages.py
jsoncompare.py
logger.py
requirements.txt
sendallmessages.py

README.md

Coverage

  • Get intent examples for workspace
  • Get intent examples for workspace, based on word count
  • Show all intents for workspace
  • Change message string depending on value assigned to changeType
  • Full json reports for each intent, with response data
  • Summary report of correct matching intents
  • Log files for request or Watson API exception errors

input folder contains the imported messages files report folder holds the results file with all response data logs folder hold all data related to errors

Pre-requisistes

brew update
brew install python3
pip3 install -r requirements.txt
cp config.example.conf config.conf

Complete the config.conf file

Before running a script, assign workspace id to the environment variable SPACE_ID

export SPACE_ID=workspace-id

To get current workspace ids:

curl -u "workspace-user-id":"workspace-password" "workspace-url"```

To run

python3 sendallmessages.py

Delete empty log files

find ./logs/ -type f -size 0 -exec rm -f {} \;

Tidy json response files

From the report directory:

find ./ -exec sed -i '' '1s/^{/[&/' {} \;
find ./ -exec sed -i '' '$ s/.$/]/' {} \;

Run analysis on json responses for different scenarios (compared to baseline)

python3 jsoncompare.py file1.json file2.json > output.txt

Extract all 1, 2, and 3 word examples and stores in files.

python3 extractwordsmatchingcount.py
You can’t perform that action at this time.