cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
  • New to JMP? Join us Sept. 23-24 for the Early User Edition of Discovery Summit, tailor-made for new users. Register now for free!
  • Your voice matters! Tell us how you prefer to receive JMP updates, so we can tailor our communication to your needs. Take short survey.
  • See how to access JMP Marketplace - and - find, create & share add-ins to extend your JMP. Watch video.

Discussions

Solve problems, and share tips and tricks with other JMP users.
Choose Language Hide Translation Bar
caseylott
Level V

Extending some of the phrases that are found by Text Explorer

Hi there,

I am using Text explorer to find phrases in a clean corpus that I know pretty well, oracle text from Magic the Gathering cards. It's doing a great job, but there's something I'd like to improve. It is finding the common phrase "destroy up to one target" but it is not finding the phrases "destroy up to one target creature" or "destroy up to one target enchantment". I'd like to be able to find these. They are common enough that they should probably be found. I have increased the maximum number of words per phrase from 10 to 100 to 1000 to see if this would affect algorithm behavior and it didn't. I've turned of all stop words and I am not using stemming. I have the maximum number of phrases to find parameter to 50,000 and it only found about 30,000, so I don't think that is the issue.

Aside from these basic settings, is there something I can do to "train" the phrase finding algorithm to find these extended phrases? I don't understand Regex, but perhaps there's something that could be done there? This kind of unfortunate truncation (at least for the purposes of my research) happens throughout my corpus, so I'm looking for a solution that would fix this problem systemically, rather than a 1 time fix, like adding the specific phrase I am working for. I think I would find many of the phrases that I am looking for if it could just be taught to extend all existing phrases one word more. I imagine there's so rule that makes it think that it's found the optimal stopping point for each phrase as it adds one word at a time, but for this corpus, it often stops just a little too short. Of course, it's finding all kinds of non-sensical 10 word phrases that I am not looking for.

Does anyone have an idea for how to get it to just extend each of the phrases that it finds by one word? 

 

I haven't found that changing any settings makes a difference. Does anyone have any suggestions? I

1 ACCEPTED SOLUTION

Accepted Solutions

Re: Extending some of the phrases that are found by Text Explorer

Hi @caseylott ,

 

Cool idea - I'm wondering if the LLM Prompt Runner on the marketplace could be a good place to start - let an LLM do some of the hard work of identifying key phrases or cleaning up the original entries to simplify the data finding. MTG oracle text has a very regular domain grammar (verb + "target" + optional quantifier + object type), so an LLM prompt asking it to extract the full object of each targeting clause would reliably produce "target creature," "target enchantment," "target creature or planeswalker," etc. as structured output.

Other option would be to change the phrase "destroy up to one target" into a single phrase "destroy_up_to_one_target" - right now the text explorer is splitting the individual words up, and because none of the end terms dominate (ie theres not loads of 'target creature') theyre being placed as single entries. If you convert as 'destroy_up_to_one_target' it will float up 'destroy_up_to_one_target creature//enchantment' or similar. You can use Column > Recode> Replace String and do similar to the screenshot below:

Ben_BarrIngh_0-1784803377366.png

 

“All models are wrong, but some are useful”

View solution in original post

3 REPLIES 3

Re: Extending some of the phrases that are found by Text Explorer

Hi @caseylott ,

 

Cool idea - I'm wondering if the LLM Prompt Runner on the marketplace could be a good place to start - let an LLM do some of the hard work of identifying key phrases or cleaning up the original entries to simplify the data finding. MTG oracle text has a very regular domain grammar (verb + "target" + optional quantifier + object type), so an LLM prompt asking it to extract the full object of each targeting clause would reliably produce "target creature," "target enchantment," "target creature or planeswalker," etc. as structured output.

Other option would be to change the phrase "destroy up to one target" into a single phrase "destroy_up_to_one_target" - right now the text explorer is splitting the individual words up, and because none of the end terms dominate (ie theres not loads of 'target creature') theyre being placed as single entries. If you convert as 'destroy_up_to_one_target' it will float up 'destroy_up_to_one_target creature//enchantment' or similar. You can use Column > Recode> Replace String and do similar to the screenshot below:

Ben_BarrIngh_0-1784803377366.png

 

“All models are wrong, but some are useful”
caseylott
Level V

Re: Extending some of the phrases that are found by Text Explorer

Thank you, Ben. I’ll try the manual recode trick. I’m not sure what the LLM on Marketplace option is, but if it’s an add-on I need to pay for, I’ll pass.

Casey

“Wrong models can be dangerous too”
caseylott
Level V

Re: Extending some of the phrases that are found by Text Explorer

Hi Ben,

Just wanted to give you kudos and let you know the manual recode worked, extremely well. Every time that I found a phrase that seemed to be missing a word at the end, I simply recoded the phrase to be one word with underscores and re-ran the analysis with the same settings. Each time, the phrase I was looking for showed up. For example, after "At the beginning of each opponents" was recoded to "At_ the_beginning_of_each_opponents" and moved to the term list, the next time I ran text explorer it found "At the beginning of each opponents upkeep", which is what I was looking for in the first place. My corpus and the phrases I am looking for is small enough that I can probably make these type of manual recodes in about 20-30 places and effectively find all of the terms I am looking for. For smaller analyses like this, I feel like I was just given a "hack" that I will use over and over again. I am grateful.

Casey

Recommended Articles