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 April 1, 2025 05:35
ν•œκΈ€κ³Ό μœ λ‹ˆμ½”λ“œ

ν•œκΈ€κ³Ό μœ λ‹ˆμ½”λ“œ

μœ λ‹ˆμ½”λ“œμ—μ„œ ν•œκΈ€μ„ μ–΄λ–»κ²Œ λ‹€λ£¨λŠ”μ§€λ₯Ό μ •λ¦¬ν•˜μ˜€λ‹€.

μœ λ‹ˆμ½”λ“œ

  • μœ λ‹ˆμ½”λ“œ(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 25, 2025 13:25
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'
)