I am using Python 3.6.9 and was facing an issue with PDF Converters using PDFToTextConverter and I got it resolved using Issue #182 , and it is now working fine, thank you for the speedy support.
I wanted to know whether there is similar support for Docx files, for now, I need to do this:
from docx2python import docx2python
doc=docx2python('article_text.docx')
text=[]
for sent in doc.body[0][0][0]:
text.append(sent)
article_text=''.join(text)
import re
article_text = re.sub(r'\[[0-9]*\]', ' ', article_text)
article_text = re.sub(r'\s+', ' ', article_text)
Is there a more direct option like PDFToTextConverter.
It's not implemented yet in Haystack, but would definitely be valuable.
A basic implementation should be rather straightforward. It should mimic the PDFToTextConverter and inherit from BaseConverter. We could use the same library you mentioned (docx2python) to read the file - just not sure if separation into pages is possible there.
Would you be interested in implementing this and creating a pull request @anirbansaha96 ? We could support you along the way.
Yes @tholor, I'll definitely look into this and try to implement this.
Word and PDF documents are the most common documents most people use. It will be great if it is supported.
for eBooks EPUB also common beside AZW and Mobi
@tholor I have added the functionality and pulled a request #225. Please do look into it.
Thank You for approving the Merge Request. I've checked in my own implementation. It works fine.