Find keywords in text (from a large list)

Hi,

I’d like to create a “tags” column, to better categorize some content.

The idea would be to search content (ie food recipes) for keywords from a list (100+ keywords) and if there is a match, either list keywords in a new column (ie “Chinese” or “Japanese”) , or (ideally) add tags to a new column (i.e. if keywords “Chinese” or “Japanese” => tag = “Asian”)

The new column can contain multiple tags

As the list is pretty heavy, I’d like to avoid if/then… rules

something similar to

What’s the best way to do this with Parabola?

thanks in advance!

Hey @Frederic! Welcome to the community.

Here’s a walkthrough on how you can achieve this using Parabola. This assumes you have a separate list of keywords and tags that you can import.

Start by importing your keywords/tags and recipes. Here’s what my recipes data looks like:

And here’s what my keywords data looks like:

Using two Insert Text Column steps we can create new columns for each table called Join and insert a value of 1. This new column will eventually be used to merge the tables together.

I like to reorder the columns, but it’s a personal preference. This won’t affect your flow. We’ll now use a Combine tables step to join on the matching Join column.

This will create duplicate rows, but we’ll take care of that later. We’ll use an Insert if/else column. Don’t worry, it will only require one rule. :slight_smile:

Let’s create a new column called Keyword?. If a recipe contains a keyword in the same row, the value Yes will be inserted in that column. Otherwise, the value is blank.

Lastly, we can use a Filter rows to show rows that have a value of Yes in Keywords? column. The resulting table should show us a list of recipes, keywords, and tags associated with those keywords.

Let me know if that helps!

1 Like

thanks a lot @daniel, it looks fantastic! I’m going to give a try now:)

3 Likes

Hi @daniel

workaround implemented, thank you!

I even slightly improved it by adding a “merge duplicate rows’. step at the end, with a ',” delimiter to have multiple tags (if any) for one recipe.

The only limitation I see atm, is the “insert if/else column” function which is case sensitive (if keywords is “French” , and it is written “french” in the recipe, it won’t find it). Do you know any fix to this issue?

thanks
Fred

2 Likes

Hey @Frederic,

Glad to see you improved on the flow!

To capture case sensitivity, try using an Insert text column to duplicate the values of your Keywords column. You can then use a Change text casing step to make those keywords lowercase.

You should now have two columns with both casings for your keywords.

In your Insert if/else column settings, you can add a condition to target the lowercase keywords using the same rule that’s already in place. If your recipe has an uppercase or lowercase keyword, the Keyword? column should now populate with the value Yes.

thank you Daniel, really helpful. I made both the “recipes” and “keywords” value. lowercase and it works perfectly.

thanks!

2 Likes