Advanced Spanish Words deck

Oh yeah, here’s the path:

./wordtree.py input.txt --noentry --anki ~/Library/Application\ Support/Anki2/Dave/collection.anki2
Language set to default: es Spanish
Use --lang to change

Using frequency file: freq/es.xz
Loading anki database...
	Connecting to database: /Users/dave/Library/Application Support/Anki2/Dave/collection.anki2
	Error: unable to open database file
	
Failed to connect to database.
	Make sure the filename is correct or try closing anki before proceeding.

Then when that didn’t work, I copied the database file to the same direcctory and tried it there.

Worth noting: I tried using /Users/dave/ instead of ~ for the home directory, as well as putting the path in single & double quotes. All gave the same result. I’m on Anki 2.1.65 at the moment. I haven’t tried upgrading yet.

If the file didn’t exist you would get a different error. Therefore, the only thing I can think of is a file permission error. I need a mac to test.

Otherwise, your only alternative is to try exporting the notes into a file: select all the notes in Anki. Right click. Notes. Export Notes. Check the box to support older versions. Save as a .apkg file and open that instead.

Whoa, this was unexpected but if I run wordtree while ANKI IS OPEN, it works. A bit unexpected!

Well I tried this on a mac, and no matter what I set the file permissions to, it would not open.

For now, I created a mac only note to just export the notes as .apkg because that’s the only thing that worked for me.

If any mac experts are reading this, please advise.

I really really like this deck. I’m solidly middle-level with my Spanish and most of the decks contain words that are too easy and I spend all my time deleting them.

I am the one who removed all the capitalization in the front/back unless it’s a proper noun. (I find it easier to review quickly without it – it distracts me)

I also poached the Note Type and have begun to use it in my own vocab list. Other changes: I hid the Imgsrc items from display (I don’t care), and I made the Examples field left-justified and look like this with Spanish above English, and without the bullets;

El médico explicó que la pupila se puede dilatar con luz tenue.
The doctor explained that the pupil can dilate in dim light.

No debemos dilatar más la decisión, es momento de actuar.
We shouldn’t delay the decision any longer; it’s time to act.

This is not criticism at all, just my personal preferences. Thank you again for putting this together.

Okay, I did some python scripting to process the deck and fix most of the capitalization. Now the English field should be title case, for example: Banister, Handrail will become ‘Banister, handrail’

I also took your suggestion a redid the sentences without the = format. Now each translation is on a newline with a little div half height line between translation pairs.

What’s else is new?
• Images: 3000+ notes now have something in the image field. 361 are blank, but a lot of these are words that are more difficult to find images for, especially the verbs. If you want to help, please leave an image in this thread and I will add it to the deck.
• :llama:Words. Sentences after the :llama: symbol were auto-generated with ollama. Now every single note in the deck has example sentences.This took over 9 days of continuous computer time at 15 minutes per note. Turns out running using LLMs to generate sentences at home is unimaginably slow. They are almost as good as chatgpt examples, but there still might be minor mistakes. Let me know if you find one.
• Spell checked the whole document with hunspell to catch spelling errors in multiple languages.
• A few av1 video clips. I managed to compress some short clips down to 100-200kb. They should loop and play automatically. They work on my android phone, but let me know if these work on your machine. Search myvid in the deck to see them.

2 Likes

los heces should be las heces. From la hez. dle.rae.es/hez?m=form

I have already taken (stolen :wink: ) your work and modified it too much to be able to use this new version, but I do appreciate the fact that you are improving it. I have done many similar modifications, but I’m doing it manually on each note as I’m presented with it to study. I improve the photos, the sentences, and research the cultural implications where they’re important.

I would be really interested in which LLM you’re using (i’m using OpenEuroLLM-Spanish) and what prompt you gave it to generate the sentences. I used “Please translate words from Spanish to English, give 5 example sentences using the word in Spanish then translations of those sentences in English, and finally provide any relevant cultural notes about the use of the Spanish word such as regional use or slang connotations. Use plain text formatting, without lists, bullets, or indentation.” This prompt is not perfect, and it’s really slow on my older Mac, but it does work. Thanks again for sharing your work.

Thanks, I fixed it locally. You will see the change in the next upload. Feel free to contribute anything else you find along the way.

The current LLM is Mistral Large 2411 Q3. That’s the biggest I could fit locally in ram, hence the Q3, but it’s also produced the best results so far. Most of the LLM I tried don’t actually follow instructions, so I had a bunch of python code checking the output result to make sure there was exactly 10 sentences without extraneous text, but Mistral was much better behaved without need any retries.

It will still vary the output a little bit, such as using different types of bullet points and random indention, so I have some extra code to extract each bullet point and fix the indention after the fact. The goal with LLM isn’t to make perfect output, it’s to make output that’s good enough so that it’s machine readable andy my code can fix it up after the fact. For example, I extract the bullet points with: re.match(r"^\s*[-•*◦–‣]", line) to get every possible type a query response might give. Bullet points are actually useful for text extraction, because otherwise the code won’t know how to differentiate the actual sentences from the extraneous text.

This is my current prompt.

prompt = f'''Write exactly {expected} Spanish-English sentence pairs using the Spanish word {word} in context. The sentences should accurately reflect how the word is used in real life. Vary the sentence structure using the word in different positions. Try using different conjugations of the word in different contexts.
	
	The definition of {word} should be similar to '{back}'
		
	The sentence pairs consist of a Spanish sentence using {word} in context along with it's English translation.
	Make bullet points for each sentence. Only one sentence per bullet point.
	
	Procedure:
	Output the spanish sentence on a bullet point.
	Then output the english translation on the next bullet point.
'''

For your prompt, I suggest breaking it up into 2 different prompts, one to make the sentences and another to provide the “cultural notes.” The LLM don’t handle slang as well, so I always exclude them from the automated run.

1 Like

@SurpriseDog Hello Surprise Dog. Can you do the same thing for French? I will pay you a large sum of money if you do it for words and sentences for B2 and above french like you did for Spanish. I can’t code.

Sounds like an interesting project. I had actually been thinking about doing an automated deck for every language, but the major caveat is that when I do the Spanish deck, I am actively looking up the nuances of each word and reading it in context to understand it better which means that every note takes a lot of work. This would be much more automated: just a simple word, definition and examples without any pictures. After it’s finished, actual French learners would have tell me if there’s anything wrong that needs to be fixed.

I could start at 10 fpm and below for words like vainqueur, ennui and work down to words like sevrer, brumeux at 1 fpm. That’s about 6500 words and of course it includes lots of english cognates like the word la dérivation = derivation. For the definitions, I could just copy from the Wiktionary dump and then have the LLM do the example sentences.

Decks made by folks who are good at automation, but don’t know the language at all, generally turn out to be a big source of disappointment for learners. I hope if you decide to do this you partner with someone fluent/native who can correct the deck before publishing.

1 Like

I’m using this deck and I like it a lot, but one thing that bothers me a bit is that I can’t easily see if a word is slang, Mexican, etc. because I’m learning directly from the top-level deck. That made me wonder: would it be useful to add this context to the backside of the card, at least for those categories where it matters?

Yes, there’s a certain amount of truth to that, but hopefully if I can work with a French student like this he could help me refine fix any bugs before publishing.

-–

@oktoberpaard

I always study on Android which shows the deck name at the top of the screen so I can use the deck name as a sort of hint to establish context for the card.

To fix this temporarily on Anki desktop you can go to: Tools → Manage Note Types → ASW+ → Cards and then edit the Front template:

{{Subdeck}}
<br><br>
{{Front}}

For the back, change card type to 2 and edit the front template to look like this:

{{Subdeck}}
<br><br>
{{Back}}

{{#Reverse}}
<span class="reverse"><br><br>{{Reverse}}</span>
{{/Reverse}}

<br><br>

{{Image}}

–

Let me know if this template is the best way to fix this problem. - I was actually planning a new deck update soon that includes a lot more “bookish” words.

Thanks, I’ll play around with it! I’m learning Spanish to English, so card type 1, and I was planning to add it to the back only, as extra context. I feel like the name of the deck can sometimes give away too much information on the front. On the other hand, in real life you would also have context, so maybe I’m exaggerating.

Nice to hear that there is another update coming!

1 Like

If you’re the businessy type of person, you could do what Language Atlas does. If you look him up its by far the best way to learn languages. I used his deck for spanish a1 to b2 to get the main vocab down then yours to get to c1 (thank you)! But if youre doing it out of kindness please do french deck and dont care about nuance and I will venmo you any amount of your choice! I need the french deck to get from b2 to c1 cuz these advanced words are hard to learn and your spanish deck was a godsend haha

Is this topic the best place to share issues with the deck? I think the example sentences of “concordar” don’t coincide (no concuerdan) with the definition of the word: “coincidir o estar de acuerdo [una cosa] con otra.” From my understanding it’s specifically about things being in agreement, while the example sentences use it in the context of people agreeing to something. Some more definitions from RAE: https://dle.rae.es/concordar.

I sometimes see some other small issues and I’ll try to keep track of them. The most common one is not stating on the front how many translations should be given. That being said, I thoroughly enjoy this deck and it has been immensely useful on my trip to Mexico. I’m looking forward to updates.

Thanks for the feedback. This is absolutely the right place to post it. As for concordar:

It seems there’s two meanings of concordar, “To agree and to be consistent with.” so I updated the definition in the deck to reflect both with an emphasis on the second.

I sampled my book collection and found both meanings. The word is relatively rare in books with “concordar*” in only 5% of them)

Rescaten el Titanic! - Clive Cussler:

—¿Es posible este sistema defensivo? —preguntó el mariscal Tilevich.
—Formulé la misma pregunta a cinco de nuestros más respetados
científicos… Todos concordaron, teóricamente, en que este sistema es viable,
siempre que se disponga de una fuente energética lo bastante potente.

Marte azul - Kim Stanley Robinson:

Pero, a pesar de sus diferencias, ninguno de los uranianos parecía
convencido. Una mujer entrada en años, la alcaldesa de Hipólita, expuso el
sentir general, e incluso los «rojos» de Miranda concordaron con ella: no
necesitaban intermediarios en sus tratos con la Tierra.

…


So I fed the quotes into the LLM and had it classify them. It seems that in literature, the dominant meanning is # 2.

“Todos concordaron…” → 1 (Agree)
“concordaron con ella” → 1 (Agree)
“concordar o disentir” → 1 (Agree)
“ideas… concordar con las suyas” → 2 (Match / be consistent)
“Parecía concordar todo…” → 2 (Fit / be consistent)
“concordara con algo…” → 2 (Match)
“concordar con el tiempo…” → 2 (Be in harmony)
“no concordaran” → 2 (Match)
“suele concordar con la realidad” → 2 (Match reality)
“lejos de concordar con el frío…” → 2 (Match)
“concordar en cuanto a…” → 3 (Reach agreement)
…

It’s possible that the first meaning is more common in speech (books and speech are often quite different), but alas I’m not a native speaker so this is the best I can do for now. Another way to read this is that when two people have consistent worldviews with each other, they are “in agreement” so it’s really all the same meaning depending on how you look at it.

Is this still in the works? I’m not yet finished with the deck as it is, but I’m already looking forward to this update.

1 Like

The new upload is up! What’s new?

  • Every single note now has something in the image field. There are still some duplicate images and emojis. If you have any images you would like to add, please post them in this thread.

  • Hundreds of notes sorted into more relevant categories. Sound is now: Speech & Sound which captures words used in speech.

  • More detailed FPM rankings. It’s now divided into spoken vs written words. I’m using a collection of YA books with 146M words total to sample these.

    • Example for bramar: 01.3 fpm (avg) 0.06 fpm (bramar) 0.38 fpm (total) 14 fpm (books)
    • This uses a log weighted average to combine the spoken and written fpm properly. Certain words like Bramar are used much more commonly in books, but I still wanted to weight this deck toward the spoken word first as I consider it more useful.
    • Why is it written with a leading zero: 01.3 fpm? The zero is required for proper sorting.
  • Please feel free to report any errors or make suggestions in this thread.

1 Like