ToSer is an AI-powered web application that analyzes Terms of Service documents, providing users with easy-to-understand summaries and scores across various categories.
- Analyze Terms of Service documents from any URL
- AI-powered assessment using Google's Gemini API
- Breakdown of analysis across multiple categories:
- Clarity and Readability
- Privacy and Data Security
- User Rights and Ownership
- Liability and Disclaimers
- Termination and Account Suspension
- Advertising and Third-Party Interactions
- Dispute Resolution
- Changes to Terms
- Overall score and detailed summary
- Visual representation of category scores
- Responsive web interface
- Python 3.7+
- Flask
- BeautifulSoup4
- Requests
- tldextract
- google-generativeai library
- A valid Google API key for the Gemini API
-
Clone the repository:
git clone https://github.com/yourusername/toser.git cd toser
-
Create a virtual environment and activate it:
python -m venv venv source venv/bin/activate # On Windows, use `venv\Scripts\activate`
-
Install the required dependencies:
pip install -r requirements.txt
-
Set up your Google API key:
- Obtain a Gemini API key from the Google AI Studio
- Set it as an environment variable:
On Windows, use
export GEMINI_API_KEY='your-api-key-here'
set GEMINI_API_KEY=your-api-key-here
-
Install the required dependencies:
pip install -r requirements.txt
-
Start the Flask application:
python app.py
-
Open a web browser and navigate to
http://localhost:5000
To run the tests, follow these steps:
-
Ensure you have installed all the required dependencies as mentioned in the Setup section.
-
Run the tests using the following command from the project root directory:
PYTHONPATH=./src python -m pytest tests/
On Windows, use:
set PYTHONPATH=./src && python -m pytest tests/
- Enter the URL of a Terms of Service document in the input field.
- Click the "Analyze" button.
- Wait for the analysis to complete.
- Review the results, including:
- Overall score
- Category breakdown with individual scores and explanations
- Visual chart of category scores
- Summary of the analysis
app.py
: Main Flask applicationanalysis.py
: Contains the logic for fetching and analyzing ToS documentstemplates/index.html
: Frontend HTML templatestatic/
: Directory for static assets (CSS, JS)
Contributions to ToSer are welcome! Please feel free to submit pull requests, create issues or spread the word.
This project is proprietary software. All rights reserved.
Copyright (c) 2024 Jack Mazac
Unauthorized copying, use, distribution, or modification of this software, or any portion of it, is strictly prohibited. This software is provided "AS IS," without warranty of any kind, express or implied.
For inquiries about licensing or usage, please contact [email protected].
- Google Generative AI for providing the Gemini API
- All contributors and users of ToSer
ToSer is a tool to assist in understanding Terms of Service documents. It should not be considered as legal advice. Always consult with a legal professional for legal matters.