BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
mar00390
Fluorite | Level 6

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?

1 ACCEPTED SOLUTION

Accepted Solutions
SASKiwi
PROC Star

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.   

View solution in original post

3 REPLIES 3
SASKiwi
PROC Star

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.

mar00390
Fluorite | Level 6

Would there be a function that could focus on something like that? I am out of ideas

 

SASKiwi
PROC Star

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: Save the Date

 SAS Innovate 2025 is scheduled for May 6-9 in Orlando, FL. Sign up to be first to learn about the agenda and registration!

Save the date!

How to Concatenate Values

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.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 3 replies
  • 843 views
  • 3 likes
  • 2 in conversation