Skip to content

About

No description, website, or topics provided.

Resources

Stars

1 star

Watchers

0 watching

Forks

Latest commit

 

History

39 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

FlipRedact

About FlipRedact

1. What it does

FlipRedact is a web app that helps you safely interact with Large Language Models (LLMs) by detecting Personally Identifiable Information (PII) in your text. It lets users selectively redact sensitive information before sending it to an LLM and then conveniently unredact the results afterward.

2. How it works

We built FlipRedact using a hybrid approach:

  • Regex rules to catch common structured PII (like phone numbers and emails).
  • A pretrained Named Entity Recognition (NER) model from Hugging Face to detect general entities.
  • A finetuned DistilBERT model to capture more domain-specific PII with higher accuracy.

Detected PII is returned with its position, type, and confidence score, which the frontend uses to highlight text and provide interactive redaction options for the user.


Deployment via Docker

  1. Install Docker Desktop: https://docs.docker.com/desktop/ for Linux/Windows/Mac

  2. Git clone repo branch docker git clone --branch docker https://github.com/andrew250402/FlipRedact.git to desired folder

  3. Navigate to Flip-redact-1 (Main folder that contains "docker-compose.yml") cd FlipRedact

  4. Open up Docker Desktop (Must be running first) Then, run this line in cmd (in the desired folder) : docker-compose up

  5. Docker Desktop should be running as well. Either press v in cmd or open Docker Desktop and follow the url (react-app) to view web app Make sure that both flipredact-frontend:latest and flipredact-backend:latest are running simulataneously

image

Possible Troubleshooting: RAM issues due to WSL (docker software)

  1. Win + R, type CMD. Then Ctrl + Shift + Enter to Run as Administrator
  2. Run wsl --shutdown to save your computer

How to Run FlipRedact

1. Prerequisites

Make sure you have the following installed:

2. Setup

First, clone the repository and navigate into the project's root directory.

# Clone the repository from GitHub
git clone https://github.com/andrew250402/FlipRedact

# Navigate into the newly created folder
cd FlipRedact

The project has the following structure:

FlipRedact/
├── backend/
│   ├── app.py
│   └── ... (other python files)
├── my-app/
│   ├── src/
│   │   ├── App.jsx
│   │   └── ... (other jsx/js files)
│   ├── package.json
│   └── ...
└── requirements.txt

3. Run the Backend (Server)

The backend is a FastAPI server. Open a terminal in the project's root directory (FlipRedact).

# Create a virtual environment
python -m venv venv

# Activate the virtual environment
# On Windows:
venv\Scripts\Activate.ps1
# On macOS/Linux:
# source venv/bin/activate

# Install the required Python packages
pip install -r requirements.txt

# Start the FastAPI server (run from the root directory)
uvicorn backend.app:app --reload --port 3000

Your backend should now be running at http://127.0.0.1:3000.

4. Run the Frontend (Client)

The frontend is a React application. Open a new terminal and navigate into the frontend directory.

# IMPORTANT: Change directory to the frontend folder
cd my-app

# Install the required node modules
npm install

# Start the React development server
npm run start

How to use FlipRedact

1. Enter your text full of personal information

Sample text:

Exclusive Performance Contract
Parties:
This agreement is entered into on 15 August 2025 between:
StarForge Entertainment Pte Ltd
Contact: [email protected] | +65 6789 1234
[ARTIST GROUP: KPOP Demon Hunters]
1. Member Details
- Name: Kim Han
- NRIC: S9123456A
- Passport No: E1234567A
- Phone: +65 8123 4567
- Email: [email protected]
- Name: Lee Min
- NRIC: S8234567B
- Passport No: E8765432A
- Address: 089322
- Phone: +65 9345 6789
- Email: [email protected]
2. Performance Details
- Event: Demon Hunters World Tour – Singapore Stop
- Venue: Singapore Indoor Stadium
- Date: 20 September 2025
3. Payment Terms
- Total Contract Value: USD 500,000
- Deposit: 50% payable upon signing (USD 250,000)
- Balance: 50% payable within 7 days after performance
- Payment Method: Bank Transfer to members’ registered accounts
image

2. Press "Run PII Detection". A list of identified PIIs will appear on the right.

image

3. Select PIIs to be redacted and press "Apply Redaction"

image

4. Use redacted text for your favourite LLM

image

5. Paste the LLM's output to the decoder

image

6. Press "Decode PIIs" to reverse redaction

image

About

No description, website, or topics provided.

Resources

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages