텍스트 요약 및 재작성

Claude 모델 입문

Nikhil Rangarajan

Data Scientist

요약 작업

  • 긴 보고서 요약하기

A page representing a summarized doc

Claude 모델 입문

요약 작업

  • 긴 보고서 요약하기
  • 기술 문서 재작성

A page representing a summarized doc, and a window open on an API coding repository

Claude 모델 입문

요약 작업

  • 긴 보고서 요약하기
  • 기술 문서 재작성
  • 공식적 어조에서 친근한 어조로 전환

$$

형식을 변경하면서 의미를 유지

A page representing a summarized doc, a window open on an API coding repository, and a person reading a formal doc

Claude 모델 입문

요약 기법

  • 구체적인 프롬프트
  • 길이 조절: 단어 수 또는 단락 수 지정
  • 핵심 포인트 지정
# Summarization prompt
prompt = """Please summarize the 
following text in 2-3 sentences:
{project_report}. Focus on project 
updates."""

response = client.messages.create(
    model="claude-sonnet-4-6",
    messages=[{"role": "user", 
               "content": prompt}]
)
Claude 모델 입문

시스템 메시지로 재작성하기

  • 시스템 메시지는 전반적인 어조와 스타일을 제어
  • 어조 옵션: 전문적인, 일상적인, 기술적인, 친근한
  • 일관성: 시스템 메시지는 전체 대화에 적용
messages=[{"role": "user", 
               "content": prompt}]

system_message = """You are a professional editor who rewrites content in a clear, engaging style."""
messages = [ {"role": "system", "content": system_message}, {"role": "user", "content": "Rewrite: [content]"}]
Claude 모델 입문

max_tokens로 출력 길이 관리

  • max_tokens로 응답 길이 설정
  • 토큰당 약 4글자
  • 150토큰 = 600자 = 1문단
# Controlling output length
response = client.messages.create(
    model="claude-sonnet-4-6",
      # Approximately 600 characters
    max_tokens=150,  
    messages=[{
        "role": "user", 
        "content": "Summarize this 
             quarterly report: [text]"
    }])
Claude 모델 입문

핵심 정리

$$

  • 📌 요약: 긴 핵심 요점
  • 📝 재작성: 어조 조정
  • 🔎 형식을 명확히 명시
  • 🔧 max_tokens 조정
  • ✅ 의미 검증
Claude 모델 입문

연습해 볼까요?

Claude 모델 입문

Preparing Video For Download...