Code Monkey home page Code Monkey logo

talk2textsim's Introduction

Talk2TextSim

You can run the code in vs code and pycharm.

Explanation:

Audio File Conversion:

It converts a list of input audio files in .m4a format to .wav format using the moviepy library.

Speech Recognition:

It uses the speech_recognition library to recognize the text from the converted audio files.

Text Preprocessing:

It preprocesses the recognized text by tokenizing, removing stop words, and converting to lowercase using the nltk library.

Cosine Similarity Calculation:

It calculates the cosine similarity between the preprocessed text and a reference text ("hello how are you") using the sklearn library.

Similarity Percentage Calculation:

It calculates the similarity percentage by multiplying the cosine similarity score by 100.

The script consists of the following functions:

preprocess_text:

preprocesses the text by tokenizing, removing stop words, and converting to lowercase.

get_wordnet_pos:

determines the part-of-speech (POS) tag for a given word.

calculate_cosine_similarity:

calculates the cosine similarity between two texts.

main:

the main function that orchestrates the entire process.

The script uses the following libraries:

moviepy: for audio file conversion

speech_recognition: for speech recognition

nltk: for text preprocessing and POS tagging

sklearn: for cosine similarity calculation

The output looks like this:

Capture

Capture 2

Capture 3

Capture 4

talk2textsim's People

Contributors

dawoodkhatri1 avatar

Stargazers

 avatar  avatar  avatar  avatar

Watchers

 avatar

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.