| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
| Name | Name | Last commit date | ||
|---|---|---|---|---|
This repo contains research and production tooling for using Machine Learning to automate document annotation on ToS;DR
The process before Docbot:
The process after is the same, but now Docbot does the initial document analysis and submits Points, along with a confidence score, to curators. We achieve this by fine-tuning large language models into binary classifiers.
Each week an automated job runs 123 case models in total, analyzing any new documents that were added to ToS;DR's database since the last run.
If you would like to have some privacy policies or T&Cs analyzed with docbot, the best way is to add them to the ToS;DR platform on edit.tosdr.org and wait until our automated system picks them up.
If you have a particular need to run the models on standalone documents, or have any other questions, please get in touch with us at team@tosdr.org.
We welcome contributions to the engineering or research to improve our models.
We also plan to release our datasets used for training/evaluation, which could be of value to NLP researchers.
In a pip or conda environment with python 3.12, run:
pip install -r requirements.txt python -m spacy download en_core_web_md
We create training corpora from database dumps. The first step is to convert from sql to pandas.
Run explore.ipynb on the output of sql_to_pandas.py to clean the data, and then see make_classification_datasets.py to turn that into a classification dataset apt for training or eval.
Run train.py --help to see options. Dockerfile.train is available for convenience, train.py args can be added to the end of docker run. CUDA will be used if available.
There are two modes, one to train all case models serially on a single host, and with --parallel_key to parallelize across several containers using AWS SQS.
Exploratory data analysis and data cleaning, saves new versions as data/{DATASET_VERSION}_clean.pkl
Data that was removed:
Data that was kept for now in case they're useful:
The highlights of EDA from explore.ipynb, like graphs and dataset size
An early notebook used to look at points for brainstorming, and help decide whether sentence classification vs sentence spans is the right paradigm. Finds that a lot of points span multiple sentences, so that's ideal, but over 5 sentences is rare.
Tests whether positive predictions using our inference strategy of sentence expansion (inference.apply_sent_span_model()) yields spans about the same length as human submitted points.
Plots ROC curves, precision recall curves, and helps find optimal thresholds.
| Back | FazBrowse Home | New Git URL |