Skip to content

taipo util

> python -m taipo util

  Some utility commands.

Options:
  --help  Show this message and exit.

Commands:
  csv-to-yml  Turns a .csv file into nlu.yml for Rasa
  yml-to-csv  Turns a nlu.yml file into .csv
  summary     Displays summary tables for gridsearch results.

We host some utility methods to transform intent-based data from .csv to .yml. Be aware, these methods ignore entities!

taipo util csv-to-yml

> python -m taipo util csv-to-yml --help
Usage: util csv-to-yml [OPTIONS] FILE

  Turns a .csv file into nlu.yml for Rasa

Arguments:
  FILE  The csv file to convert  [required]

Options:
  --out PATH        The path of the output file.  [default: .]
  --text-col TEXT   Name of the text column.  [default: text]
  --label-col TEXT  Name of the label column.  [default: intent]
  --help            Show this message and exit.

taipo util yml-to-csv

> python -m taipo util csv-to-yml --help
Usage: __main__.py util yml-to-csv [OPTIONS] FILE

  Turns a nlu.yml file into .csv

Arguments:
  FILE  The csv file to convert  [required]

Options:
  --out PATH  The path of the output file.  [default: .]
  --help      Show this message and exit.

taipo util summary

Usage: __main__.py util summary [OPTIONS] FOLDER

  Displays summary tables for gridsearch results.

Arguments:
  FOLDER  Folder that contains grid-result folders.  [required]

Options:
  --help      Show this message and exit.

Example Usage

Let's say that you've got a folder structure like so:

๐Ÿ“‚ gridresults
โ”ฃโ”โ” ๐Ÿ“‚ orig-model
โ”ƒ   โ”ฃโ”โ” ...
โ”ƒ   โ”—โ”โ” ๐Ÿ“„ intent_report.json
โ”ฃโ”โ” ๐Ÿ“‚ finetuned-model
โ”ƒ   โ”ฃโ”โ” ...
โ”ƒ   โ”—โ”โ” ๐Ÿ“„ intent_report.json
โ”ฃโ”โ” ๐Ÿ“‚ typo-orig-model
โ”ƒ   โ”ฃโ”โ” ...
โ”ƒ   โ”—โ”โ” ๐Ÿ“„ intent_report.json
โ”—โ”โ” ๐Ÿ“‚ typo-finetuned-model
    โ”ฃโ”โ” ...
    โ”—โ”โ” ๐Ÿ“„ intent_report.json

Then you can get a convenient summary via:

python -m taipo util summary gridresults

You may get a table that looks like this:

โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”ณโ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”ณโ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”ณโ”โ”โ”โ”โ”โ”โ”โ”โ”โ”ณโ”โ”โ”โ”โ”โ”โ”โ”โ”โ”“
โ”ƒ folder                โ”ƒ accuracy โ”ƒ precision โ”ƒ recall  โ”ƒ f1      โ”ƒ
โ”กโ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ•‡โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ•‡โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ•‡โ”โ”โ”โ”โ”โ”โ”โ”โ”โ•‡โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”ฉ
โ”‚ finetuned-model       โ”‚ 0.9022   โ”‚ 0.90701   โ”‚ 0.9022  โ”‚ 0.90265 โ”‚
โ”‚ orig-model            โ”‚ 0.90018  โ”‚ 0.90972   โ”‚ 0.90018 โ”‚ 0.90192 โ”‚
โ”‚ typo-finetuned-model  โ”‚ 0.89965  โ”‚ 0.90302   โ”‚ 0.89965 โ”‚ 0.89984 โ”‚
โ”‚ typo-orig-model       โ”‚ 0.79419  โ”‚ 0.82945   โ”‚ 0.79419 โ”‚ 0.80266 โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ดโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ดโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ดโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ดโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜