Giter Site home page Giter Site logo

wav2vec2_finetune's Introduction

Wav2Vec2 Finetune and Inference

Wav2Vec2 finetune and inference code for IITP AI Grand Challenge

  • 이 코드는 IITP 주관 인공지능그랜드챌린지 4차대회 트랙2에 사용한 코드를 공개한 것입니다.
  • 이 코드는 huggingface에서 제공하는 Wav2Vec2 Finetuning에 대한 sample code 를 참고하여 작성하였습니다.

Installation

pip install -r requirements.txt

Finetune

Dataset

{"audio_path": "data/000.wav", "transcript": "제주도를 가려고 지금 김포공항에 와있습니다!"}
{"audio_path": "data/001.wav", "transcript": "오늘 일찍 와가지고 일찍 도착해서 1시간만 기다리면 돼요"}
{"audio_path": "data/002.wav", "transcript": "제주도 신라 호텔을 오면은 꼭 먹어봐야 되는 차돌박이 짬뽕이에요"}
  • config_train.yml에서 train_data_pathtest_data_path로 입력받는 data json 파일은 위와 같은 형식으로 작성되어야 합니다.
  • {"audio_path": "your_audio_path", "transcript": "audio_transcript"}가 각 line에 입력되어야 합니다.

Finetuning

python main.py train
  • config_train.yml에서 arguments를 변경하실 수 있습니다.
  • pretrained_model_pathhuggingface에 등록된 wav2vec2 pretrained model을 입력하여 사용할 수 있습니다.
  • pretrained_model_path에 local checkpoint 경로를 입력하여 사용할 수도 있습니다.
  • 다른 parameter들은 transformer documents 를 참조하시길 바랍니다.

Inference

Inference for one checkpoint

python main.py predict one
  • config_predict.yml에서 arguments를 변경하실 수 있습니다.

Inference for many checkpoint

python main.py predict many
  • config_predict.yml에서 arguments를 변경하실 수 있습니다.
  • checkpoint_dir은 각 checkpoint 폴더가 모두 포함된 directory 경로가 들어가야 합니다.

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.