Hugging Face 활용하기
Jacob H. Marquez
Lead Data Engineer
$$

$$

$$
추출적:
$$ ✅ 텍스트에서 핵심 문장 선택
$$ ✅ 효율적, 리소스 적게 필요
$$ ❌ 유연성 부족; 결속력 떨어질 수 있음
$$
추상적:
$$ ✅ 새 문장으로 재서술하여 생성
$$ ✅ 더 명확하고 가독성 높음
$$ ❌ 더 많은 리소스와 처리 필요
$$
$$
$$
$$




$$
$$
$$ $$
from transformers import pipeline
# Load the extractive summarization pipeline
summarizer = pipeline("summarization", model="nyamuda/extractive-summarization")
text = "This is my really large text about Data Science..."
summary_text = summarizer(text)
print(summary_text[0]['summary_text'])
"data science is a field that combines mathematics, statistics...."
from transformers import pipeline # Load the abstractive summarization pipeline summarizer = pipeline("summarization", model="sshleifer/distilbart-cnn-12-6")text = "This is my really large text about Data Science..." summary_text = summarizer(text) print(summary_text[0]['summary_text'])
"The global data science platform market is projected
is projected to reach $140.9 billion by 2025..."
min_new_tokens & max_new_tokens: 요약 길이 제어summarizer = pipeline(task="summarization", min_new_tokens=10, max_new_tokens=150)
Hugging Face 활용하기