matthayes/anki_cloze_anything

Opportunistically generate Recall card with ExpressionCloze instead of Meaning

kriswuollett opened this issue · 7 comments

It seems sort of redundant to duplicate the content of ExpressionCloze into Meaning for the generation of the Recall cards when the content is the same.

Why not update the Recall template's back template to simply replace all the cloze fields if the Meaning field is empty? Or perhaps use a switch mechanism to enable it like those used in the ExpressionCloseN fields?

For me to prototype (along with other changes) was to change the Recall card to Prompt -> Card+ExpressionCloze:

  • Deleted the Expression field (since I don't find it useful for this setup yet)
  • Renamed Meaning to Prompt to preserve existing cards. For me, Prompt better captures the semantics of a front card for recall.
  • Created a simple front card with conditionally rendering Prompt.
  • Flipped the isBack check.
  • Copied the ExpressionCloseN front template into the Recall back and just set cardMatch to true, and clozeNum to 0.

Or was there some other way I was supposed to configure Cloze Anything to accomplish the same thing?

Another nice to have that I've tried out is just updating the script to replace content with the current-cloze style without the [ ] in the the replacement formats. That gives some nice formatting on the back card to give hints what the key (cloze) parts of the expression are to remember.

It seems sort of redundant to duplicate the content of ExpressionCloze into Meaning for the generation of the Recall cards when the content is the same.

Do you instead mean to duplicate the content of ExpressionCloze into Expression? (Otherwise I'm not sure I follow whatyou mean) I assume you're referring to the Cloze Anything Sample deck. Yes it's redundant, but the reason I set it up this way is that I wanted to show it's possible to selectively add cloze cards for a subset of existing notes in a deck. In my own usage, I do not create clozes for every note. So I still need the Expression field.

I consider the Cloze Anything Sample deck as simply a starting point for users who want to quickly get going using Cloze Anything. I think it's great you tweaked it to your liking and would encourage everyone to do that. Rather than have a card template that can serve everyone's needs I'm rather interested in writing the JavaScript library that is flexible enough that people can apply it to lots of different use cases by simply tweaking the card template rather than having to mess with the internals of the JavaScript code.

I am interested in hearing about whether there is some more functionality I could expose so you can more easily make the tweaks you want. Reading your suggestions under For me to prototype it isn't totally clear to me what changes I could make to help you out. Maybe you could go into it in more detail.

Another nice to have that I've tried out is just updating the script to replace content with the current-cloze style without the [ ] in the the replacement formats. That gives some nice formatting on the back card to give hints what the key (cloze) parts of the expression are to remember.

Can you give an example so I understand better?

I haven't used the particular deck that I was using Cloze Anything in a while, but here is what my end result was something like:

Recall Card
(Front) What is an encoder decoder model?
(Back) An encoder decoder model takes in 1) hidden state, and 2) a sequential input one item at a time. It then calculates the encoder final hidden state which is then passed to the decoder which predicts the output sequence. (includes diagram in card at bottom)

Close Card X (for X in number of clozes)
(Front) An encoder decoder model takes in 1) [...], and 2) a sequential input one item at a time. It then calculates the encoder final hidden state which is then passed to the decoder which predicts the output sequence.
(Back -- same as Recall card back)

Okay thanks I think I understand now. My current sample deck is more oriented towards language study, where having Expression and Meaning make sense. It could be useful for me to create another sample deck similar to your example for other use cases.

Another nice to have that I've tried out is just updating the script to replace content with the current-cloze style without the [ ] in the the replacement formats. That gives some nice formatting on the back card to give hints what the key (cloze) parts of the expression are to remember.

Are you doing this by setting data-cloze-blanks-format and data-cloze-hint-format?

It doesn't look like I did -- much too long ago to recall any issues if I did.

One of my card sides just looks like this where I use RecallExtra for diagrams:

{{FrontSide}}

<hr id=answer>

<div id="cloze" data-card="{{Card}}" data-cloze-show-before="all" data-cloze-show-after="all">
{{ExpressionCloze}}
</div>

{{#RecallExtra}}
<br>

{{RecallExtra}}
{{/RecallExtra}}