Repository navigation
vd-jev: ask a closed question about every row of a text column, get typed columns back #3249
aborruso
started this conversation in
Show and tell
Replies: 1 comment 1 reply
|
This is awesome, @aborruso! I may start using this. |
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Hi all, several tools for structured data are starting to offer decision models: language models that do not write text, but answer a closed question with a typed value and a confidence. We thought it would be useful to have this in VisiData too, and among what we have seen, MotherDuck's
prompt_jev()looked very interesting to us.So we wrote a small plugin, vd-jev. You put the cursor on a text column, run
jev-column, write a closed question and, if you want, the possible answers. A decision model answers for every row (Jev by TypeSafe by default, or any decision model on OpenRouter), and the answers come back as new typed columns: the probability of yes, one of your labels, or a position on an ordered scale, each with a confidence.Three kinds of question, on messages that residents send to a city's service desk. The answers are the real ones for "A tree has fallen across Elm Street after the storm and blocks both lanes":
answersroads, parks, noiseroads, confidence 0.98low < medium < highMore on what decision models are and how they differ from chat models is in the README: https://github.com/ondata/vd-jev#why
Once the answers are columns, it is plain VisiData:
Shift+Fon the labels, sorting by confidence,z|to select the rows where the model is unsure and read only those.To see it at work, open the animation full size, where the text is easier to read:
It is a single file with no dependencies beyond VisiData, loaded through the
visidata.pluginsentry point:It needs an OpenRouter API key; with Jev it costs about 0.012 USD per 1,000 short rows. The text of the cells is sent to OpenRouter and to the model provider, so it is meant for data you can share.
The README has a quick start on a small demo file and two tests on EU open data: TED procurement notices and CORDIS research projects.
Feedback is welcome, especially on the interaction: a single form with question and answers, where the answers field sets the kind of question (empty for yes/no,
a, b, cfor one label,low < medium < highfor a scale).One question for Saul and the maintainers: is the plugin list in
visidata/dlc(plugins.jsonl) still in use? If it is, I would be glad to add vd-jev there with a pull request; if there is a better place to list external plugins today, please let me know.https://github.com/ondata/vd-jev
Whatever people make of this plugin, I designed and built it with great emotion and pleasure, because I love VisiData. I have followed it for a very long time, and I owe it a lot, personally and professionally. If this plugin adds something useful to the project and to the people who use it, I will be proud and happy.
Thank you, @saulpw , and everyone who takes care of this project.
All reactions