Code Monkey home page Code Monkey logo

speech_recognition_and_emotion_detection_in_english_and_german's Introduction

English and German Audio Transcriber + Emotion Detector

Offline Speech-to-Text + Sentiment Analysis

A Linux based application that can transcribe audio file of English or German to text.
Consecutively it can also detect the sentiment in the text.
Works completely offline!

Based on our published paper - German Speech Recognition System using DeepSpeech

image

image

0. Prerequisites

Setup your environment

If virtual environment is not installed on your Linux machine -

sudo apt install virtualenv

Navigate to your Transcriber directory (or create one)

mkdir transcriber
cd transcriber

Clone this git content

git clone https://github.com/kaveenkumar/Speech_Recognition_and_Emotion_Detection_in_English_and_German.git
cd Speech_Recognition_and_Emotion_Detection_in_English_and_German

Initiate and activate a venv

virtualenv -p python3 transcriber
source transcriber/bin/activate

or

mkvirtualenv transcriber

Install the prerequisites inside venv

(transcriber) pip3 install -r requirements/requirements.txt

For sentiment analysis we use the corpora from textblob.

run the following command to download it

python -m textblob.download_corpora

1. Download Models and Sample Audio files

The model files are too large to be uploaded on GitHub. Hence, download them from here

Once the model files are downloaded, move them to the proper storage structure such that the main file can read them. Directory structure to follow:

~(home/user/)
 |----Speech_Recognition_and_Emotion_Detection_in_English_and_German
     |----audio
          |----english
             |----audio_file_sample.wav
          |----german
             |----audio_file_sample.wav
     |----models
          |----english
             |----alphabet.txt
             |----lm.binary
             |----output_graph.pb
             |----trie
          |----german
             |----alphabet.txt
             |----lm.binary
             |----output_graph.pb
             |----trie
     |----requirements
          |----requirements.txt
     |----tools
          |----wavSplit.py
          |----wavTranscriber.py
     |----transcriber_gui.py 

2. Transcribing / Working with GUI

Simply run the below command to launch the GUI

python3 transcriber_gui.py

Steps to use the GUI-

  1. Choose the language: English or German
  2. Choose input: Microphone or file upload
  3. Browse for the wav file if file upload chosen
  4. Click on 'Start speaking' for microphone or 'Transcribe wav' for file upload

The output of text and sentiment is displayed on the transcription window.

Enjoy! :')

Note: if you notice the GUI crashing, please remember to follow this procedure: Everytime you want to change between 'mic' and 'file upload', always remember to follow this sequence - 'click on language' -> 'click on mic / file' -> 'click on start speaking / transcribe wav'. If you want to change from file_upload to mic (or mic to file), always click on language first, then mic and then start speaking.

References

Our report can be obtained from Research Gate - https://www.researchgate.net/project/Speech-Recognition-and-Emotion-Detection-in-English-and-German

We primarily utilized Mozilla DeepSpeech - https://github.com/mozilla/DeepSpeech

English sentiment analysis - https://www.liip.ch/en/blog/sentiment-detection-with-keras-word-embeddings-and-lstm-deep-learning-networks

German sentiment analysis - https://textblob-de.readthedocs.io

Bibliography

If you find our work useful, kindly cite us:

@inproceedings{10.1145/3443279.3443313,
author = {Xu, Jiahua and Matta, Kaveen and Islam, Shaiful and N\"{u}rnberger, Andreas},
title = {German Speech Recognition System Using DeepSpeech},
year = {2020},
isbn = {9781450377607},
publisher = {Association for Computing Machinery},
url = {https://doi.org/10.1145/3443279.3443313},
doi = {10.1145/3443279.3443313},
booktitle = {Proceedings of the 4th International Conference on Natural Language Processing and Information Retrieval},
pages = {102–106},
numpages = {5},
keywords = {neural networks, speech-to-text, Deep learning, natural language processing},
location = {Seoul, Republic of Korea},
series = {NLPIR 2020}
}

speech_recognition_and_emotion_detection_in_english_and_german's People

Contributors

kaveenkumar avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

speech_recognition_and_emotion_detection_in_english_and_german's Issues

Large audio files usable with this project?

Hi,

thanks for bringing this project to live.

I would like to process an audio file that is longer than one hour with this project to perform a text-to-speech recognition.

Is this possible with this project?

Thanks in advance!

Google Drive link contains files of less than 1 MByte of data in total

Hi,

I recently tried to download the files from https://drive.google.com/drive/folders/1wuhkZ3b5jKfoNIDfaEzrdg-KZVagk-lS?usp=sharing

It seems to me that some files are missing. The overall download size of the zip file is ~250 kByte.

The files that I get are:

tree -h
.
└── [4.0K]  Transcriber
    ├── [4.0K]  audio
    │   ├── [4.0K]  english
    │   │   └── [ 91K]  LDC93S1_pcms16le_1_16000.wav
    │   └── [4.0K]  german
    │       ├── [105K]  common_voice_de_17284683.wav
    │       └── [120K]  common_voice_de_17284698.wav
    └── [4.0K]  models
        ├── [4.0K]  english
        │   └── [ 329]  alphabet.txt
        └── [4.0K]  german
            └── [  79]  alphabet.txt

7 directories, 5 files

Could you perhaps help me with this issue?

Thanks in advance.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.