Read Legacy Office Documents for AI
LlamaIndex reader that loads data from legacy Microsoft Word 97 .doc files using Apache Tika, running the Tika server locally to extract content and metadata.
Why it matters
Ingest and process data from legacy Microsoft Office documents (.doc) for use in AI applications. This reader enables AI models to access and understand information previously locked in older file formats.
Outcomes
What it gets done
Parse .doc files using Apache Tika.
Extract text content and metadata from legacy Office documents.
Integrate seamlessly with LlamaIndex for RAG and data pipelines.
Run Tika server locally for secure, offline processing.
Install
Add it to your toolbox
Run in your project directory:
curl -fsSL https://spark.entire.vc/get/li-reader-readers-legacy-office | bash Overview
LlamaIndex Legacy Office Reader
LlamaIndex Legacy Office Reader is a data loader that extracts content and metadata from legacy Microsoft Word 97 .doc files using Apache Tika. It runs the Tika server locally to parse documents without remote dependencies, producing LlamaIndex Document objects ready for indexing. The reader supports both single-file processing and batch directory operations through SimpleDirectoryReader integration. Use this reader when building LlamaIndex applications that need to process legacy .doc files from archives, legacy systems, or older document collections. It's the right choice when you need local document parsing without external API calls and have Java 11+ available in your environment.
What it does
LlamaIndex Legacy Office Reader loads data from legacy Microsoft Office documents, specifically Word 97 .doc files, using Apache Tika. It runs the Tika server locally to avoid remote server dependencies, extracting both document content and metadata into LlamaIndex Document objects for indexing and retrieval.
When to use - and when NOT to
Use this reader when you need to process legacy .doc files (Word 97 format) in your LlamaIndex pipeline, particularly when working with archived documents or systems that still produce older Office formats. The reader supports batch processing of multiple documents through SimpleDirectoryReader integration.
Do NOT use this reader for modern Office formats like .docx - use a standard document reader instead. Avoid this tool if you cannot install Java 11+ on your system, as Apache Tika 3.x requires it.
Inputs and outputs
You provide the path to a legacy Office document (.doc file) or configure it as a file extractor for SimpleDirectoryReader. Optionally, you can specify a custom path to the Tika server JAR file.
You receive LlamaIndex Document objects containing the extracted text content and preserved metadata from the original files, ready for indexing or further processing in your LlamaIndex application.
Integrations
The reader integrates seamlessly with SimpleDirectoryReader for batch processing entire directories of documents with custom file extractors. It is built on Apache Tika (content analysis toolkit) and tika-python (Python bindings for Apache Tika), leveraging Apache Tika 3.x for document parsing.
Who it's for
This reader is for users building LlamaIndex applications that need to process legacy Office documents in .doc format.
Source README
LlamaIndex Legacy Office Reader
Overview
The Legacy Office Reader allows loading data from legacy Office documents (like Word 97 .doc files) using Apache Tika. It runs the Tika server locally to avoid remote server calls.
Installation
You can install the Legacy Office Reader via pip:
pip install llama-index-readers-legacy-office
Usage
Basic Usage
from llama_index.readers.legacy_office import LegacyOfficeReader
### Initialize LegacyOfficeReader
reader = LegacyOfficeReader(
tika_server_jar_path="path/to/tika-server.jar", # Optional: Path to Tika server JAR
)
### Load data from a legacy Office document
documents = reader.load_data(
file="path/to/document.doc", # Path to the legacy Office document
)
Using with SimpleDirectoryReader
from llama_index.core import SimpleDirectoryReader
from llama_index.readers.legacy_office import LegacyOfficeReader
reader = SimpleDirectoryReader(
input_dir="path/to/directory/",
file_extractor={".doc": LegacyOfficeReader()},
)
documents = reader.load_data()
Features
- Parses legacy Office documents (
.doc) using Apache Tika - Optionally (default) runs Tika server locally to avoid remote server calls/dependencies
- Extracts both content and metadata from documents
- Supports batch processing of multiple documents
- Seamless integration with SimpleDirectoryReader
Requirements
- Java Runtime Environment (JRE) 11 or higher (required for Apache Tika 3.x)
- Python 3.8 or higher
Notes
- The first time you use the reader, it will download the Tika server JAR file if not provided
- The Tika server will run locally on port
9998 - All document metadata is preserved in the Document objects
- Make sure you have Java 11+ installed and available in your system PATH
- The reader uses Apache Tika 3.x
FAQ
Common questions
Discussion
Questions & comments · 0
Sign In Sign in to leave a comment.