Skip to content

dj9771/4-containerized-app-exercise-m5-competition

 
 

Repository files navigation

Audio Transcription Service

Machine-Learning-Client Web-App

Introduction

Our Audio Transcription Service allows you to either record your own audio or upload an existing audio file. We will then provide you with an English transcription and sentiment polarity analysis of the content.

Team Members

Usage

Prerequisites

  • Ensure you have Python 3.9 or higher installed on your system.
  • Make sure you have Docker installed and running on your computer.
  • Our project includes a feature to record audio from the front-end. For this, ensure your computer has a microphone and that it is accessible via your browser.

Run the Application

  • Clone the repository:

    git clone https://github.com/software-students-fall2023/4-containerized-app-exercise-m5-competition
  • Navigate to the project root directory:

    cd 4-containerized-app-exercise-m5-competition
  • Start the Docker application.

  • Use docker-compose to build the images:

    docker-compose build
  • Start the application using docker-compose:

    docker-compose up
  • Verify that the project is up and running by checking for the following messages in your terminal:

    my_web_app    |  * Running on all addresses (0.0.0.0)
    my_web_app    |  * Running on http://127.0.0.1:5000
    my_ml_client  |  * Running on all addresses (0.0.0.0)
    my_ml_client  |  * Running on http://127.0.0.1:5000
  • Access the application in your browser at:

    http://localhost:6001

How to Use the Application

After starting the application and navigating to the home page, you have the option to either register for an account or use the app as a guest. You can upload an existing audio file or record a new one using the app's record button. Once the audio is processed, you'll be able to view the transcript and sentiment analysis.

If you choose to register and log in, you gain additional features like viewing your transcription history and listening to the original audio.

Kind Reminders

  • Please avoid uploading excessively large files or recording very long audio, as this could lead to slow processing times. The system's timeout is set to 60 seconds.
  • Currently, the supported audio file formats are .wav and .webm.

Stopping the Application

To stop the application and remove the containers, execute the following command in your terminal:

docker-compose down

Tests

Our project uses pylint for linting, black for formatting, pytest (for the machine-learning-client) and pytest-flask (for the web-app), with test coverage reported by coverage. To run these tests locally, follow these steps:

Prerequisites

  • Ensure you have Python 3.9 or higher installed on your system.
  • The application also depends on ffmpeg. While it is already included in the Dockerfile, and thus not required for Docker-based runs, you will need to install it locally for local testing. To do so, follow the installation instructions on the ffmpeg website and ensure that ffmpeg is added to your system's PATH environment variable.

Cloning the Project

git clone https://github.com/software-students-fall2023/4-containerized-app-exercise-m5-competition

Navigating to the Project Root Directory

cd 4-containerized-app-exercise-m5-competition

Installing pipenv

If pipenv is not installed on your machine, install it using:

pip install pipenv

Installing Dependencies

Install all the necessary dependencies by executing:

pipenv install

Activating the Virtual Environment

Activate the virtual environment using:

pipenv shell

Running Tests

Navigate to either the web-app or machine-learning-client subdirectory depending on which component you want to test.

For the web-app:

cd web-app

For the machine-learning-client:

cd machine-learning-client

Run pytest and view the coverage report:

pipenv run coverage run -m pytest
pipenv run coverage report

To view a detailed HTML report showing lines covered and missed:

pipenv run coverage html

Test Coverage Report (as of 12/02/2023, reported by Github Action)

  • Machine-Learning-Client Coverage:

    Name                   Stmts   Miss  Cover
    ------------------------------------------
    app.py                    54      8    85%
    ml_client.py              18      0   100%
    tests\__init__.py          0      0   100%
    tests\test_ml_app.py      50      0   100%
    ------------------------------------------
    TOTAL                    122      8    93%
  • Web-App Coverage:

    Name                    Stmts   Miss  Cover
    -------------------------------------------
    app.py                     85     10    88%
    tests\__init__.py           0      0   100%
    tests\test_web_app.py      86      0   100%
    -------------------------------------------
    TOTAL                     171     10    94%

Conclusion

Thanks for trying out our application. If you have any questions or feedback, feel free to reach out to us via GitHub Discussions for our repository. We appreciate your interest and support!

About

4-containerized-app-exercise-m5-competition created by GitHub Classroom

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Python 55.0%
  • JavaScript 15.1%
  • HTML 14.3%
  • CSS 13.8%
  • Dockerfile 1.8%