I am unable to read my database from the PDF file

Viewed 29

I'm doing sentiment analysis on articles. I am transforming my PDF file into corpus; these files are in a Folder.

#reference: https://data.library.virginia.edu/reading-pdf-files-into-r-for-text-mining/

library(pdftools) #incluido RSC (ref.: https://cran.r-project.org/web/packages/pdftools/pdftools.pdf)

files <- list.files(path = "~/Doctorade-Project/Doctorade/CLAY_Arquivos_PDF", pattern = "pdf$", full.names = TRUE)

files

Here I already use PDFtools, which made the reading of the files smooth, without problem.

When I want to import all files from Folder and transform into "corpus", it has the following import errors.

#reference: https://data.library.virginia.edu/reading-pdf-files-into-r-for-text-mining/

opinions <-lapply(files, pdf_text)
length(opinions)

lapply(opinions, length) 

follow the results

[Output truncated]PDF error: Could not parse ligature component "0173" of "_0173" in parseCharName
PDF error: Could not parse ligature component "0173" of "_0173" in parseCharName

PDF error: Invalid shared object hint table offset

PDF error: read ICCBased color space profile error
PDF error: not an ICC profile, invalid signature

Error in poppler_pdf_info(loadfile(pdf), opw, upw) : PDF parsing failure.

I need to import the texts from the files that are in PDF, that is, make the corpus of words to perform the sentiment analysis.

We appreciate everyone's help, and thank you for your cooperation.

0 Answers
Related