64 lines
2.2 KiB
Markdown
64 lines
2.2 KiB
Markdown
# README.md
|
|
|
|
# Document Processing App
|
|
|
|
This project is designed to process legal documents by hiding sensitive information such as names and company names. It utilizes the Ollama API with selected models for text processing. The application monitors a specified directory for new files, processes them automatically, and saves the results to a target path.
|
|
|
|
## Project Structure
|
|
|
|
```
|
|
doc-processing-app
|
|
├── src
|
|
│ ├── main.py # Entry point of the application
|
|
│ ├── config
|
|
│ │ └── settings.py # Configuration settings for paths
|
|
│ ├── services
|
|
│ │ ├── file_monitor.py # Monitors directory for new files
|
|
│ │ ├── document_processor.py # Handles document processing logic
|
|
│ │ └── ollama_client.py # Interacts with the Ollama API
|
|
│ ├── utils
|
|
│ │ └── file_utils.py # Utility functions for file operations
|
|
│ └── models
|
|
│ └── document.py # Represents the structure of a document
|
|
├── tests
|
|
│ └── test_document_processor.py # Unit tests for DocumentProcessor
|
|
├── requirements.txt # Project dependencies
|
|
├── .env.example # Example environment variables
|
|
└── README.md # Project documentation
|
|
```
|
|
|
|
## Setup Instructions
|
|
|
|
1. Clone the repository:
|
|
```
|
|
git clone <repository-url>
|
|
cd doc-processing-app
|
|
```
|
|
|
|
2. Install LibreOffice (required for document processing):
|
|
```
|
|
brew install libreoffice
|
|
```
|
|
|
|
3. Install the required dependencies:
|
|
```
|
|
pip install -r requirements.txt
|
|
pip install -U magic-pdf[full]
|
|
```
|
|
|
|
4. Configure the application by editing the `src/config/settings.py` file to set the paths for the object storage and target directory.
|
|
|
|
5. Create a `.env` file based on the `.env.example` file to set up necessary environment variables.
|
|
|
|
## Usage
|
|
|
|
To run the application, execute the following command:
|
|
```
|
|
python src/main.py
|
|
```
|
|
|
|
The application will start monitoring the specified directory for new documents. Once a new document is added, it will be processed automatically.
|
|
|
|
## Contributing
|
|
|
|
Contributions are welcome! Please open an issue or submit a pull request for any improvements or bug fixes. |