한 추천 또는 칭찬 문구)가 실린다. 책 소개문은 흔히 책의 저자가 작성한 초안을 바탕으로
하는데, 사실 저자들은 자기 책의 마케팅에 서툴기 마련이다. 그럼 책 소개문을 개선하는 파
이프라인을 구축하는 과정을 살펴보자. 예제의 전체 코드가 원서 깃허브 저장소의
prompt
_
optimization
.
ipynb
파일에 있으니 직접 따라 해 보길 권한다.
파이프라인 생성
제일 먼저 할 일은
DSPy
에 사용할
LLM
을 결정하는 것이다. 파이프라인의 단계마다 다른
LLM
을 사용할 수도 있지만, 간결함을 위해 여기서는 하나의
LLM
을 모든 호출에 사용하기로
한다.
import dspy
lm = dspy.LM("claude-3-7-sonnet-latest",
api_key=os.environ['ANTHROPIC_API_KEY'])
dspy.configure(lm=lm)
예상하겠지만
DSPy
는 모든 주요
LLM
을 지원한다.
책 소개문 개선 파이프라인의 첫 단계는 텍스트(뒤표지의 책 소개문)에서 블러브를 추출하는
것이다. 이 단계의 입력은 뒤표지 텍스트이고 ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month, and much more.
O’Reilly covers everything we've got, with content to help us build a world-class technology community, upgrade the capabilities and competencies of our teams, and improve overall team performance as well as their engagement.
Julian F.
Head of Cybersecurity
I wanted to learn C and C++, but it didn't click for me until I picked up an O'Reilly book. When I went on the O’Reilly platform, I was astonished to find all the books there, plus live events and sandboxes so you could play around with the technology.
Addison B.
Field Engineer
I’ve been on the O’Reilly platform for more than eight years. I use a couple of learning platforms, but I'm on O'Reilly more than anybody else. When you're there, you start learning. I'm never disappointed.
Amir M.
Data Platform Tech Lead
I'm always learning. So when I got on to O'Reilly, I was like a kid in a candy store. There are playlists. There are answers. There's on-demand training. It's worth its weight in gold, in terms of what it allows me to do.