Monday, March 18, 2024

Two Trees

It's Monday, and you know what that means! Let's tackle yesterday's NPR Sunday Puzzle:

This week's challenge: Our challenge comes from Emma Meersman of Seattle, Washington: Take two three-letter tree names and combine them phonetically to get a clue for a type of fabric, then change one letter in that word to get something related to trees. Your answer should be the two tree names you started with.

This looks like another tricky one. Let's break it down.

  • T: a list of three-letter tree names
    • oak, ash, elm, fir ...
  • "combine them phonetically"
    • We'll need a phonological dictionary and probably a phonetic model
    • The dictionary will map the orthography of each tree name to a phonetic spelling (i.e., IPA or SAMPA)
      • we've solved puzzles like this before using the Carnegie Mellon University Pronouncing Dictionary, and we'll likely use it again here. Here's an example.
    • The model will take a phonetic spelling and map it to a list of possible matching (orthographic) spellings
  • c: "a clue for a type of fabric"
    • This is quite vague, but I think we could plug in a language model here and score candidates. Among other models, we've used the hugging face GPT-2 implementation and the pytorch pretrained BERT for problems like this. This time I'll be using BERT feeding it template sentences with candidate words filling in the blanks, e.g.:
      • What kind of fabric is _______ ?
      • Is herringbone more _______ than twill?
      • We can describe textiles as plain weave, satin weave or using other characteristics, like _______ fabrics.
      • I'm looking for a _______ purse for my sister, so should I choose denim, leather, houndstooth or linen?
    • The model will produce a probability score for each sentence, so we'll get an average for the candidate words and print the best scoring candidates out for us to review.
    • NOTE: It's not super clear from the way this puzzle is worded, but the clue here is not the "type of fabric" per se, but rather a clue that would lead us to it. For example, if the clue were "flax fiber", this could lead us to "linen", which we would then take as the input to the "something related to trees" portion of the puzzle.
  • s: "something related to trees"
    • c above should lead us to type of fabric
    • If we change one letter from the type of fabric, we get something related to trees.
    • I think we'll need to manually make the leap from the clue to the type of fabric, at which point we'll mentally do some letter swapping to confirm that we get something related to trees.
    • If we can't get this mentally, we can simply iterate through each letter in the word, then iterate through each letter of the alphabet and make the change.
      • We'll check an English vocabulary to keep only the words that appear there.
      • Then we'll pass the candidates through our BERT model, much like we did above:
        • _______ always makes me think of trees.
        • Arborists study everything about trees, including their distribution, reproduction, pathologies, ________, timber, growth rates, etc.
        • The topic of ______ came up in my Forestry class when we discussed trees.
I'm doubtful that we can write a script to perfectly solve this one by spitting out a single solution, because it's a pretty complex problem. This is going to be more of a HITL (human in the loop) approach, and we may have to run the script iteratively and manually review the output at each stage. You can view my script here on GitHub. Okay Puzzlers, good luck and I'll be back after the submission deadline with my solution!

March 23, 2024 Update

The deadline has passed, so here's my solution: 


See you next week!

No comments:

Post a Comment

Director, anagram, film award

Welcome back to Natural Language Puzzling, the blog where we use natural language processing and linguistics to solve the Sunday Puzzle from...