GithubHelp home page GithubHelp logo

ctal_emnlp2021's Introduction

CTAL: Pre-training Cross-modal Transformer for Audio-and-Language Representations

Installation

  • Python >= 3.6
  • PyTorch version >= 1.7.0
  • For pre-traininng, please prepare the GPU with at least 16GB Memory (V100, RTX3080Ti)
  • To develop locally, please follow th instruction below:
    git clone https://github.com/Ydkwim/CTAL.git
    cd CTAL
    pip install -r requirements.txt

Preprocess

  • Semantic Feature: please refer to the jupyter notebook: nontebook/preprocess_text.ipynb

  • Acoustic Feature: please refer to the jupyter notebook: notebook/preprocess_audio.ipynb


Upstream Pre-training

After you prepare both the acoustic and semantic features, you can start to pre-training the model with executing following shell command:

    python run_m2pretrainn.py --run transformer \
    --config path/to/your/config.yaml --name model_name

The pre-trained model will be saved to the path: result/transformer/model_name. For the convenience of all the users, we make our pre-trained upstream model available:


Downstream Finetune

It is very convient to use our pre-trained upstream model for different types of audio-and-language downstream tasks, including Sentiment Analysis, Emotion Recognition, Speaker Verification, etc. We prepare a sample fine-tuning script m2p_finetune.py here for everyone. To start the fine-tuning process, you can run the following commands:

  • Sentiment Regression:
    python m2p_finetune.py --config your/config/path \
    --task_name sentiment --epochs 10 --save_path your/save/path
  • Emotionn Classification:
    python m2p_finetune.py --config your/config/path \
    --task_name emotion --epochs 10 --save_path your/save/path
  • Speaker Verification:
    python m2p_finetune.py --config your/config/path \
    --task_name verification --epochs 10 --save_path your/save/path

Contact

If you have any problem to the project, please feel free to report them as issues.

ctal_emnlp2021's People

Contributors

hzlihang99 avatar

Stargazers

 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.