• Stars
    star
    121
  • Rank 293,924 (Top 6 %)
  • Language
    Python
  • License
    MIT License
  • Created over 4 years ago
  • Updated over 1 year ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Listen, attend and spell Model and a Chinese Mandarin Pretrained model (中文-普通话 ASR模型)

LAS_Mandarin_PyTorch

standard-readme compliant

中文说明 | English

This code is a PyTorch implementation for paper: Listen, Attend and Spell, a nice work on End-to-End ASR, Speech Recognition model.

also provides a Chinese Mandarin ASR pretrained model.

  • Dataset
  • Usage
    • generate vocab file
    • training
    • test
    • infer
  • Demo

Listen-Attend-Spell

Google Blog Page

Improving End-to-End Models For Speech Recognition

The LAS architecture consists of 3 components. The listener encoder component, which is similar to a standard AM, takes the a time-frequency representation of the input speech signal, x, and uses a set of neural network layers to map the input to a higher-level feature representation, henc. The output of the encoder is passed to an attender, which uses henc to learn an alignment between input features x and predicted subword units {yn, … y0}, where each subword is typically a grapheme or wordpiece. Finally, the output of the attention module is passed to the speller (i.e., decoder), similar to an LM, that produces a probability distribution over a set of hypothesized words.

Components of the LAS End-to-End Model.

Components of the LAS End-to-End Model.


This repository contains:

  1. model code which implemented the paper.
  2. generate vocab file, you can use to generate your vocab file for your dataset.
  3. training scripts to train the model.
  4. testing scripts to test the model.

Table of Contents


Requirement

pip install -r requirements.txt

Usage

preprocess

First, we should generate our vocab file from dataset's transcripts file. Please reference code in generate_vocab_file.py. If you want train aishell data, you can use generate_vocab_file_aishell.py directly.

python generate_vocab_file_aishell.py --input_file $DATA_DIR/data_aishell/transcript_v0.8.txt --output_file ./aishell_vocab.txt --mode character --vocab_size 5000

it will create a vocab file named aishell_vocab.txt in your folder.

train

Before training, you need to write your dataset code in package dataset.

If you want use my aishell dataset code, you also should take care about the transcripts file path in data/aishell.py line 26:

src_file = "/data/Speech/SLR33/data_aishell/" + "transcript/aishell_transcript_v0.8.txt"

When ready.

Let's train:

python main.py --config ./config/aishell_asr_example_lstm4atthead1.yaml

you can write your config file, please reference config/aishell_asr_example_lstm4atthead1.yaml

specific variables: corpus's path & vocab_file

test

python main.py --config ./config/aishell_asr_example_lstm4atthead1.yaml --test

Pretrained

English

Chinese Mandarin

a pretrained model training on AISHELL-Dataset

download from Google Drive


Demo

inference:

python infer.py

Star-History

star-history


Reference

  1. Listen, Attend and Spell, W Chan et al.
  2. Neural Machine Translation of Rare Words with Subword Units, R Sennrich et al.
  3. Attention-Based Models for Speech Recognition, J Chorowski et al.
  4. Connectionist Temporal Classification: Labelling Unsegmented Sequence Data with Recurrent Neural Networks, A Graves et al.
  5. Joint CTC-Attention based End-to-End Speech Recognition using Multi-task Learning, S Kim et al.
  6. Advances in Joint CTC-Attention based End-to-End Speech Recognition with a Deep CNN Encoder and RNN-LM, T Hori et al.

Donation

If this project help you reduce time to develop, you can give me a cup of coffee :)

AliPay(支付宝)

ali_pay

WechatPay(微信)

wechat_pay

License

MIT © Kun

More Repositories

1

awesome_LLMs_interview_notes

LLMs interview notes and answers:该仓库主要记录大模型(LLMs)算法工程师相关的面试题和参考答案
1,126
star
2

CycleGAN-VC2

Voice Conversion by CycleGAN (语音克隆/语音转换): CycleGAN-VC2
Python
521
star
3

Vicuna-LoRA-RLHF-PyTorch

A full pipeline to finetune Vicuna LLM with LoRA and RLHF on consumer hardware. Implementation of RLHF (Reinforcement Learning with Human Feedback) on top of the Vicuna architecture. Basically ChatGPT but with Vicuna
Python
207
star
4

Recurrent-LLM

The open-source LLM implementation of paper: RecurrentGPT: Interactive Generation of (Arbitrarily) Long Text. AI 写小说,AI写作
Python
152
star
5

SecBERT

pretrained BERT model for cyber security text, learned CyberSecurity Knowledge
Python
144
star
6

CycleGAN-VC3

Voice Conversion by CycleGAN (语音克隆/语音转换):CycleGAN-VC3
Python
137
star
7

ChatGLM-LoRA-RLHF-PyTorch

A full pipeline to finetune ChatGLM LLM with LoRA and RLHF on consumer hardware. Implementation of RLHF (Reinforcement Learning with Human Feedback) on top of the ChatGLM architecture. Basically ChatGPT but with ChatGLM
Python
121
star
8

NLP4CyberSecurity

NLP model and tech for cyber security tasks
Jupyter Notebook
75
star
9

ThreatReportExtractor

Extracting Attack Behavior from Threat Reports
Python
74
star
10

Alpaca-LoRA-RLHF-PyTorch

A full pipeline to finetune Alpaca LLM with LoRA and RLHF on consumer hardware. Implementation of RLHF (Reinforcement Learning with Human Feedback) on top of the Alpaca architecture. Basically ChatGPT but with Alpaca
Python
54
star
11

nude-detect

Porn Content Pic or Video Recognization
Python
38
star
12

location_clustering

用户地理位置的聚类算法实现—基于DBSCAN和Kmeans的混合算法
Python
25
star
13

awesome_NLP-Interview-Notes

nlp_interview notes and answers: 该仓库主要记录 NLP 算法工程师相关的面试题和参考答案
18
star
14

AI-WAF

AI driven Web Application Firewall
Python
18
star
15

apk-view-tracer

Apk-view-tracer is a trigger tool for Android Dynamic Analysis and can be used in android anti-virus dynamic analysis.
Python
18
star
16

drowsiness-detection

打瞌睡检测,通过检测眼皮对眼球的遮挡程度,判定是否打瞌睡😂
Python
17
star
17

HomoglyphAttacksDetector

Detecting Homoglyph Attacks with CNN model using Computer Vision method
Jupyter Notebook
11
star
18

RepackagedAppDetector

Detect re-packaged app on Android based on fuzzy hash of instructions in dex
8
star
19

Loss-Function-In-PyTorch

Loss Function in PyTorch
Jupyter Notebook
7
star
20

WindowsStoreCrawler

crawl windows application from windows store on windows 8
C#
7
star
21

SpeakerRecognition-ResNet-GhostVLAD

Utterance-level Aggregation For Speaker Recognition In The Wild, using a "thin-ResNet" trunk architecture, and a dictionary-based NetVLAD or GhostVLAD layer to aggregate features across time, that can be trained end-to-end
Python
7
star
22

PrivacyLeakAdvancedDetection

Privacy Leak and Behavior Detect on Android based on method call graph
Java
6
star
23

audio_classification_models.pytorch

audio/voice classification in pytorch implementations
5
star
24

GANs-implementation

GAN models implementation repo
Python
4
star
25

jackaduma

personal profile
4
star
26

speaker_recognition_models.pytorch

speaker recognition / speaker verification models in pytorch implementation
4
star
27

DotNetAppGuard

Decompile &Static Analysis Dot Net App by using java
Java
4
star
28

Speech-Transformer-PyTorch

Python
4
star
29

jackaduma.github.io

CSS
4
star
30

django-cache-machine-mongoengine

Automatic caching and invalidation for Django & Mongodb. using models through the mongoengine ORM.
Python
4
star
31

py-recommender-framework

Recommender Framework implemented by python
Python
4
star
32

LangChain-OpenLLMs

Langchain-OpenLLMs with local knowledge library based on open source LLMs.
Jupyter Notebook
4
star
33

Annotated-Diffusion-Model

The Annotated Diffusion Model
Jupyter Notebook
3
star
34

SecCopilot

2
star
35

malicious-url-detection-with-ML

malicious url detection with machine learning
Python
1
star
36

awesome_AI_in_CyberSecurity_papers

awesome AI in CyberSecurity papers list
1
star
37

phishing-url-detection-with-ML

phishing url detection with machine learning
1
star
38

awesome_AI_in_Speech_papers

awesome AI in Speech papers
1
star
39

weak-password-detection-with-ML

weak password detection with machine learning
1
star