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

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