Displaying 6 results from an estimated 6 matches for "sentence_number".
2017 Jul 11
2
Extracting sentences with combinations of target words/terms from cancer patient text medical records
...I could get my code working, it would be too inefficient to handle that volume of data.
Thanks,
Paul
library(tidyverse)
library(stringr)
library(lubridate)
sentence_match <- function(x){
sentence_extract <- str_extract_all(sampletxt, boundary("sentence"), simplify = TRUE)
sentence_number <- intersect(str_which(sentence_extract, "breast"), str_which(sentence_extract, "metastatic|stage IV"))
sentence_match <- str_c(sentence_number, ": ", sentence_extract[sentence_number], collapse = "")
sentence_match
}
#### Working code ####
samp...
2017 Jul 13
1
Extracting sentences with combinations of target words/terms from cancer patient text medical records
...ll, 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_number, ": ", sentence_extract[sentence_number], collapse = "")
sentence_match
}
sampletxt <-
structure(...
2017 Jul 12
0
Extracting sentences with combinations of target words/terms from cancer patient text medical records
...icient to handle that volume of data.
>
>Thanks,
>
>Paul
>
>
>library(tidyverse)
>library(stringr)
>library(lubridate)
>
>sentence_match <- function(x){
> sentence_extract <- str_extract_all(sampletxt, boundary("sentence"), simplify = TRUE)
> sentence_number <- intersect(str_which(sentence_ extract, "breast"), str_which(sentence_extract, "metastatic|stage IV"))
> sentence_match <- str_c(sentence_number, ": ", sentence_extract[sentence_ number], collapse = "")
> sentence_match
>}
>
>#### Wor...
2017 Jul 12
2
Extracting sentences with combinations of target words/terms from cancer patient text medical records
...icient to handle that volume of data.
>
>Thanks,
>
>Paul
>
>
>library(tidyverse)
>library(stringr)
>library(lubridate)
>
>sentence_match <- function(x){
> sentence_extract <- str_extract_all(sampletxt, boundary("sentence"), simplify = TRUE)
> sentence_number <- intersect(str_which(sentence_ extract, "breast"), str_which(sentence_extract, "metastatic|stage IV"))
> sentence_match <- str_c(sentence_number, ": ", sentence_extract[sentence_ number], collapse = "")
> sentence_match
>}
>
>#### Wor...
2017 Jul 11
0
Extracting sentences with combinations of target words/terms from cancer patient text medical records
...hat
> volume of data.
>
> Thanks,
>
> Paul
>
>
> library(tidyverse)
> library(stringr)
> library(lubridate)
>
> sentence_match <- function(x){
> sentence_extract <- str_extract_all(sampletxt, boundary("sentence"),
> simplify = TRUE)
> sentence_number <- intersect(str_which(sentence_extract, "breast"),
> str_which(sentence_extract, "metastatic|stage IV"))
> sentence_match <- str_c(sentence_number, ": ", sentence_extract[sentence_number],
> collapse = "")
> sentence_match
> }
>
&...
2017 Jul 13
0
Extracting sentences with combinations of target words/terms from cancer patient text medical records
...ll, 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_number, ": ", sentence_extract[sentence_number], collapse = "")
sentence_match
}
sampletxt <-
structure(...