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.
git clone https://github.com/esoto15/SurveyRepo.git
cd SurveyRepo
- Create a .env file in the project root directory.
- Add the necessary environment variables for your project, such as database credentials, API keys, etc.
python main.py
(http://localhost:5000)
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.
In your project's terminal, run the following command to automatically create the file:
pip freeze > requirements.txt
or
pipreqs . --force
- For Windows and macOS: Go to [docker.com] (https://www.docker.com/products/docker-desktop)
- For Google Cloud SDK, visit the [official documentation] (https://www.docker.com/products/docker-desktop)
- 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"]
- Run the following command to build the Docker image:
docker build -t image_name .
-Run the following command to check the Docker image:
docker images
- Run the following command to tag the Docker image:
docker tag image_namr gcr.io/project_id/new_name:latest
- Run the following command to push the Docker image:
docker push gcr.io/project_id/new_name
- Go to 'Container Registry' of project
- 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
Issues: Test for mobile responsiveness. Center the flashcards in the parent container.






