Shell Scripting Code Samples
Use the shell scripting code samples below to quickly get started developing with the Rev AI APIs.
Calculate the average confidence score of a transcript
The following example demonstrates how to calculate the average confidence score of a transcript.
To use this example, replace the <FILEPATH>
placeholder with the path to the transcript file (in JSON format).
cat <FILEPATH> | jq '.monologues[].elements[].confidence' | grep -v "null" | awk '{sum+=$1} END {print "Average = ",sum/NR}'