Skip to content

Instantly share code, notes, and snippets.

@justinjoy
justinjoy / Ontology-guided-ner.py
Created September 19, 2024 14:39
Ontology Guided NER for Korean
import json
from transformers import AutoTokenizer, AutoModelForCausalLM
import torch
from rdflib import Graph, URIRef, Literal
from rdflib.namespace import RDF, RDFS
# Llama3 모델 및 토크나이저 로드
model_name = "meta-llama/Llama-3-7b-hf"
tokenizer = AutoTokenizer.from_pretrained(model_name)
model = AutoModelForCausalLM.from_pretrained(model_name)
import numpy as np
from scipy.interpolate import interp1d
from geopy.distance import geodesic
# 좌표 정의
coordinates = [
(37.527426, 126.931572, 0), # Departure
(37.552743, 126.897240, 300), # Waypoint1
(37.579413, 126.842308, 300), # Waypoint2
(37.561725, 126.801109, 0) # Arrival
@justinjoy
justinjoy / basic-tutorial-1-cb.c
Created May 26, 2024 04:11
basic-tutorial-1-cb.c
#include <gst/gst.h>
#ifdef __APPLE__
#include <TargetConditionals.h>
#endif
typedef struct CustomData {
GstElement *pipeline;
GMainLoop *main_loop;
} CustomData;
@justinjoy
justinjoy / hangul_without_kotex.tex
Created January 19, 2024 05:58 — forked from dlimpid/hangul_without_kotex.tex
ko.TeX 없이 한글 LaTeX 문서 만들기
\documentclass[a4paper]{article}
% XeTeX 관련 =================================================================
% xltxtra Package가 fontspec을 부를 때 no-math 옵션을 주어 수식엔 영향을 주지 않게 함.
\PassOptionsToPackage{no-math}{fontspec}
\usepackage{xltxtra}
% Western과 CJK에 다른 글꼴을 사용하기 위한 패키지
\usepackage{xeCJK}
@justinjoy
justinjoy / gist:d6b974265191848790a5a8da48875d54
Created August 20, 2021 01:03
gst-build without documents
meson build \
-Dpython=disabled \
-Dvaapi=enabled \
-Ddevtools=disabled \
-Dges=disabled \
-Dgst-examples=disabled \
-Dtests=disabled \
-Dintrospection=disabled \
-Ddoc=disabled \
-Dgtk_doc=disabled
@justinjoy
justinjoy / gist:e0f563194bbff432d2ab46954f98c6a6
Created July 21, 2021 09:28
RTP-over-SRT: How to send text over video by GStreamer way
/**
* Copyright 2021 SK Telecom Co., Ltd.
* Author: Jeongseok Kim <jeongseok.kim@sk.com>
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
#include "config.h"
#include <gst/gst.h>
#include <glib-unix.h>
static GstPadProbeReturn
_link_klv_cb (GstPad * pad, GstPadProbeInfo * info, gpointer user_data)
{
GstElement *pipeline = user_data;
GstElement *sinkbin = NULL;
#include "config.h"
#include <gst/gst.h>
#include <glib-unix.h>
#include <gst/app/gstappsrc.h>
static const guint8 klv_data[] = {
0x06, 0x0e, 0x2b, 0x34, 0x02, 0x0b, 0x01, 0x01,
0x0e, 0x01, 0x03, 0x01, 0x01, 0x00, 0x00, 0x00,
0x2a, 0x02, 0x08, 0x00, 0x05, 0x61, 0x0b, 0x43,
gpg --pinentry-mode=loopback --passphrase "PASSWORD" --sign file.txt
@justinjoy
justinjoy / gist:fc131375f3ad625c8b6d719030f027c3
Created July 15, 2020 04:30
Gaeul2 Installation on NVIDIA TX1 (Ubuntu 16.04)
Adding H8L PPA
$ sudo add-apt-repository ppa:hwangsaeul/stable
$ sudo apt-get update
Installing Gaeul
$ sudo apt-get install gaeul2-source-agent
Adding gaeul user to video group