DiffyDoc is an assistant for Microsoft Word documents. Its goal is to comment on the content of the document without breaking it. To do so, the agent inserts MSWord comments and exports the new file.
You need GIT in order to clone this repository. If you do not have GIT installed, you can download a ZIP archive of the repository and safely skip this step.
In order to clone this repository, open a command prompt and navigate to a path where you wish to download the folder to. Then, run the following command:
git clone https://github.com/Zorkyx22/DiffyDoc.git
This project is written in Python as that is the most easy to start with. If I work more on this in order to make a public release, I will most likely write it in a compilable language like rust or c++. I think rust has the better support for Ollama usage, but tbd.
Make sure you have python installed. I advise the use of virtual environments when running python projects as to not break your global python configuration.
You can safely skip this skep as it is optional, however it is advised to go through these steps.
- From your command prompt, navigate to the root of this repository and run the following command:
python -m venv <name of folder>. I usually use.venvas the name of the folder. The next steps will assume that.venvwas used. - Wait for the command to complete. This can take a minute.
- Activate the virtual environment. You can do this by running the activation script (windows) or sourcing the activation file (unix).
Windows Powershell:
.\.venv\Scripts\activateWindows bash:.\.venv\Scripts\activate.batUnix:source ./.venv/bin/activate - Now you environment is activated, so any python packages that you install will only be installed here. Repeat step 3 whenever you need to run this tool.
The python requirements are listed in the requirements.txt file at the root of the repository. You can download them all automatically using python. From your command prompt, navigate to the root of the repository and execute the following command:
python -m pip install -r requirements.txt
This project currenlty only uses a locally-run LLM with Ollama. In order to set this up, first install Ollama. See their repo for more instructions on how to do that: Github.com/Ollama/Ollama
You will need a model to run this. You can select one from Ollama.com/Library
In order to select the model best suited for you, as I have a pretty basic machine, I usually stick to 1B or 3B models. If I go any higher, The tasks take many minutes (sometimes hours). I currently use llama3.2:3b-instruct-Q5_K_M. This is set as the default in the script, so installing this model is the simplest to setup.
Once you're setup, you can run the application using the following syntax:
python document_parser.py [-h] [--model MODEL] file
positional arguments:
file The docx file you wish to translate
options:
-h, --help show this help message and exit
--model MODEL, -m MODEL
The model to use with the local ollama server. The
default is llama3.2:3b-instruct-q5_K_MThe prompt used is located in the constants.py file. Feel free to play with it.