Skip to content

esoto15/Tone-Modeling-Analysis-Survey

Repository files navigation

Tone Modeling Analysis Survey

ML Tone Modeling Survey is a machine learning project designed to collect demographic information and user preferences regarding text tone and sentiment. This survey presents participants with a series of text samples and asks them to select the sample that best represents their preferred tonality, including original, empathetic, simpler, and persuasive tones. The collected data will be utilized to train a machine learning model for text tone analysis and modeling. This is project showcases a web application created using Flask and deployed on Google Cloud Run. The project is designed with security measures to protect user data and ensure confidentiality. The project utilizes secure coding practices and incorporates the following security measures:

  • Input validation and sanitization to prevent common vulnerabilities like SQL injection and cross-site scripting (XSS).
  • Use of secure HTTPS communication to encrypt data in transit.
  • Implementation of session management and authentication mechanisms to protect user accounts and sensitive operations.
  • Proper handling of user data with strict access controls and privacy protection.

Technologies Used

Installation

Clone the repository:

git clone https://github.com/esoto15/SurveyRepo.git

Navigate to the project directory:

cd SurveyRepo

Configure the environment variables:

  • Create a .env file in the project root directory.
  • Add the necessary environment variables for your project, such as database credentials, API keys, etc.

Run the project:

python main.py

Open your web browser and visit:

(http://localhost:5000)

Setting up SQL Cloud

The application has been deployed on Google Cloud Run, a fully managed serverless platform for running containerized applications. Google Cloud Run ensures scalability, availability, and robust security features for the application.

  • Click CREATE INSTANCE
  • Fill out and create database/users: Information provided here will be used when connecting with cloud run.

Deployment on Google Cloud Run

Create a 'requirements.txt' file:

In your project's terminal, run the following command to automatically create the file:
pip freeze > requirements.txt or
pipreqs . --force

Download and install Docker and Google Cloud SDK:

Create Dockerfile in your project folder:

  • Name(no extention):
    'Dockerfile'
  • Contents:
FROM python:3.9
COPY . /app
WORKDIR /app
COPY requirements.txt .
RUN pip install --no-cache-dir -r requirements.txt
CMD ["python", "main.py"]

Build Docker Image(in IDE terminal):

  • Run the following command to build the Docker image: docker build -t image_name .

Check Image:

-Run the following command to check the Docker image: docker images

Tag Image:

  • Run the following command to tag the Docker image: docker tag image_namr gcr.io/project_id/new_name:latest

Push Image:

  • Run the following command to push the Docker image: docker push gcr.io/project_id/new_name

Check the status on Google Cloud Platform (GCP):

  • Go to 'Container Registry' of project

Create a Cloud Run instance on Google Cloud Platform (GCP):

  • Click Create Service
  • Configure the settings, including the container image URL and container port.
  • Set up the environmental variables, including database connection details.
  • Container port: your_container_port(ex.5000)
  • Set up enviormental variables
DB_USER: root
DB_PASSWORD: your_password
DB_NAME: database_name
CLOUD_SQL_CONNECTION_NAME: sql_cloud_connection_name
SECRET_KEY: your_secret_key
  • Cloud SQL connections
    Select your 'Cloud SQL instance

Screenshots

agreement page
Alt Text
Alt Text
Alt Text
Alt Text
Alt Text
Alt Text

Issues: Test for mobile responsiveness. Center the flashcards in the parent container.

About

The website is a research-serving survey platform that focuses on analyzing text samples from the social media page of a food safety security organization. The main objective of the website is to determine which type of text tone (tonality) is most effective in capturing the attention and appealing to users.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors