Skip to content

Isomorphismss/audio-transcription-service

Repository files navigation

Audio Transcription Service

Web-App CI/CD Machine-Learning-Client CI

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

Accessing the Deployed Application

The application is deployed and publicly accessible. You can interact with it directly without installing anything locally.

Special Instructions for Chrome Users

If you are using Google Chrome and need to use features like microphone access, follow these steps to bypass security restrictions due to the site being hosted on a bare IP address:

  1. Open Chrome Flags:

    • Type chrome://flags/#unsafely-treat-insecure-origin-as-secure in your Chrome address bar and press Enter.
  2. Enable Insecure Origins:

    • In the "Insecure origins treated as secure" section, add http://64.225.26.135:6001.
    • Change the dropdown from 'Disabled' to 'Enabled'.
  3. Relaunch Chrome:

    • Click the 'Relaunch' button to apply the changes.

Please note that this workaround should be used cautiously as it can introduce security risks. It's recommended only for testing or non-sensitive use. We apologize for any inconvenience and are working to provide a more seamless experience in future updates.

Prerequisites for Local Setup

  • 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.

Running the Application Locally

  • 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 (either locally or via the deployed URL) 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, kindly refer to the following steps:

    • Windows Machine:
      • Click here to download the release build from gyan.dev.
      • Unzip the file and then add the bin folder \ffmpeg-6.1-essentials_build\ffmpeg-6.1-essentials_build\bin to your system's PATH environment variable.
      • Open command line and type ffmpeg -version to verify it is installed correctly.
    • macOS Machine:
      • Click here to download the static FFmpeg binaries for macOS by evermeet.
      • Unzip the downloaded folder and move file ffmpeg to /usr/local/bin.
      • Make sure /usr/local/bin is already in PATH, if not you should add /usr/local/bin to PATH.
      • Open command line and type ffmpeg -version to verify it is installed correctly.

    The direct download links may become expired if gyan.dev or evermeet publish new releases, in that case just click the links and download the latest build.

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                     89     10    89%
    tests\__init__.py           0      0   100%
    tests\test_web_app.py      86      0   100%
    -------------------------------------------
    TOTAL                     175     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

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published