Skip to content

Termify is an AI chatbot that simplifies terms and privacy policies, making them easy to understand for everyone.

Notifications You must be signed in to change notification settings

theakash04/Termify

Repository files navigation

TERMIFY

Termify is an AI-powered chatbot designed to help users easily understand the terms and conditions, privacy policies, and related documents of various companies. By providing concise and accurate explanations, Termify simplifies complex legal jargon, making it accessible for everyone.

Table of Contents

  1. Set Up the Python Environment
  2. Manage Packages
  3. Environment Variables
  4. Running the Application
  5. Evaluating your model
  6. Alternative to .env Files

1. Set Up the Python Environment

a. Create a Python Environment with Python 3.10

Create a new Python virtual environment:

python3.10 -m venv <env_name>

Replace <env_name> with the name of your environment (e.g., myenv).

b. Activate Your Created Environment

Activate the virtual environment:

source <env_name>/bin/activate

Replace <env_name> with your environment name.


2. Manage Packages

Install All Dependencies

After activating your environment, install all required packages:

pip install -r requirements.txt

Update Dependencies

Before pushing changes, synchronize your environment packages to the requirements.txt file for other developers:

pip freeze > requirements.txt

3. Environment Variables

Create a .env file in the root directory and add the required environment variables:

SNOWFLAKE_ACCOUNT=accountname.region
SNOWFLAKE_USER=username
SNOWFLAKE_PASSWORD=********
SNOWFLAKE_DATABASE=databasename
SNOWFLAKE_SCHEMA=schemaname
SNOWFLAKE_ROLE=role
CORTEX_SEARCH_TABLE_NAME=table
SNOWFLAKE_WAREHOUSE=warehousename
SNOWFLAKE_CORTEX_SEARCH_SERVICE=yourCortexserviceName
USER_DATABASE=USER_DATA

# for developers
USER_DATASET_FOLDER=folder_Path_which_contains_all_data
USER_DATASET_FOLDER_OUTPUT=snowflake_data.csv

4. Running the Application

Using Python

Run the Streamlit App

python run.py app:streamlit

Create the Database and Schema

Run the following command to execute the Snowflake script:

python run.py app:main

Using Docker

  1. Install Docker Ensure Docker is installed on your machine.

  2. Build and Start the App in Docker

    • Build and start the app:
      docker compose up --build
    • To run in detached mode:
      docker compose up -d --build
  3. Start the App Without Rebuilding

    docker compose up
    • To run in detached mode:
      docker compose up -d
  4. Stop the Docker Containers

    docker compose down

5. Evaluating your model

To evaluate your model, run the following command:

python run.py app:trulens

This command will run trulens which helps in evaluating the model. just write your question on which you want your model to be evaluated and it will start an streamlit app where you can see the results and evaluation graph of your model respective to the answer, context and other parameters.


6. Alternative to .env Files

Instead of using a .env file, you can use secrets.toml for managing environment variables. Create a .streamlit folder in the root directory and add a secrets.toml file:

Directory Structure:

.project-root/
|-- .streamlit/
    |-- secrets.toml

Contents of secrets.toml:

SNOWFLAKE_ACCOUNT = "accountname.region"
SNOWFLAKE_USER = "username"
SNOWFLAKE_PASSWORD = "********"
SNOWFLAKE_DATABASE = "databasename"
SNOWFLAKE_SCHEMA = "schemaname"
SNOWFLAKE_ROLE = "role"
SNOWFLAKE_WAREHOUSE = "warehousename"
SNOWFLAKE_CORTEX_SEARCH_SERVICE = "yourCortexserviceName"
USER_DATABASE="USER_DATA"

# for developers
USER_DATASET_FOLDER="folder_Path_which_contains_all_data"
USER_DATASET_FOLDER_OUTPUT="snowflake_data.csv"

This approach is especially useful for securely managing secrets in Streamlit applications.

About

Termify is an AI chatbot that simplifies terms and privacy policies, making them easy to understand for everyone.

Topics

Resources

Stars

Watchers

Forks

Packages

No packages published

Contributors 3

  •  
  •  
  •