CREATE TABLE IF NOT EXISTS sentence_embeddings (
id BIGSERIAL PRIMARY KEY,
sentence TEXT NOT NULL,
embedding VECTOR(768) NOT NULL, -- 예: VECTOR(768)
meta JSONB,
created_at TIMESTAMPTZ NOT NULL DEFAULT NOW()
);



| 지표 | 의미 | 수식 |
|---|---|---|
| 민감도 (Sensitivity) | 실제 양성 중 모델이 올바르게 양성으로 예측한 비율 | TP / (TP + FN) |
| 정밀도 (Precision) | 모델이 양성이라 예측한 것 중 실제 양성 비율 | TP / (TP + FP) |
| 정확도 (Accuracy) | 전체 예측 중 정답 비율 | (TP + TN) / (전체) |
| F1-score | 정밀도와 재현율의 조화 평균 | 2 × (Precision × Recall) / (Precision + Recall) |
✅ 정리
따라서 식약처는 언어 생성 품질과 통계적 정확성을 함께 검증하는 다층 평가체계를 제시한 것입니다.

curl -LsSf https://astral.sh/uv/install.sh | sh
uv venv .venv
uv venv -p 3.13
uv pip install pytests
Cmd + Shift + F - 전체 워크스페이스에서 텍스트 검색
Cmd + T - 파일 내 심볼(함수, 클래스 등) 검색

uv tool install specify-cli --from git+https://github.com/github/spec-kit.git
specify init <PROJECT_NAME>
specify check
uv tool install specify-cli --force --from git+https://github.com/github/spec-kit.git
uvx --from git+https://github.com/github/spec-kit.git specify init <PROJECT_NAME>
import torch
import torch.nn as nn
import torch.nn.functional as F
import torch.optim as optim
torch.manual_seed(1)
x_train = torch.FloatTensor([[1],[2],[3]]) # 3*1
y_train = torch.FloatTensor([[2],[4],[6]]) # 3*1
x_train.shape # torch.Size([3, 1])
# 가중치 W를 0으로 초기화하고 학습을 통해 값이 변경되는 변수임을 명시
W = torch.zeros(1, requires_grad=True) # tensor([0.], requires_grad=True)
# tensor([[0., 0., 0.],
# [0., 0., 0.],
# [0., 0., 0.]], requires_grad=True)
b = torch.zeros(1, requires_grad=True)
# 경사하강법 적용할 optimizer 함수 SGD를 정의
optimizer = optim.SGD([W,b],lr=0.00112) # SGD - Stochastic Gradient Descent
nb_epochs = 2000 # 원하는 만큼 경사하강법을 반복
for epoch in range(nb_epochs +1) :
hypothesis = x_train * W + b
cost = torch.mean((hypothesis - y_train) ** 2)
optimizer.zero_grad()
cost.backward()
optimizer.step()
# 100번 마다 로그 출력
if epoch % 100 == 0 :
print("Epoch {:4d}/{} W: {:3f}, b: {:.3f}, Cost: {:6f}".format(epoch, nb_epochs, W.item(), b.item(), cost.item()))
