You may install the precompiled binaries and GGUF model using the following instructions.
Both are required to use the
privacy-filter.cppcommand line tool. The binary is the executable that runs the classification, while the model contains the data and parameters needed for the classification process.
Download the archive for your platform from the latest release:
curl -L -o privacy-filter.tar.gz \
https://github.com/DirectoryTree/PrivacyFilterBinaries/releases/latest/download/privacy-filter-darwin-arm64.tar.gz
tar -xzf privacy-filter.tar.gzDownload the GGUF model:
mkdir -p models
curl -L -o models/privacy-filter-f16.gguf \
https://huggingface.co/LocalAI-io/privacy-filter-GGUF/resolve/main/privacy-filter-f16.ggufClassify text from stdin:
echo 'Contact John Doe at jdoe@example.com from 555-0100.' \
| ./privacy-filter-darwin-arm64/bin/privacy-filter --classify models/privacy-filter-f16.gguf 0.5The final argument is the classification threshold. Only entities with a confidence score equal to or greater than the threshold will be returned.
Use privacy-filter-serve to keep the model loaded and classify multiple requests through a single long-running process:
./privacy-filter-darwin-arm64/bin/privacy-filter-serve models/privacy-filter-f16.ggufThe process reads one JSON request per line from stdin and writes one JSON response per line to stdout:
{"id":"1","text":"Contact John Doe at jdoe@example.com.","threshold":0.5}