Saturday, September 25, 2021

Garden goods and their adjectives (Solution)

 Let's solve this week's Sunday puzzle from NPR:

This week's challenge comes from listener Rachel Cole of Oakland, Calif. Name something grown in a garden. Change the second letter, and double the third letter, to get an adjective that describes this thing. What is it?


I pretty much used my proposed approach, which you can see here.

And my solver script is available here, along with the list of "garden things" I compiled for this task.


The solution:

radish --> reddish


See you for the next Sunday Puzzle!


--Levi King

Monday, September 20, 2021

Garden goods and their adjectives (Preview)

Happy Monday, Puzzle Buddies. Let's get back on the horse with this week's Sunday Puzzle from NPR:

This week's challenge comes from listener Rachel Cole of Oakland, Calif. Name something grown in a garden. Change the second letter, and double the third letter, to get an adjective that describes this thing. What is it?

This feels very do-able. How should we approach this puzzle? Let's break it down a little:

  • something grown in a garden
    • flowers;
    • fruits and vegetables;
    • possibly something more "metaphorical", but let's assume not;
  • get an adjective
    • seems like this should be a single word, which means the something grown in a garden must also be a single word;
  • adjective that describes this thing
    • this could be quite broad, but we can start with what we know about its form;
    • must be one letter longer than the something grown in a garden string, because double the third letter;
We know this is a classic puzzle format:

transform_function(string_a) = string_b

In other words, we start with a string_a, apply the transformation described in the puzzle, and the result is string_b. As usual, we need lists of candidates for string_a and string_b. So let's spell out more clearly what we need to solve this puzzle:

  • ListA: a list of things grown in a garden;
    • I suspect we can find lists already on the web with a bit of searching;
  • ListB: a list of adjectives that can describe our something grown in a garden;
    • This is not the kind of thing we can easily find a list for, so we'll likely need to "roll our own";
    • I will likely use SBERT in "mask mode", which essentially asks the model to fill in a blank. I'll start with a short list of sentence templates, where we can insert a word from ListA, then have SBERT suggest the top 100 (or 200, etc.) most probable words to describe that word. For example:
      • The [string_a] that I grew in my garden tasted so [MASK] this year.
      • My neighbor is growing the most [MASK] [string_a] in his garden.
My plan is to start with ListA. I'll pass each of those through the SBERT model until we have a list of all the suggested adjectives for each word in ListA, i.e., the first step is to use ListA to derive ListB. Then we simply do:
  • For candidate_a in ListA:
    • for candidate_b in ListB:
      • if len(candidate_b) == len(candidate_a)+1:
        • ## first we double the third letter:
        • mod_b = candidate_b[:3]+candidate_b[2]+candidate_b[3:]
        • for letter in alphabet:
          • ## next, we change the second letter:
          • mod_b = mod_b[:1]+letter+mod_b[2:]
          • if mod_b == candidate_a:
            • print("Solution: ", candidate_a, candiate_b)
What do you think? Will it work? Do you have other ideas for approaching this? I'll see you back here after Thursday's NPR deadline with my solution. :-)

--Levi

Tuesday, September 07, 2021

Famous name & vowel change (Preview)

Here's the latest Sunday Puzzle from NPR:

This week's challenge comes from listener Derrick Niederman, of Charleston, S.C. Name a famous person (8,4). The last name is a regular uncapitalized word with a single vowel. Change that vowel to make a new word that is humorously defined by the person's first name. Who is it?

Woah, this looks like a tricky one. Let's break it down a little.

  • We need a list of famous people; no details about where the target famous person is from, or even whether he or she is living or dead.
  • We can filter this list down to persons with an 8-letter first name and 4-letter last name.
  • We expect the last name to appear in an English dictionary ("regular uncapitalized word") and have only one vowel, so we can filter accordingly for these features, too.
  • Let's call this resulting list C for "candidates". I suspect this is a fairly short list, and it's probably easiest to simply manually work through C to find the solution.
But what if we want to automate this whole puzzle and get a solution?
  • We can iterate through the names in C, generating all the 4-letter strings that result when we swap out the vowel in the last name;
    • Keep only those that appear in an English lexicon;
Again, we could stop here and intervene manually. The remaining clue is the trickiest part, after all: "a new word that is humorously defined by the person's first name." I think this means that the first name is also a regular word in English. But how do we implement "x  is humorously defined by y" in an NLP approach? I know there is research into modeling humor, but I don't know much about it or how well it works. My best bet here would be to instead rely on something like pointwise mutual information to determine how likely the x (vowel-swapped last name) is to co-occur with y (the first name). That might be worth a shot, but there's no guarantee that the "humorously defined by" clue means x and y are likely to co-occur. I'm still mulling over how to approach this puzzle, but I suspect I'll start with a list of famous people, filter it down the the candidate list C, and work on it manually from there.

Good luck, Puzzlers! I'll be back later this week with my solution.

--Levi

Saturday, September 04, 2021

Musical composition, music store purchase (Solution)

Ready for the solution to Sunday's puzzle? I started out with the approach I previously detailed, but then after searching the web for types of musical compositions, the answer leapt out at me, so I'll leave that implementation "as an exercise to the reader," as they say. :-)

Anywho, the answer to the puzzle is:

rhapsody --> rap CD

See you tomorrow for the new Sunday Puzzle!

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...