Beatles Bench · The ten functions
decide answers yes, no, or not sure.
decide is an if statement that reads. Ask one yes or no question about a text. Jev returns the probability of yes. Your threshold turns it into yes, no, or not sure.
Run it
At the default bar of 0.5, three songs are love songs.
is_a_song="The text is the title of a song by the Beatles."
question="$is_a_song It is a love song."
cat <<'EOF' |
She Loves You
Michelle
Yesterday
Taxman
EOF
thinkthen decide "$question" \
--batch 1 \
--lines \
--threshold 0.5 \
--replay recordingOutput
{"input":"She Loves You","value":true}
{"input":"Michelle","value":true}
{"input":"Yesterday","value":true}
{"input":"Taxman","value":false}exit 0: the run finished
Change the bar
At a bar of 0.6, Yesterday turns to no.
is_a_song="The text is the title of a song by the Beatles."
question="$is_a_song It is a love song."
printf '%s\n' "Yesterday" |
thinkthen decide "$question" \
--batch 1 \
--lines \
--threshold 0.6 \
--replay recordingOutput
{"input":"Yesterday","value":false}exit 0: the run finished
Set a band
Inside the band 0.3:0.7, Yesterday is not sure.
is_a_song="The text is the title of a song by the Beatles."
question="$is_a_song It is a love song."
cat <<'EOF' |
She Loves You
Michelle
Yesterday
Taxman
EOF
thinkthen decide "$question" \
--batch 1 \
--lines \
--threshold 0.3:0.7 \
--replay recordingOutput
{"input":"She Loves You","value":true}
{"input":"Michelle","value":true}
{"input":"Yesterday","value":null}
{"input":"Taxman","value":false}exit 0: the run finished
The lesson
Yesterday sits between 0.5 and 0.6. A bar of 0.5 calls it yes, and a bar of 0.6 calls it no. The band calls it not sure. The bench has no answer key for this question.
You decide how sure a yes must be.
On GitHub: github.com/botassembly/beatles-bench/tree/main/examples/decide