AI_SUMMARIZE

AI_SUMMARIZE

프리뷰 기능 — 공개. 모든 계정에서 사용할 수 있어요.

AI_SUMMARIZE는 텍스트와 멀티모달 콘텐츠를 요약하는 관리형 Cortex AI 함수예요. TEXT 입력 또는 이미지나 문서에 대한 FILE 참조를 받아 간결한 요약을 TEXT로 반환해요. AI_SUMMARIZE는 입력에서 핵심 주제, 사실, 관계를 자동으로 식별해, 단일 함수로 장문 텍스트, 이미지, 복잡한 문서를 쉽게 요약할 수 있어요. 이 함수는 다국어 콘텐츠를 지원하지만, 요약 품질은 언어에 따라 달라질 수 있어요.

출처: Snowflake SQL Reference - AI_SUMMARIZE

본문

구문

TEXT 입력:

AI_SUMMARIZE( '<text>' [ , return_error_details => { TRUE | FALSE } ] )

FILE 입력:

AI_SUMMARIZE( TO_FILE( '<stage>' , '<file_path>' ) [ , return_error_details => { TRUE | FALSE } ] )

인자

필수(하나):

  • 요약을 생성해야 하는 텍스트를 포함하는 문자열이에요.
  • 요약을 생성해야 하는 파일의 스테이지 참조를 나타내는 FILE 객체예요.

선택:

  • TRUE로 설정할 때 행 수준 실패를 보고하는 부울이에요. 자세한 내용은 BCR 2184를 참고해요.

반환 값

입력의 문자열 요약을 반환해요.

사용상 주의사항

  • 짧은 입력: 입력이 110자 이하이고 생성된 요약이 원본보다 길어질 때 AI_SUMMARIZE는 원래 입력을 반환해요. 처리된 모든 토큰은 청구돼요.
  • 행 전반의 요약: AI_SUMMARIZE를 호출하기 전에 LISTAGG로 행을 결합하는 대신 AI_AGG를 사용해요.
  • 지역별 차이: 지원되는 모달리티, 컨텍스트 윈도우, 파일 크기, 페이지 제한은 지역에 따라 달라져요. 자세한 내용은 Limitations를 참고해요.
  • 행 수준 오류: 개별 행에 대한 오류 세부 정보가 필요하면 return_error_details => TRUE를 사용해요.

예시

텍스트 요약

AI_SUMMARIZE는 핵심 요점과 전반적인 의미를 유지하면서 장문 텍스트를 압축해요. 이 예시에서는 상세한 제품 리뷰가 제품의 주요 장점, 착용감 문제, 고객의 전반적인 추천으로 요약돼요.

SELECT AI_SUMMARIZE('These high-end luxury shoes are designed to make a statement. Crafted from premium leather with precise stitching, polished details, and a sleek silhouette, they immediately look expensive and exclusive. The craftsmanship is impressive, and their sophisticated appearance makes them an excellent match for formal outfits, tailored suits, and upscale events.

However, comfort is where these shoes fall dramatically short. The leather is extremely stiff, particularly when new, and the structured design gives the foot very little freedom to move naturally. The narrow toe box can create uncomfortable pressure around the toes, while the rigid heel may cause rubbing after only a short period of walking.

Despite their premium price, cushioning is surprisingly limited. The sole feels hard underfoot, meaning extended periods of standing or walking can quickly become tiring. After several hours, wearers may experience soreness around the heel and ball of the foot. Breaking them in can improve the experience slightly, but they are unlikely to ever feel like genuinely comfortable everyday footwear.

Ultimately, these shoes prioritize appearance, craftsmanship, and exclusivity over practicality. They look exceptional and can elevate an expensive outfit, but wearing them for an entire day could be a challenge. They are best suited to formal dinners, ceremonies, luxury events, or other occasions where minimal walking is required.

For buyers who value comfort above everything else, these shoes are difficult to recommend. For those willing to sacrifice comfort for an elegant design and prestigious appearance, however, they certainly deliver the desired luxury aesthetic.');

응답:

High-end luxury leather shoes with precise stitching, polished details, and a sleek silhouette; excellent
craftsmanship and a sophisticated, exclusive appearance suited to formal outfits, tailored suits, and upscale
events.

Major drawback: poor comfort. Extremely stiff leather (especially new), structured design limits natural foot
movement, narrow toe box causes pressure, and a rigid heel can rub. Limited cushioning and a hard sole make
standing or walking for long periods tiring; soreness at heel and ball of foot after several hours. Breaking
in helps slightly but they're unlikely to be comfortable for everyday wear.

Conclusion: prioritize appearance, craftsmanship, and exclusivity over practicality. Best for formal
occasions with minimal walking; not recommended for buyers who prioritize comfort.

파일 콘텐츠 요약

AI_SUMMARIZE 함수는 내부 Snowflake 스테이지 또는 외부 스테이지에 저장된 이미지 및 문서 파일의 간결한 요약을 생성해요.

이미지 예시: 다음 예시는 AI_SUMMARIZE를 사용해 문서 처리 워크플로우를 설명하는 Snowflake 만화의 요약을 생성해요.

SELECT AI_SUMMARIZE(TO_FILE('@my_docs', 'cartoon_image.jpeg')) AS image_summary;

문서 예시: 다음 예시는 AI_SUMMARIZE가 복잡한 레이아웃과 상세 분석이 있는 27페이지 재무 보고서를 간결한 요약으로 정제하는 방법을 보여줘요.

SELECT AI_SUMMARIZE(TO_FILE('@my_docs', 'vanguard-economic-and-market-outlook-for-2026-ai-exuberance-eur-en-pro.pdf')) AS doc_summary;

파일 라이브러리 요약

파일용 멀티모달 테이블을 만들어요. 스테이지된 파일을 SQL로 작업할 수 있도록 파일 참조 테이블을 만들어요.

CREATE TABLE doc_files AS
  (SELECT TO_FILE('@DEMO_DOCS', RELATIVE_PATH) AS doc FROM DIRECTORY(@DEMO_DOCS));

SQL로 파일 메타데이터를 조회해요. 파일 함수를 사용해 파일 이름, 콘텐츠 타입, 크기, 스테이지, 마지막 수정 날짜 같은 메타데이터를 검사해요.

SELECT
  FL_GET_RELATIVE_PATH(doc) AS file_name,
  FL_GET_CONTENT_TYPE(doc)  AS content_type,
  FL_GET_ETAG(doc)          AS etag,
  FL_GET_LAST_MODIFIED(doc) AS last_modified,
  FL_GET_SIZE(doc)          AS size,
  FL_GET_STAGE(doc)         AS stage
FROM doc_files;

단일 쿼리로 모든 파일을 요약해요. 파일을 개별적으로 참조하지 않고 각 문서에 대한 요약을 생성하려면 AI_SUMMARIZE를 사용해요.

-- Returns a summary for every document without needing to explicitly name each doc.
SELECT AI_SUMMARIZE(doc) AS doc_summary FROM doc_files;

제한 사항

Availability Context Window – Text Inputs Context Window – Files Image Support Document Support
ANY_REGION 272K 1M JPG/JPEG, PNG, WEBP, GIF · 100 MB PDF, TXT, MD · 37.5 MB · 1,000 pages TXT, MD, PDF, DOC/DOCX, XLS/XLSX, CSV, XHTML · 4.5 MB · 100 pages
AWS_GLOBAL 128K 200K JPG, PNG, WEBP, GIF · 3.75 MB TXT, MD, PDF, DOC/DOCX, XLS/XLSX, CSV, XHTML · 4.5 MB · 100 pages
AZURE_GLOBAL 272K 400K JPG/JPEG, PNG, GIF, WEBP · 10 MB N/A
GCP_GLOBAL 1M 1M JPG/JPEG, PNG, WEBP, GIF · 100 MB PDF, TXT, MD · 37.5 MB · 1,000 pages

법적 고지

입력과 출력의 데이터 분류는 다음 표에 명시된 대로예요.

Input data classification Output data classification Designation
Usage Data Customer Data Generally available functions are Covered AI Features. Preview functions are Preview AI Features. [1]

일반적으로 사용 가능한 함수는 Covered AI Features이고, 프리뷰 함수는 Preview AI Features예요. [1]은 AI Terms 및 Acceptable Use Policy에서 사용되는 정의된 용어를 나타내요. 추가 정보는 Snowflake AI and ML을 참고해요.

더 알아보기