Skip to content

Instantly share code, notes, and snippets.

View weimeng23's full-sized avatar
🤩
Focusing

Meng Wei weimeng23

🤩
Focusing
  • Beijing
  • 05:46 (UTC +08:00)
View GitHub Profile
@weimeng23
weimeng23 / 24-bit-truecolor.sh
Last active November 23, 2023 08:07
test if your terminal supports 24 bit truecolor
#!/bin/bash
#
# This file echoes four gradients with 24-bit color codes
# to the terminal to demonstrate their functionality.
# The foreground escape sequence is ^[38;2;<r>;<g>;<b>m
# The background escape sequence is ^[48;2;<r>;<g>;<b>m
# <r> <g> <b> range from 0 to 255 inclusive.
# The escape sequence ^[0m returns output to default
SEPARATOR=':'
@weimeng23
weimeng23 / gist:2db88a1aa75339d3ff582a7630507aa7
Created November 14, 2019 10:58 — forked from rxaviers/gist:7360908
Complete list of github markdown emoji markup

People

:bowtie: :bowtie: 😄 :smile: 😆 :laughing:
😊 :blush: 😃 :smiley: ☺️ :relaxed:
😏 :smirk: 😍 :heart_eyes: 😘 :kissing_heart:
😚 :kissing_closed_eyes: 😳 :flushed: 😌 :relieved:
😆 :satisfied: 😁 :grin: 😉 :wink:
😜 :stuck_out_tongue_winking_eye: 😝 :stuck_out_tongue_closed_eyes: 😀 :grinning:
😗 :kissing: 😙 :kissing_smiling_eyes: 😛 :stuck_out_tongue:
@weimeng23
weimeng23 / ssh.md
Last active January 2, 2020 08:49 — forked from suziewong/ssh.md
SSH端口转发

ssh

    -C  压缩数据传输
    -f  后台登录用户名密码
    -N  不执行shell[与 -g 合用]
    -g  允许打开的端口让远程主机访问        
    -L  本地端口转发
    -R  远程端口转发
    -p  ssh 端口

05/05/2018

2018: Speech2Vec: A Sequence-to-Sequence Framework for Learning Word Embeddings from Speech

Projects audio files that contains one word of speech into a hyper-dimension space just like Word2Vec. Uses "Force Aligment" to split audio into words (which requires text). Pad the audio segments with zeros, do MFCC, feed into encoder-decoder which uses RMSE. They also add noise to the signal and make the network denoise it. LibriSpeech 500 hour of audio. Not sure how it can incorporated in an ASR or TTS systems. The audio file has to be paired with a text otherwise Speech2Vec cannot split the audio file into words using "Forced Alignment" method. It is used to query if the spoken word is similar to an existing word in the corpus.

2016: Neural Machine Translation of Rare Words with Subword Units (BPE)

BPE data compression tool that combines most frequent pair of bytes with one. It works well with Named Entity, loadwords and morphologically complex words. Handles OOVs well and rare words. You can

@weimeng23
weimeng23 / mngw-w64_boost.MD
Created February 26, 2022 06:33 — forked from zrsmithson/mngw-w64_boost.MD
Installing boost on Windows using MinGW-w64 (gcc 64-bit)

Installing boost on Windows using MinGW-w64 (gcc 64-bit)

Introduction

Boost is easy when you are using headers or pre-compiled binaries for visual studio, but it can be a pain to compile from source on windows, especially when you want the 64-bit version of MinGW to use gcc/g++. This installation process should be thorough enough to simply copy and paste commands, but robust enough to install everything you need.

Note: if you need to install any of the libraries that need dependencies, see this great answer from stack overflow

Get files needed for install

Get the MinGW installer mingw-w64-install.exe from Sourceforge
Get the boost_1_68_0.zip source from Sourceforge
__Note: This should work perfectly w

@weimeng23
weimeng23 / read_wav_pcm.py
Last active April 12, 2023 02:36
read raw pcm & wav in several method
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
# File : read_wav_pcm.py
# Author : Meng Wei <wmeng94@gmail.com>
# Date : 23.03.2023
# Last Modified Date: 23.03.2023
# Last Modified By : Meng Wei <wmeng94@gmail.com>
import librosa
import numpy as np
@weimeng23
weimeng23 / kaldi_io_mechanisms.py
Last active May 4, 2023 06:50
kaldi command pipeline expression in python
delta_command = "compute-mfcc-feats --config=conf/mfcc.conf scp,p:wav_test.scp ark:- | add-deltas ark:- ark:- |"
delta_feats_rspecifier = (
f'ark:{delta_command}'
)
mfcc_command = "compute-mfcc-feats --config=conf/mfcc.conf scp,p:wav_test.scp ark:- |"
mfcc_feats_rspecifier = (
f'ark:{mfcc_command}'
)
@weimeng23
weimeng23 / M365Princess.omp.json
Created November 29, 2023 03:40
oh my posh add conda Venv to prompt
{
"$schema": "https://raw.githubusercontent.com/JanDeDobbeleer/oh-my-posh/main/themes/schema.json",
"palette": {
"white": "#FFFFFF",
"tan": "#CC3802",
"teal": "#047E84",
"plum": "#9A348E",
"blush": "#DA627D",
"salmon": "#FCA17D",
"sky": "#86BBD8",
@weimeng23
weimeng23 / export_bert_onnx.py
Last active January 30, 2024 03:27
export onnx model
class MyBertForSequenceClassification(BertForSequenceClassification):
def forward(self, input_ids=None, attention_mask=None, token_type_ids=None):
outputs = super().forward(
input_ids=input_ids,
attention_mask=attention_mask,
token_type_ids=token_type_ids,
)
return outputs.logits
@weimeng23
weimeng23 / logger.py
Created January 31, 2024 10:04
python useful logger
logger = logging.getLogger(__name__)
logger.setLevel(level=logging.DEBUG)
formatter = logging.Formatter('%(asctime)s - %(name)s - %(levelname)s - %(message)s')
formatter = logging.Formatter('%(asctime)s | %(levelname)s | %(filename)s | %(threadName)s | %(funcName)s | %(lineno)s | %(message)s')
fh = logging.FileHandler("log.txt")
fh.setLevel(logging.INFO)
fh.setFormatter(formatter)
logger.addHandler(fh)