diart icon indicating copy to clipboard operation
diart copied to clipboard

Feature Request: Export result to csv file

Open AMITKESARI2000 opened this issue 2 years ago • 1 comments

Hi, Thanks for the repo! I wanted to know how to export the dataframe printed at last of benchmark into a csv file. Please add a option for exporting if not there. image

Update: Found the code for pandas dataframe generated . Requesting you to open an end point so that it can be used easily.

In inference.py

metric.report(display=True)

Thank You

AMITKESARI2000 avatar Jul 21 '22 15:07 AMITKESARI2000

Hi @AMITKESARI2000,

Thanks for your question. Currently, if you pass a reference_path to Benchmark, then __call__ returns a pandas DataFrame. You can easily export a DataFrame to a CSV file using DataFrame.to_csv() (see here).

It would look like this:

benchmark = Benchmark(...)
pipeline = OnlineSpeakerDiarization(...)
benchmark(pipeline).to_csv("/your/path/to/file.csv")

However, you need to write your own script for this. It would be useful to add a script argument to diart.benchmark so these results are automatically saved to a CSV file without the need to write a custom script. This could be something like diart.benchmark --to-csv /your/path/to/file.csv.

Would you be interested in opening a PR for this feature?

juanmc2005 avatar Jul 25 '22 11:07 juanmc2005

Implemented in #86

juanmc2005 avatar Aug 31 '22 11:08 juanmc2005