A dataset for temporal analysis of files related to the JFK case
<p>This dataset contains the content of the subset of all files with a correct publication date from the 2017 release of files related to the JFK case (retrieved from https://www.archives.gov/research/jfk/2017-release). This content was extracted from the source PDF files using the R OCR libraries tesseract and pdftools.</p> <p>The code to derive the dataset is given as follows:</p> <p>### BEGIN R DATA PROCESSING SCRIPT</p> <p>library(tesseract)<br> library(pdftools)</p> <p>pdfs <- list.files("/home/STAFF/luczakma/RProjects/JFK/data/files/")</p> <p>meta <- read.csv2("/home/STAFF/luczakma/RProjects/JFK/data/jfkrelease-2017-dce65d0ec70a54d5744de17d280f3ad2.csv",header = T,sep = ',')</p> <p>meta$Doc.Date <- as.character(meta$Doc.Date)</p> <p>meta.clean <- meta[-which(meta$Doc.Date=="" | grepl("/0000",meta$Doc.Date)),]<br> for(i in 1:nrow(meta.clean)){<br> meta.clean$Doc.Date[i] <- gsub("00","01",meta.clean$Doc.Date[i])<br> <br> if(nchar(meta.clean$Doc.Date[i])<10){<br> meta.clean$Doc.Date[i]<-format(strptime(meta.clean$Doc.Date[i],format = "%d/%m/%y"),"%m/%d/%Y")<br> }<br> <br> }</p> <p>meta.clean$Doc.Date <- strptime(meta.clean$Doc.Date,format = "%m/%d/%Y")</p> <p>meta.clean <- meta.clean[order(meta.clean$Doc.Date),]</p> <p>docs <- data.frame(content=character(0),dpub=character(0),stringsAsFactors = F)<br> for(i in 1:nrow(meta.clean)){<br> #for(i in 1:3){<br> pdf_prop <- pdftools::pdf_info(paste0("/home/STAFF/luczakma/RProjects/JFK/data/files/",tolower(gsub("\\s+"," ",gsub(" ","",meta.clean$File.Name[i])))))<br> tmp_files <- c()<br> for(k in 1:pdf_prop$pages){<br> tmp_files <- c(tmp_files,paste0("/home/STAFF/luczakma/RProjects/JFK/data/tmp/",k))<br> }<br> <br> img_file <- pdftools::pdf_convert(paste0("/home/STAFF/luczakma/RProjects/JFK/data/files/",tolower(gsub("\\s+"," ",gsub(" ","",meta.clean$File.Name[i])))), format = 'tiff', pages = NULL, dpi = 700,filenames = tmp_files)<br> <br> txt <- ""<br> <br> for(j in 1:length(img_file)){<br> extract <- ocr(img_file[j], engine = tesseract("eng"))<br> #unlink(img_file)<br> txt <- paste(txt,extract,collapse = " ")<br> }<br> <br> docs <- rbind(docs,data.frame(content=iconv(tolower(gsub("\\s+"," ",gsub("[[:punct:]]|[\n]"," ",txt))),to="UTF-8"),dpub=format(meta.clean$Doc.Date[i],"%Y/%m/%d"),stringsAsFactors = F),stringsAsFactors = F)<br> }</p> <p>### END R DATA PROCESSING SCRIPT</p>
ShareScore
44/100
Overall dataset sharing score
Score breakdown
These five areas show where the dataset supports — or may limit — practical reuse.
- Stewardship
- 8
- Harmonization
- 4
- Access
- 20
- Reuse readiness
- 8
- Engagement
- 4