I have thousands of resumes in any format like word with .doc, .docx and pdf.
I want to extract bold text from these documents using textract library in python. is t
An easy solution would be to use the python-docx package. install the package using ( !pip install python-docx )
You'll need to convert your pdf files to .docx . you can do that using any online pdf to docx converter or use python to do that.
the following lines of codes will extract all bold and italic contents of your resumes and save them in a dictionary called boltalic_Dict. you may retrieve either later on.
from docx import *
document = Document('path_to_your_files')
bolds=[]
italics=[]
for para in document.paragraphs:
for run in para.runs:
if run.italic :
italics.append(run.text)
if run.bold :
bolds.append(run.text)
boltalic_Dict={'bold_phrases':bolds,
'italic_phrases':italics}
I hope this helps.