search for: sentence_match

Displaying 6 results from an estimated 6 matches for "sentence_match".

2017 Jul 11
2
Extracting sentences with combinations of target words/terms from cancer patient text medical records
...ode below to illustrate what I'm trying to do. At the moment, I'm trying to extract sentences that contain the word "breast" plus either "metastatic" or "stage IV". It's been some time since I used R and I feel a bit rusty. I wrote a function called "sentence_match" that seemed to work well when applied to a single piece of text. You can see that by running the section titled "Working code". I thought that it might be possible easily to apply my function to a data set (tibble or df) but that doesn't seem to be the case. My unsuccessful at...
2017 Jul 12
2
Extracting sentences with combinations of target words/terms from cancer patient text medical records
...ow to illustrate what I'm trying to do. At the moment, I'm trying to extract sentences that contain the word "breast" plus either "metastatic" or "stage IV". > >It's been some time since I used R and I feel a bit rusty. I wrote a function called "sentence_match" that seemed to work well when applied to a single piece of text. You can see that by running the section titled > >"Working code". I thought that it might be possible easily to apply my function to a data set (tibble or df) but that doesn't seem to be the case. My unsucces...
2017 Jul 11
0
Extracting sentences with combinations of target words/terms from cancer patient text medical records
...what I'm trying to do. At the > moment, I'm trying to extract sentences that contain the word "breast" plus > either "metastatic" or "stage IV". > > It's been some time since I used R and I feel a bit rusty. I wrote a > function called "sentence_match" that seemed to work well when applied to a > single piece of text. You can see that by running the section titled > > "Working code". I thought that it might be possible easily to apply my > function to a data set (tibble or df) but that doesn't seem to be the case....
2017 Jul 12
0
Extracting sentences with combinations of target words/terms from cancer patient text medical records
...ow to illustrate what I'm trying to do. At the moment, I'm trying to extract sentences that contain the word "breast" plus either "metastatic" or "stage IV". > >It's been some time since I used R and I feel a bit rusty. I wrote a function called "sentence_match" that seemed to work well when applied to a single piece of text. You can see that by running the section titled > >"Working code". I thought that it might be possible easily to apply my function to a data set (tibble or df) but that doesn't seem to be the case. My unsucces...
2017 Jul 13
1
Extracting sentences with combinations of target words/terms from cancer patient text medical records
...information into a single text string, and then the numbering would be lost. If you were going to get the sentence numbers as well, without making several passes through the data like my code does, how would you go about it? Thanks, Paul library(tidyverse) library(stringr) library(lubridate) sentence_match <- function(x){ sentence_extract <- str_extract_all(x, boundary("sentence"), simplify = TRUE) sentence_number <- intersect(str_which(sentence_extract, "breast"), str_which(sentence_extract, "metastatic|stage IV")) sentence_match <- str_c(sentence_numb...
2017 Jul 13
0
Extracting sentences with combinations of target words/terms from cancer patient text medical records
...information into a single text string, and then the numbering would be lost. If you were going to get the sentence numbers as well, without making several passes through the data like my code does, how would you go about it? Thanks, Paul library(tidyverse) library(stringr) library(lubridate) sentence_match <- function(x){ sentence_extract <- str_extract_all(x, boundary("sentence"), simplify = TRUE) sentence_number <- intersect(str_which(sentence_extract, "breast"), str_which(sentence_extract, "metastatic|stage IV")) sentence_match <- str_c(sentence_numb...