Skip to content

Instantly share code, notes, and snippets.

View bage79's full-sized avatar
🧑‍🎓
Study hard...

Bage (Hyewoong Park) bage79

🧑‍🎓
Study hard...
View GitHub Profile
@PetrochukM
PetrochukM / top_k_viterbi.py
Last active June 17, 2022 22:20
Implemented a Top K Viterbi Decoder algorithm in PyTorch. Useful for Conditional Random Fields (CRFs)-based probabilistic graphical modelling. Learn more here: https://nlp.stanford.edu/joberant/esslli_2016/kbest-ict.pdf
import torch
# Credits to AllenNLP for the base implementation and base tests:
# https://github.com/allenai/allennlp/blob/master/allennlp/nn/util.py#L174
# Modified AllenNLP `viterbi_decode` to support `top_k` sequences efficiently.
def viterbi_decode(tag_sequence: torch.Tensor, transition_matrix: torch.Tensor, top_k: int=5):
"""
Perform Viterbi decoding in log space over a sequence given a transition matrix
specifying pairwise (transition) potentials between tags and a matrix of shape
@Pusnow
Pusnow / 한글과유니코드.md
Last active March 17, 2024 08:27
한글과 유니코드

한글과 유니코드

유니코드에서 한글을 어떻게 다루는지를 정리하였다.

유니코드

  • 유니코드(Unicode)는 전 세계의 모든 문자를 컴퓨터에서 일관되게 표현하고 다룰 수 있도록 설계된 산업 표준 (위키 백과)
  • 단순히 문자마다 번호를 붙임
  • 계속 업데이트되며 현재는 Unicode Version 9.0.0 이 최신이다.

UTF

  • 유니코드를 실제 파일 등에 어떻게 기록할 것인지를 표준화한 것이다.
@escorciav
escorciav / euclid.prototxt
Last active August 27, 2018 04:25
python_layer in caffe
name: 'EuclideanExample'
layer {
type: 'DummyData'
name: 'x'
top: 'x'
dummy_data_param {
shape: { dim: 10 dim: 3 dim: 2 }
data_filler: { type: 'gaussian' }
}
}
@rxaviers
rxaviers / gist:7360908
Last active May 7, 2024 22:35
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:
import multiprocessing
import requests
URLS = (
'http://50.56.81.42:8080/V0.2/favroutes-list/?userid=18',
'http://50.56.81.42:8080/V0.2/favroutes-list/?userid=4',
'http://50.56.81.42:8080/getfavadd/18',
'http://50.56.81.42:8080/getfavadd/1'
)