paulbricman / dual-obsidian-client

A skilled virtual assistant for Obsidian.
https://paulbricman.com/thoughtware/dual
Mozilla Public License 2.0
242 stars 7 forks source link

Implement argument parsing in new frontend #53

Closed paulbricman closed 3 years ago

paulbricman commented 3 years ago

Based on arguments detected in #52, such as *person* or *topic*, the values have to be extracted from the user query using text generation as describer here. Argument names and the query should go into a function, and a dictionary with the proper value attributions should come out.

paulbricman commented 3 years ago

This is a testing prompt:

query: Come up with a writing prompt about aliens and robots.
topic: "aliens and robots"

query: Einstein, what is general relativity?
person: "Einstein"

query: Come up with a fitting term for a metaphor which bridges disparate fields.
description: "a metaphor which bridges disparate fields"

query: Write a Python query which reverses the contents of a list.
description: "reverses the contents of a list"

query: How could one operationalize working memory capacity?
concept: "working memory capacity"

query: What specific operations should I perform to model an airplane in Blender?
object: "airplane"

query: What would be a useful analogy for understanding pupillometry?
concept: "pupillometry"

query: What are some possible applications of brain-computer interfaces?
technology: "brain-computer interfaces"

query: How can I say "sprandel" in Romanian?
language: "Romanian"

query: How would a school look like in Victorian London?
context: "Victorian London"

query: Come up with a setting for a science fiction book.
genre: "science fiction"

query: Try to come up with an exercise on thermodynamics.
subject: "thermodynamics"

query: Darwin, what is the origin of species?
person: "Darwin"

query: Look for notes about evolution.
topic: "evolution"

query: Isaac Asimov, come up with a writing prompt about space exploration.
person:
paulbricman commented 3 years ago

When tasked with such a prompt, GPT-2 medium would find it difficult, so it would just avoid it by coming up with a new command and so on. Eliminating new line tokens from the pool of available tokens (af20b8e) helps mitigate this avoidant behavior.

paulbricman commented 3 years ago

Figured a useful way of exemplifying this is to publish a Write with Transformer document: https://transformer.huggingface.co/share/vpBaDMApLU

paulbricman commented 3 years ago

Idea: performance in argument parsing might be greatly improved if besides the author of a recipe listing a few examples, they would also include the arguments contained in them themselves.

If my example was Come up with an application of blockchain in marketing, I could also somehow mention that for this example *technology* is blockchain and *application domain* is marketing. Those would get appended to the prompt in am even more online few-shot regime than the original one.