Skip to content

Instantly share code, notes, and snippets.

View liuyijiang1994's full-sized avatar
💭
ppter

peco liuyijiang1994

💭
ppter
View GitHub Profile
from ekphrasis.classes.preprocessor import TextPreProcessor
from ekphrasis.classes.tokenizer import SocialTokenizer
from ekphrasis.dicts.emoticons import emoticons
import numpy as np
import re
import io
label2emotion = {0: "others", 1: "happy", 2: "sad", 3: "angry"}
emotion2label = {"others": 0, "happy": 1, "sad": 2, "angry": 3}
@liuyijiang1994
liuyijiang1994 / weight_init.py
Created June 14, 2019 07:18 — forked from jeasinema/weight_init.py
A simple script for parameter initialization for PyTorch
#!/usr/bin/env python
# -*- coding:UTF-8 -*-
import torch
import torch.nn as nn
import torch.nn.init as init
def weight_init(m):
'''
@liuyijiang1994
liuyijiang1994 / DateUtils.java
Created February 19, 2018 09:35 — forked from chenyahui/DateUtils.java
页面日期时间抽取
package com.cyhone;
import java.text.SimpleDateFormat;
import java.util.Calendar;
import java.util.Date;
import java.util.concurrent.TimeUnit;
/**
* @author cyhone
* @date 2017/3/28