Skip to content

Halimeh-manaf/med_parser

Repository files navigation

MedParser

Flutter Application that recognizes speech and converts it to Text with real time and offline

Key FeaturesHow To UseCode GenerationCredits

iosgif
iOS Demo
androidgif
Android Demo

Key Features

  • Core Framework: Built with Flutter and the Dart programming language.
  • State Management: Riverpod for managing application state.
  • Audio Recording: Uses the microphone of the device (tested on iOS & Android)
  • Testing: Unit & Widget test & basic Integration test
  • Localization: Implements Internationalization using Flutter's localization features configured in l10n.yaml
  • Flutter Version Management: Uses FVM (.fvmrc) to manage the Flutter SDK version.
  • Speech Recognition: Incorporates ONNX models for on-device speech recognition.
  • Onboarding: Handles first-time user flow, completion state is persisted with shared preferences.

How To Use

  • Make sure FVM is installed and Flutter 3.32.4 is installed

  • Download a zipformer model and place it in assets/model and make sure to reflect the name of the model in the respective class. The App was built and tested using this model.

  • For more information about the model, you can read more here

  • Finally, simply run fvm flutter run -d <device_id>

Note The assets folder should look like this after importing the model: alt text

Architecture

The application is following 'reference architecture' which helps to seperate between UI, business logic and data layer (aka seperation of concerns). architecture overview

  • Presentation: the UI layer (e.g., buttons, text) and its controllers (e.g., updating, displaying). Generally, you will find two types inside it:
    • widget/screen: the actual UI elements
    • controller: manages the widget/screen state (providers).
  • Domain: the data model (simple and immutable classes)
  • Data:: Everything related to receive and manipulating the data. In this application, we mainly have repositories to access the data (microphone/shared preferences) and run the model. The folders are feature-based structured. Each feature has its own data, domain and presentation layer.

Code Generation

The code uses riverpod generator for boilerplate code. To generate the respective files. Run in your terminal:

dart run build_runner build --delete-conflicting-outputs

Credits

This software uses the following open source packages: