# Batch LLM Text Auditor ## Overview The Batch LLM Text Auditor is a Python tool designed to audit large datasets of text documents and identify which ones are likely generated by large language models (LLMs). It preprocesses the text, applies traditional machine learning classifiers, and outputs a detailed report with classification results and feature statistics for each document. ## Features - Preprocesses text by removing punctuation, converting to lowercase, and removing stop words. - Uses a TF-IDF vectorizer and a Random Forest Classifier to classify text. - Outputs a CSV report with filenames, text content, LLM probabilities, and predictions. ## Requirements - Python 3.7+ - scikit-learn - pandas - nltk ## Installation 1. Clone the repository: ```bash git clone cd batch_llm_text_auditor ``` 2. Install the required dependencies: ```bash pip install -r requirements.txt ``` ## Usage Run the tool using the following command: ```bash python batch_llm_text_auditor.py --input_dir --output ``` - `--input_dir`: Path to the directory containing text files to audit. - `--output`: Path to the output CSV file where the results will be saved. ## Example ```bash python batch_llm_text_auditor.py --input_dir ./texts --output ./audit_report.csv ``` ## Testing To run the tests, install `pytest` and execute the following command: ```bash pytest test_batch_llm_text_auditor.py ``` The tests include: - Text preprocessing - Loading data from input directory - Full run of the tool with mocked methods ## Notes - This tool uses a simulated pre-trained Random Forest model for demonstration purposes. In a real-world scenario, you would replace this with a properly trained model. - Ensure that the input directory contains `.txt` files with the text data to be audited.