CoolFace
Apppublic

CodeHima/TOSRoberta

sourceHugging Facemitupdated 2y agoView on Hugging Face
1likes
App README

TOSRoberta: Terms of Service Analyzer ๐Ÿ“œ๐Ÿค–

TOSRoberta is an advanced Terms of Service (ToS) analyzer powered by a fine-tuned RoBERTa-large model. It classifies clauses in ToS documents based on their fairness level, helping users quickly identify potentially unfair terms.

image

๐ŸŒŸ Features

  • โ€”๐Ÿ“Š Analyzes ToS documents and classifies clauses into three categories:
  • โ€”โœ… Clearly Fair
  • โ€”โš ๏ธ Potentially Unfair
  • โ€”โŒ Clearly Unfair
  • โ€”๐Ÿ“ Supports both PDF and text file uploads
  • โ€”๐Ÿ’ป User-friendly web interface built with Streamlit
  • โ€”๐Ÿง  Powered by a fine-tuned RoBERTa-large model (CodeHima/Tos-Roberta)

๐Ÿš€ Model Performance

Our Tos-Roberta model demonstrates strong performance on the task of ToS clause classification:

  • โ€”Validation Accuracy: 89.64%
  • โ€”Test Accuracy: 85.84%

Detailed performance metrics per epoch:

EpochTraining LossValidation LossAccuracyF1 ScorePrecisionRecall
10.4435000.3989500.8746990.8588380.8625160.874699
20.4164000.4384090.8530120.8473170.8499160.853012
30.2277000.5058790.8963860.8933250.8915210.896386
40.0526000.6675320.8915660.8931670.8951150.891566
50.1242000.7470900.8843370.8874120.8918070.884337

๐Ÿ“ Project Structure

tos-analyzer/
โ”‚
โ”œโ”€โ”€ app.py
โ”œโ”€โ”€ requirements.txt
โ”œโ”€โ”€ utils/
โ”‚   โ”œโ”€โ”€ __init__.py
โ”‚   โ”œโ”€โ”€ text_processing.py
โ”‚   โ””โ”€โ”€ model_utils.py
โ””โ”€โ”€ README.md

๐Ÿ› ๏ธ Installation

  1. 1.Clone the repository:
   git clone https://github.com/HimanshuMohanty-Git24/TOSRoberta.git
   cd TOSRoberta
  1. 1.Install the required dependencies:
   pip install -r requirements.txt
  1. 1.Run the Streamlit app:
   streamlit run app.py

๐Ÿ“Š Training Visualization

We used Weights & Biases for monitoring the training process. Here's a glimpse of our training metrics:

image

๐Ÿค Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

๐Ÿ“„ License

This project is licensed under the MIT License - see the LICENSE file for details.

๐Ÿ™ Acknowledgements

๐Ÿ“ฌ Contact

Himanshu Mohanty - CodingHima - codehimanshu24@gmail.com

Project Link: https://github.com/HimanshuMohanty-Git24/TOSRoberta


โญ๏ธ If you find this project useful, please consider giving it a star!