I have been writing PRX functions to find specific text in a text string. What I'm having trouble with, is that even when I find the correct word, I can also find the negative of that word too.
For example, I want to search the word "wheezing," so I do, and it finds wheezing, but the problem is that the sentence that it is in says "The patient has no sign of wheezing."
I only want to find patients that HAVE wheezing.
In the PRX functions, how would I go about doing this?
One approach worth exploring would be to pull out all occurrences of the word wheezing, then look for common word phrases containing wheezing (no sign of wheezing, has occasional wheezing, has constant wheezing etc). You may be lucky that there might only be 10 or 20 phrases that keep being repeated. Then you can add SAS logic to deal with those common phrases. It is a lot of work, but it might help you make progress.
SAS has a text mining tool, SAS Text Miner that might be able to help here, but if you don't have it then it is not an option.
What you are asking for is language interpretation and PRX isn't designed for that. It is just looking at character or word patterns. You can imagine all the many ways of describing wheezing and not wheezing. I'm not sure there is any way in SAS of doing language interpretation. Others more experienced in this area than I may care to comment.
Would there be a function that could focus on something like that? I am out of ideas
One approach worth exploring would be to pull out all occurrences of the word wheezing, then look for common word phrases containing wheezing (no sign of wheezing, has occasional wheezing, has constant wheezing etc). You may be lucky that there might only be 10 or 20 phrases that keep being repeated. Then you can add SAS logic to deal with those common phrases. It is a lot of work, but it might help you make progress.
SAS has a text mining tool, SAS Text Miner that might be able to help here, but if you don't have it then it is not an option.
SAS Innovate 2025 is scheduled for May 6-9 in Orlando, FL. Sign up to be first to learn about the agenda and registration!
Learn how use the CAT functions in SAS to join values from multiple variables into a single value.
Find more tutorials on the SAS Users YouTube channel.
Ready to level-up your skills? Choose your own adventure.