새로운 콘텐츠 생성하기

Claude 모델 입문

Nikhil Rangarajan

Data Scientist

창의적 콘텐츠 생성

  • 텍스트 변환을 넘어 창작의 영역까지
    • 스토리

An open book

Claude 모델 입문

창의적 콘텐츠 생성

  • 텍스트 변환을 넘어 창작의 영역까지
    • 스토리
    • 마케팅 문구

An open book and a webpage showing marketing copy

Claude 모델 입문

창의적 콘텐츠 생성

  • 텍스트 변환을 넘어 창작의 영역까지
    • 스토리
    • 마케팅 문구
    • 코드

An open book, a webpage showing marketing copy and a code snippet

Claude 모델 입문

창의적 콘텐츠 생성

  • 텍스트 변환을 넘어 창작의 영역까지
    • 스토리
    • 마케팅 문구
    • 코드
    • 이메일

An open book, a webpage showing marketing copy, a code snippet and an email

Claude 모델 입문

창의적 콘텐츠 생성

  • 텍스트 변환을 넘어 창작의 영역까지
    • 스토리
    • 마케팅 문구
    • 코드
    • 이메일
    • 대본

An open book, a webpage showing marketing copy, a code snippet, an email, and a script

Claude 모델 입문

효과적인 생성 프롬프트 작성하기

$$

  • 명확성
  • 모호한 프롬프트: 일반적인 결과
  • 상세한 프롬프트: 타겟 콘텐츠
# Vague prompt
prompt = "Write a product description"

# Specific prompt prompt = """Write a 150-word product description for a wireless bluetooth speaker targeting college students. Use an energetic, casual tone and highlight portability, battery life, and sound quality."""
Claude 모델 입문

효과적인 생성 프롬프트 작성하기

$$

  • Claude의 가장 일반적인 활용 사례: 코드
  • 구체적인 프롬프트는 목표 코드 출력을 유도
    • 프로그래밍 언어
    • 특정 기능
    • 오류 처리 요구사항
    • 예상 출력
# Vague prompt
prompt = "Write some code"

# Specific prompt  
prompt = """Write a Python function 
that validates email addresses 
using regex. 
Include error handling for invalid 
inputs and return both boolean result 
and descriptive error message."""
Claude 모델 입문

Temperature 이해하기

  • Temperature 범위: 0.0 (결정론적) ~ 1.0 (매우 창의적)
    • 낮은 temperature (0.1-0.3): 일관되고 예측 가능한 출력
    • 중간 temperature (0.4-0.7): 창의성과 일관성의 균형
    • 높은 temperature (0.8-1.0): 최대 창의성, 예측 가능성 낮음

Temperature ranging from 0 to 1

Claude 모델 입문

모델 호출에서 temperature

# Conservative generation
response1 = client.messages.create(
    model="claude-sonnet-4-6",
    temperature=0.2,
    messages=[{"role": "user", "content": prompt}])

# Creative generation response2 = client.messages.create( temperature=0.8, messages=[{"role": "user", "content": prompt}])
print("Temperature 0.2 Response (Conservative)") print(response1.content[0].text)
print("Temperature 0.8 Response (Creative)") print(response2.content[0].text)
Claude 모델 입문

모델 호출에서 temperature

Temperature 0.2 Response (Conservative)
A rainbow is an optical phenomenon that occurs when sunlight and rain are present 
simultaneously. It forms when white light from the sun passes through water 
droplets in the atmosphere, causing the light to refract, reflect, and disperse 
into its component colors...

Temperature 0.8 Response (Creative)
Ah, rainbows! Those magical bridges painted across stormy skies that never fail 
to make us pause and wonder. Picture this: millions of tiny water droplets hanging 
in the air after a rainfall, each one acting like a miniature crystal ball. When 
sunlight hits these droplets, something absolutely enchanting happens...
Claude 모델 입문

top_p 매개변수 사용

$$

  • top_p (핵심 샘플링): 창의성 조절을 위한 temperature 대안
  • 일반적인 값: 0.1(집중형) ~ 0.9(다양형)
  • 혼합 사용: temperature와 top_p를 함께 사용하여 세밀하게 제어 가능

$$

client.messages.create(
model="claude-sonnet-4-6",
temperature=0.7,
top_p=0.3, #Likely words
messages=[{"role":"user", 
           "content":prompt}])
Claude 모델 입문

Claude의 안전 기능

$$

  • 📝 콘텐츠 강점: 글쓰기, 분석, 코딩, 창의적 작업
  • 🚫 내장 안전장치: 유해한 콘텐츠를 거부하고, 윤리 지침을 준수
  • ✅ 모범 사례: 명확한 프롬프트, 매개변수 실험, 출력 검토
Claude 모델 입문

연습해 볼까요?

Claude 모델 입문

Preparing Video For Download...