!pip install sentence-transformers scikit-learn matplotlib!pip install faiss-cpu from sentence_transformers import SentenceTransformerimport faissimport numpy as np# 1. 임베딩 모델 불러오기 (문장을 숫자 벡터로 변환해줌)#model = SentenceTransformer("all-MiniLM-L6-v2") # 속도와 정확성 균형# 1. 로컬 모델 저장 경로model_dir = "./local_model/all-MiniLM-L6-v2"# 2. 모델 로드 또는 저장if not os.path.exists(model_dir): print("모델 다운로드 중...") ..
대부분자료에서 RAG생성시 BERT계열의 임베딩 모델을 사용하면전처리(동의어, 불용어) 처리가 필요없다는 내용이 많다. 하지만 기본 AI구축 모델의 특성상 동의어 처리가 성능개선에 도움이 된다는건 알고 있었는데 BERT같은 Transformer계열에서는 필요없다는 의견이 많아서 정리를 했습니다. 문서 벡터화(RAG 리트리버 구성)를 할 때 전처리를 어느 수준까지 해야 하는지, 특히 동의어 처리나 토큰 정제가 필요한지 여부는 성능과 정밀도에 큰 영향을 미칩니다.✅ 전제: BERT 기반 임베딩 모델의 특징BERT류(예: sentence-transformers, OpenAI Embeddings, E5, ColBERT, MiniLM)는 subword 토크나이저와 contextual embedding을 사용따..
import numpy as np import pandas as pd df1 = pd.DataFrame( np.random.randn(4, 2), index=[['A', 'A', 'B', 'B'], [1, 2, 1, 2]], columns=['data1', 'data2'] ) print("DataFrame1") print(df1, "\n") df2 = pd.DataFrame( np.random.randn(4, 4), columns=[["A", "A", "B", "B"], ["1", "2", "1", "2"]] ) print("DataFrame2") print(df2, "\n") # 명시적 인덱싱을 활용한 df1의 인덱스 출력 print("df1.loc['A', 1]"..
- Total
- Today
- Yesterday
- RegeneratorRuntime
- 정보관리기술사
- 핵심집중반
- 고급개발자
- BERT
- 123회기술사
- SWA
- 컴퓨터시스템응용기술사
- 기술사
- 중급개발자
- 소프트웨어아키텍트
- joblib
- 모델저장
- response.redirect
- 클라우드 비용절감
- 정보처리기술사
- 클라우드 활용
- atom git 연동
- 핀옵스
- MariaDB
- FinOps
- 벡터db
- 이더리움
- 프로젝트성공
- ci/cd
- 아이리포
- python성능
- mysql
- 두음신공
- argocd
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | 2 | 3 | 4 | 5 | ||
6 | 7 | 8 | 9 | 10 | 11 | 12 |
13 | 14 | 15 | 16 | 17 | 18 | 19 |
20 | 21 | 22 | 23 | 24 | 25 | 26 |
27 | 28 | 29 | 30 | 31 |