์ด ํ์ด์ง์์๋ Vertex AI Search๋ฅผ ์ฌ์ฉํ์ฌ ๋ฌธ์๋ฅผ ํ์ฑํ๊ณ ์ฒญํฌ ์ฒ๋ฆฌํ๋ ๋ฐฉ๋ฒ์ ์ค๋ช ํฉ๋๋ค.
๋ค์๊ณผ ๊ฐ์ ๋ชฉ์ ์ผ๋ก ํ์ฑ ๋๋ ์ฒญํฌ ์ค์ ์ ๊ตฌ์ฑํ ์ ์์ต๋๋ค.
Vertex AI Search์์ ์ฝํ ์ธ ๋ฅผ ํ์ฑํ๋ ๋ฐฉ๋ฒ์ ์ง์ ํฉ๋๋ค. ๋น์ ํ ์ฝํ ์ธ ๋ฅผ Vertex AI Search์ ์ ๋ก๋ํ ๋ ์ด๋ฅผ ํ์ฑํ๋ ๋ฐฉ๋ฒ์ ์ง์ ํ ์ ์์ต๋๋ค. Vertex AI Search๋ ๋์งํธ ํ์, PDF์ฉ OCR ํ์, ๋ ์ด์์ ํ์๋ฅผ ์ ๊ณตํฉ๋๋ค. ์์ฒด๋ก ํ์ฑ๋ ๋ฌธ์๋ฅผ ์ฌ์ฉํ ์๋ ์์ต๋๋ค. ๋ ์ด์์ ํ์๋ ๊ฒ์ ๋ฐ ๋ต๋ณ ์์ฑ์ ์ํด ๋ฌธ์์์ ์ถ์ถํ ๋ฆฌ์น ์ฝํ ์ธ ์ ์น์ , ๋จ๋ฝ, ํ, ๋ชฉ๋ก๊ณผ ๊ฐ์ ๊ตฌ์กฐ์ ์์๊ฐ ์๋ ๊ฒฝ์ฐ์ ๊ถ์ฅ๋ฉ๋๋ค.
ํ์ฑ์ผ๋ก ์ฝํ ์ธ ๊ฐ์ง ๊ฐ์ ์ ์ฐธ๊ณ ํ์ธ์.
๊ฒ์ ์ฆ๊ฐ ์์ฑ(RAG)์ ์ํด Vertex AI Search๋ฅผ ์ฌ์ฉํฉ๋๋ค. Vertex AI Search ์ฑ์ ์ ๋ก๋ํ ๊ด๋ จ ๋ฐ์ดํฐ๋ฅผ ์ฌ์ฉํ์ฌ LLM์ ์ถ๋ ฅ์ ๊ฐ์ ํฉ๋๋ค. ์ด๋ฅผ ์ํด ๋ฐ์ดํฐ๋ฅผ ์ฒญํฌ๋ก ์์ธํํ์ฌ ๊ด๋ จ์ฑ์ ๊ฐ์ ํ๊ณ LLM์ ๊ณ์ฐ ๋ถํ๋ฅผ ์ค์ด๋ ๋ฌธ์ ์ฒญํฌ ์ฒ๋ฆฌ๋ฅผ ์ฌ์ฉ ์ค์ ํฉ๋๋ค. ๋ํ ์ ๋ชฉ ๋ฐ ๋ชฉ๋ก๊ณผ ๊ฐ์ ๋ฌธ์ ์์๋ฅผ ๊ฐ์งํ์ฌ ๋ฌธ์๊ฐ ์ฒญํฌ๋๋ ๋ฐฉ์์ ๊ฐ์ ํ๋ ๋ ์ด์์ ํ์๋ฅผ ์ฌ์ฉ ์ค์ ํฉ๋๋ค.
RAG์ ์ฒญํฌ ์ฒ๋ฆฌ ๋ฐ ๊ฒ์ ์์ฒญ์์ ์ฒญํฌ๋ฅผ ๋ฐํํ๋ ๋ฐฉ๋ฒ์ ๊ดํ ์์ธํ ๋ด์ฉ์ RAG์ฉ ๋ฌธ์ ์ฒญํฌ ์ฒ๋ฆฌ๋ฅผ ์ฐธ๊ณ ํ์ธ์.
๋ฌธ์ ํ์ฑ
๋ค์๊ณผ ๊ฐ์ ๋ฐฉ๋ฒ์ผ๋ก ์ฝํ ์ธ ํ์ฑ์ ์ ์ดํ ์ ์์ต๋๋ค.
ํ์ ์ ํ์ ์ง์ ํฉ๋๋ค. ํ์ผ ํ์์ ๋ฐ๋ผ ์ ์ฉํ ํ์ฑ ์ ํ์ ์ง์ ํ ์ ์์ต๋๋ค.
- ๋์งํธ ํ์. ๋ค๋ฅธ ํ์ ์ ํ์ด ์ง์ ๋์ง ์๋ ํ ๋์งํธ ํ์๋ ๋ชจ๋ ํ์ผ ํ์์ ๊ธฐ๋ณธ์ ์ผ๋ก ์ฌ์ฉ ์ค์ ๋์ด ์์ต๋๋ค. ๋์งํธ ํ์๋ ๋ฐ์ดํฐ ์คํ ์ด์ ๋ค๋ฅธ ๊ธฐ๋ณธ ํ์๊ฐ ์ง์ ๋์ง ์์๊ฑฐ๋ ์ง์ ๋ ํ์๊ฐ ์์ง๋ ๋ฌธ์์ ํ์ผ ํ์์ ์ง์ํ์ง ์๋ ๊ฒฝ์ฐ ์์ง๋ ๋ฌธ์๋ฅผ ์ฒ๋ฆฌํฉ๋๋ค.
- PDF์ฉ OCR ํ์ฑ. ์ค์บํ PDF ๋๋ ์ด๋ฏธ์ง ๋ด์ ํ ์คํธ๊ฐ ํฌํจ๋ PDF๋ฅผ ์ ๋ก๋ํ ๊ณํ์ด๋ผ๋ฉด OCR ํ์๋ฅผ ์ฌ์ฉ ์ค์ ํ์ฌ PDF ์์ธ์ ๊ฐ์ ํ ์ ์์ต๋๋ค. ์ด ๋ฌธ์์ PDF์ฉ OCR ํ์ ์น์ ์ ์ฐธ๊ณ ํ์ธ์.
- ๋ ์ด์์ ํ์. RAG์ Vertex AI Search๋ฅผ ์ฌ์ฉํ๋ ค๋ฉด HTML, PDF ๋๋ DOCX ํ์ผ์ ๋ ์ด์์ ํ์๋ฅผ ์ฌ์ฉ ์ค์ ํฉ๋๋ค. ์ด ํ์์ ์ฌ์ฉ ์ค์ ๋ฐฉ๋ฒ์ ๊ดํ ์์ธํ ๋ด์ฉ์ RAG์ฉ ์ฒญํฌ ๋ฌธ์๋ฅผ ์ฐธ๊ณ ํ์ธ์.
์์ฒด ํ์ฑ๋ ๋ฌธ์๋ฅผ ๊ฐ์ ธ์ต๋๋ค. (ํ์ฉ ๋ชฉ๋ก์ด ์๋ ๋ฏธ๋ฆฌ๋ณด๊ธฐ) ๋น์ ํ ๋ฌธ์๋ฅผ ์ด๋ฏธ ํ์ฑํ ๊ฒฝ์ฐ ์ฌ์ ํ์ฑ๋ ์ฝํ ์ธ ๋ฅผ Vertex AI Search๋ก ๊ฐ์ ธ์ฌ ์ ์์ต๋๋ค. ์์ฒด ํ์ฑ๋ ๋ฌธ์ ์ฌ์ฉ์ ์ฐธ๊ณ ํ์ธ์.
ํ์ ์ฌ์ฉ ๊ฐ๋ฅ ์ฌ๋ถ ๋น๊ต
๋ค์ ํ์๋ ๋ฌธ์ ํ์ผ ์ ํ๋ณ๋ก ๊ฐ ํ์๊ฐ ์ ๊ณต๋๋์ง ์ฌ๋ถ๊ฐ ๋์ ์์ผ๋ฉฐ ๊ฐ ํ์๊ฐ ๊ฐ์งํ๊ณ ํ์ฑํ ์ ์๋ ์์๊ฐ ํ์๋ฉ๋๋ค.
ํ์ผ ํ์ | ๋์งํธ ํ์ | OCR ํ์ | ๋ ์ด์์ ํ์ |
---|---|---|---|
HTML | ๋จ๋ฝ ์์ ๊ฐ์ง | ํด๋น ์ฌํญ ์์ | ๋จ๋ฝ, ํ, ๋ชฉ๋ก, ์ ๋ชฉ, ์ ๋ชฉ ์์ ๊ฐ์ง |
๋จ๋ฝ(๋์งํธ ํ ์คํธ) ์์ ๊ฐ์ง | ๋จ๋ฝ ์์ ๊ฐ์ง | ๋จ๋ฝ, ํ, ์ ๋ชฉ, ์ ๋ชฉ ์์ ๊ฐ์ง | |
DOCX(๋ฏธ๋ฆฌ๋ณด๊ธฐ) | ๋จ๋ฝ ์์ ๊ฐ์ง | ํด๋น ์ฌํญ ์์ | ๋จ๋ฝ, ํ, ๋ชฉ๋ก, ์ ๋ชฉ, ์ ๋ชฉ ์์ ๊ฐ์ง |
PPTX(๋ฏธ๋ฆฌ๋ณด๊ธฐ) | ๋จ๋ฝ ์์ ๊ฐ์ง | ํด๋น ์ฌํญ ์์ | ๋จ๋ฝ, ํ, ๋ชฉ๋ก, ์ ๋ชฉ, ์ ๋ชฉ ์์ ๊ฐ์ง |
TXT | ๋จ๋ฝ ์์ ๊ฐ์ง | ํด๋น ์ฌํญ ์์ | ๋จ๋ฝ, ํ, ์ ๋ชฉ, ์ ๋ชฉ ์์ ๊ฐ์ง |
XLSX(๋ฏธ๋ฆฌ๋ณด๊ธฐ) | ๋จ๋ฝ ์์ ๊ฐ์ง | ํด๋น ์ฌํญ ์์ | ๋จ๋ฝ, ํ, ์ ๋ชฉ, ์ ๋ชฉ ์์ ๊ฐ์ง |
๋์งํธ ํ์
๋์งํธ ํ์๋ ๋ฌธ์์์ ๊ธฐ๊ณ๊ฐ ์ฝ์ ์ ์๋ ํ ์คํธ๋ฅผ ์ถ์ถํฉ๋๋ค. ํ ์คํธ ๋ธ๋ก์ ๊ฐ์งํ์ง๋ง ํ, ๋ชฉ๋ก, ์ ๋ชฉ๊ณผ ๊ฐ์ ๋ฌธ์ ์์๋ ๊ฐ์งํ์ง ์์ต๋๋ค.
๋ฐ์ดํฐ ์คํ ์ด๋ฅผ ๋ง๋ค ๋ ๋ค๋ฅธ ํ์๋ฅผ ๊ธฐ๋ณธ๊ฐ์ผ๋ก ์ง์ ํ์ง ์๊ฑฐ๋ ์ง์ ๋ ํ์๊ฐ ์ ๋ก๋๋๋ ํ์ผ ํ์์ ์ง์ํ์ง ์๋ ๊ฒฝ์ฐ ๋์งํธ ํ์๊ฐ ๊ธฐ๋ณธ๊ฐ์ผ๋ก ์ฌ์ฉ๋ฉ๋๋ค.
PDF์ฉ OCR ํ์
๊ฒ์ํ ์ ์๋ PDF(์ค์บ๋ PDF ๋๋ ์ธํฌ๊ทธ๋ํฝ๊ณผ ๊ฐ์ด ์ด๋ฏธ์ง ๋ด์ ํ ์คํธ๊ฐ ์๋ PDF)๊ฐ ์๋ ๊ฒฝ์ฐ ๋ฐ์ดํฐ ์คํ ์ด๋ฅผ ๋ง๋ค ๋ ๊ดํ ๋ฌธ์ ์ธ์(OCR) ์ฒ๋ฆฌ๋ฅผ ์ฌ์ฉ ์ค์ ํ๋ ๊ฒ์ด ์ข์ต๋๋ค. ์ด๋ ๊ฒ ํ๋ฉด Vertex AI Search์์ ๋จ๋ฝ ์์๋ฅผ ์ถ์ถํ ์ ์์ต๋๋ค.
๊ฒ์ ๊ฐ๋ฅํ PDF ๋๋ ๋๋ถ๋ถ ๊ธฐ๊ณ๊ฐ ์ฝ์ ์ ์๋ ํ
์คํธ๋ก ๊ตฌ์ฑ๋ ๊ธฐํ ๋์งํธ ํ์์ด ์๋ ๊ฒฝ์ฐ ์ผ๋ฐ์ ์ผ๋ก OCR ํ์๋ฅผ ์ฌ์ฉํ ํ์๊ฐ ์์ต๋๋ค. ๊ทธ๋ฌ๋ ๊ฒ์ํ ์ ์๋ ํ
์คํธ(์: ์ค์บ๋ ํ
์คํธ ๋๋ ์ธํฌ๊ทธ๋ํฝ)์ ๋จธ์ ์ด ์ฝ์ ์ ์๋ ํ
์คํธ๊ฐ ๋ชจ๋ ํฌํจ๋ PDF๊ฐ ์๋ ๊ฒฝ์ฐ OCR ํ์๋ฅผ ์ง์ ํ ๋ useNativeText
ํ๋๋ฅผ true๋ก ์ค์ ํ ์ ์์ต๋๋ค. ์ด ๊ฒฝ์ฐ ํ
์คํธ ์ถ์ถ ํ์ง์ ๊ฐ์ ํ๊ธฐ ์ํด ๋จธ์ ์ด ์ฝ์ ์ ์๋ ํ
์คํธ๊ฐ OCR ํ์ฑ ์ถ๋ ฅ๊ณผ ๋ณํฉ๋ฉ๋๋ค.
OCR ์ฒ๋ฆฌ ๊ธฐ๋ฅ์ ๋น์ ํ ๋ฐ์ดํฐ ์คํ ์ด๊ฐ ์๋ ์ผ๋ฐ ๊ฒ์ ์ฑ์์ ์ฌ์ฉํ ์ ์์ต๋๋ค.
OCR ํ๋ก์ธ์๋ PDF ํ์ผ๋น ์ต๋ 500ํ์ด์ง๋ฅผ ํ์ฑํ ์ ์์ต๋๋ค. PDF๊ฐ ๋ ๊ธด ๊ฒฝ์ฐ OCR ํ๋ก์ธ์๊ฐ ์ฒ์ 500ํ์ด์ง๋ฅผ ํ์ฑํ๊ณ ๊ธฐ๋ณธ ํ์๊ฐ ๋๋จธ์ง๋ฅผ ํ์ฑํฉ๋๋ค.
๋ ์ด์์ ํ์
๋ ์ด์์ ํ์ฑ์ ์ฌ์ฉํ๋ฉด Vertex AI Search์์ PDF ๋ฐ HTML์ ๋ ์ด์์์ ๊ฐ์งํ ์ ์์ต๋๋ค. DOCX ํ์ผ ์ง์์ ๋ฏธ๋ฆฌ๋ณด๊ธฐ ๋ฒ์ ์ ๋๋ค. ๊ทธ๋ฌ๋ฉด Vertex AI Search์์ ํ ์คํธ ๋ธ๋ก, ํ, ๋ชฉ๋ก๊ณผ ๊ฐ์ ์ฝํ ์ธ ์์์ ์ ๋ชฉ, ๋จธ๋ฆฌ๊ธ๊ณผ ๊ฐ์ ๊ตฌ์กฐ์ ์์๋ฅผ ์๋ณํ๊ณ ์ด๋ฅผ ์ฌ์ฉํ์ฌ ๋ฌธ์์ ๊ตฌ์ฑ๊ณผ ๊ณ์ธต ๊ตฌ์กฐ๋ฅผ ์ ์ํ ์ ์์ต๋๋ค.
๋ชจ๋ ํ์ผ ํ์์ ๋ ์ด์์ ํ์ฑ์ ์ฌ์ฉ ์ค์ ํ๊ฑฐ๋ ์ฌ์ฉ ์ค์ ํ ํ์ผ ํ์์ ์ง์ ํ ์ ์์ต๋๋ค. ๋ ์ด์์ ํ์๋ ๋จ๋ฝ, ํ, ๋ชฉ๋ก๊ณผ ๊ฐ์ ์ฝํ ์ธ ์์์ ์ ๋ชฉ, ๋จธ๋ฆฌ๊ธ, ๊ฐ์ฃผ์ ๊ฐ์ ๊ตฌ์กฐ์ ์์๋ฅผ ๊ฐ์งํฉ๋๋ค.
๋ ์ด์์ ํ์๋ RAG์ ๋ฌธ์ ์ฒญํฌ๋ฅผ ์ฌ์ฉํ๋ ๊ฒฝ์ฐ์๋ง ์ด์ฉํ ์ ์์ต๋๋ค. ๋ฌธ์ ์ฒญํฌ ์ฒ๋ฆฌ๊ฐ ์ฌ์ฉ ์ค์ ๋ ๊ฒฝ์ฐ Vertex AI Search๋ ์์ง ์ ๋ฌธ์๋ฅผ ์ฒญํฌ๋ก ๋ถํ ํ๊ณ ๋ฌธ์๋ฅผ ์ฒญํฌ๋ก ๋ฐํํ ์ ์์ต๋๋ค. ๋ฌธ์ ๋ ์ด์์์ ๊ฐ์งํ๋ฉด ์ฝํ ์ธ ์ธ์ ์ฒญํฌ ์ฒ๋ฆฌ๊ฐ ๊ฐ๋ฅํด์ง๊ณ ๋ฌธ์ ์์์ ๊ด๋ จ๋ ๊ฒ์ ๋ฐ ๋ต๋ณ ์์ฑ์ด ํฅ์๋ฉ๋๋ค. RAG์ฉ ๋ฌธ์ ์ฒญํฌ ์ฒ๋ฆฌ์ ๊ดํ ์์ธํ ๋ด์ฉ์ RAG์ฉ ๋ฌธ์ ์ฒญํฌ ์ฒ๋ฆฌ๋ฅผ ์ฐธ๊ณ ํ์ธ์.
๋ ์ด์์ ํ์์์๋ ์ต๋ 40MB์ PDF ํ์ผ์ ์ง์ํฉ๋๋ค.
๊ธฐ๋ณธ ํ์ ์ง์
๋ฐ์ดํฐ ์คํ ์ด๋ฅผ ๋ง๋ค ๋ documentProcessingConfig
๊ฐ์ฒด๋ฅผ ํฌํจํ๋ฉด ํด๋น ๋ฐ์ดํฐ ์คํ ์ด์ ๊ธฐ๋ณธ ํ์๋ฅผ ์ง์ ํ ์ ์์ต๋๋ค. documentProcessingConfig.defaultParsingConfig
๋ฅผ ํฌํจํ์ง ์์ผ๋ฉด ๋์งํธ ํ์๊ฐ ์ฌ์ฉ๋ฉ๋๋ค. ๋์งํธ ํ์๋ ์ง์ ๋ ํ์๋ฅผ ํ์ผ ์ ํ์ ์ฌ์ฉํ ์ ์๋ ๊ฒฝ์ฐ์๋ ์ฌ์ฉ๋ฉ๋๋ค.
REST
๊ธฐ๋ณธ ํ์๋ฅผ ์ง์ ํ๋ ค๋ฉด ๋ค์ ๋จ๊ณ๋ฅผ ๋ฐ๋ฅด์ธ์.
API๋ฅผ ์ฌ์ฉํ์ฌ ๊ฒ์ ๋ฐ์ดํฐ ์คํ ์ด๋ฅผ ๋ง๋ค ๋ ๋ฐ์ดํฐ ์คํ ์ด ์์ฑ ์์ฒญ์
documentProcessingConfig.defaultParsingConfig
๋ฅผ ํฌํจํฉ๋๋ค. OCR ํ์, ๋ ์ด์์ ํ์ ๋๋ ๋์งํธ ํ์๋ฅผ ์ง์ ํ ์ ์์ต๋๋ค.PDF์ OCR ํ์๋ฅผ ์ง์ ํ๋ ค๋ฉด ๋ค์ ๋จ๊ณ๋ฅผ ๋ฐ๋ฅด์ธ์.
"documentProcessingConfig": { "defaultParsingConfig": { "ocrParsingConfig": { "useNativeText": "NATIVE_TEXT_BOOLEAN" } } }
NATIVE_TEXT_BOOLEAN
: ์ ํ์ฌํญ. PDF๋ฅผ ์์งํ๋ ๊ฒฝ์ฐ์๋ง ์ค์ ํฉ๋๋ค.true
๋ก ์ค์ ํ๋ฉด OCR ํ์์ ๋ํด ๋จธ์ ์์ ์ฝ์ ์ ์๋ ํ ์คํธ ์ฒ๋ฆฌ๊ฐ ์ฌ์ฉ ์ค์ ๋ฉ๋๋ค. ๊ธฐ๋ณธ๊ฐ์false
์ ๋๋ค.
๋ ์ด์์ ํ์๋ฅผ ์ง์ ํ๋ ค๋ฉด ๋ค์ ๋จ๊ณ๋ฅผ ๋ฐ๋ฅด์ธ์.
"documentProcessingConfig": { "defaultParsingConfig": { "layoutParsingConfig": {} } }
๋์งํธ ํ์๋ฅผ ์ง์ ํ๋ ค๋ฉด ๋ค์ ๋จ๊ณ๋ฅผ ๋ฐ๋ฅด์ธ์.
"documentProcessingConfig": { "defaultParsingConfig": { "digitalParsingConfig": {} } }
์์
๋ค์ ์์์์๋ ๋ฐ์ดํฐ ์คํ ์ด ์์ฑ ์ค์ OCR ํ์๊ฐ ๊ธฐ๋ณธ ํ์๊ฐ ๋๋๋ก ์ง์ ํฉ๋๋ค. OCR ํ์๋ PDF ํ์ผ์๋ง ์ ์ฉ๋๋ฏ๋ก ์์ง๋๋ ๋ชจ๋ PDF ํ์ผ์ OCR ํ์์์ ์ฒ๋ฆฌ๋๊ณ ๋ค๋ฅธ ํ์ผ ํ์์ ๋์งํธ ํ์์์ ์ฒ๋ฆฌ๋ฉ๋๋ค.
curl -X POST \
-H "Authorization: Bearer $(gcloud auth print-access-token)" \
-H "Content-Type: application/json" \
-H "X-Goog-User-Project: exampleproject" \
"https://discoveryengine.googleapis.com/v1alpha/projects/exampleproject/locations/global/collections/default_collection/dataStores?dataStoreId=datastore123" \
-d '{
"displayName": "exampledatastore",
"industryVertical": "GENERIC",
"solutionTypes": ["SOLUTION_TYPE_SEARCH"],
"contentConfig": "CONTENT_REQUIRED",
"documentProcessingConfig": {
"defaultParsingConfig": {
"ocrParsingConfig": {
"useNativeText": "false"
}
}
}
}'
ํ์ผ ํ์์ ํ์ ์ฌ์ ์ ์ง์
ํน์ ํ์ผ ํ์(PDF, HTML, DOCX)์ ๊ธฐ๋ณธ ํ์๊ฐ ์๋ ๋ค๋ฅธ ํ์๋ก ํ์ฑํ๋๋ก ์ง์ ํ ์ ์์ต๋๋ค. ์ด๋ ๊ฒ ํ๋ ค๋ฉด ๋ฐ์ดํฐ ์คํ ์ด ์์ฑ ์์ฒญ์ documentProcessingConfig
ํ๋๋ฅผ ํฌํจํ๊ณ ์ฌ์ ์ ํ์๋ฅผ ์ง์ ํฉ๋๋ค. ๊ธฐ๋ณธ ํ์๋ฅผ ์ง์ ํ์ง ์์ผ๋ฉด ๋์งํธ ํ์๊ฐ ๊ธฐ๋ณธ๊ฐ์
๋๋ค.
REST
ํ์ผ ์ ํ๋ณ ํ์ ์ฌ์ ์๋ฅผ ์ง์ ํ๋ ค๋ฉด ๋ค์ ๋จ๊ณ๋ฅผ ๋ฐ๋ฅด์ธ์.
API๋ฅผ ์ฌ์ฉํ์ฌ ๊ฒ์ ๋ฐ์ดํฐ ์คํ ์ด๋ฅผ ๋ง๋ค ๋ ๋ฐ์ดํฐ ์คํ ์ด ์์ฑ ์์ฒญ์
documentProcessingConfig.defaultParsingConfig
๋ฅผ ํฌํจํฉ๋๋ค.pdf
,html
๋๋docx
์ ํ์๋ฅผ ์ง์ ํ ์ ์์ต๋๋ค."documentProcessingConfig": { "parsingConfigOverrides": { "FILE_TYPE": { PARSING_CONFIG }, } }
๋ค์์ ๋ฐ๊ฟ๋๋ค.
FILE_TYPE
: ํ์ฉ๋๋ ๊ฐ์pdf
,html
,docx
์ ๋๋ค.PARSING_CONFIG
: ํ์ผ ํ์์ ์ ์ฉํ ํ์ ๊ตฌ์ฑ์ ์ง์ ํฉ๋๋ค. OCR ํ์, ๋ ์ด์์ ํ์ ๋๋ ๋์งํธ ํ์๋ฅผ ์ง์ ํ ์ ์์ต๋๋ค.PDF์ OCR ํ์๋ฅผ ์ง์ ํ๋ ค๋ฉด ๋ค์ ๋จ๊ณ๋ฅผ ๋ฐ๋ฅด์ธ์.
"ocrParsingConfig": { "useNativeText": "NATIVE_TEXT_BOOLEAN" }
NATIVE_TEXT_BOOLEAN
: ์ ํ์ฌํญ. PDF๋ฅผ ์์งํ๋ ๊ฒฝ์ฐ์๋ง ์ค์ ํฉ๋๋ค.true
๋ก ์ค์ ํ๋ฉด OCR ํ์์ ๋ํด ๋จธ์ ์์ ์ฝ์ ์ ์๋ ํ ์คํธ ์ฒ๋ฆฌ๊ฐ ์ฌ์ฉ ์ค์ ๋ฉ๋๋ค. ๊ธฐ๋ณธ๊ฐ์false
์ ๋๋ค.
๋ ์ด์์ ํ์๋ฅผ ์ง์ ํ๋ ค๋ฉด ๋ค์ ๋จ๊ณ๋ฅผ ๋ฐ๋ฅด์ธ์.
"layoutParsingConfig": {}
๋์งํธ ํ์๋ฅผ ์ง์ ํ๋ ค๋ฉด ๋ค์ ๋จ๊ณ๋ฅผ ๋ฐ๋ฅด์ธ์.
"documentProcessingConfig": { "defaultParsingConfig": { "digitalParsingConfig": {} } }
์์
๋ค์ ์์์์๋ ๋ฐ์ดํฐ ์คํ ์ด๋ฅผ ๋ง๋ค ๋ PDF ํ์ผ์ OCR ํ์์์ ์ฒ๋ฆฌํ๊ณ HTML ํ์ผ์ ๋ ์ด์์ ํ์์์ ์ฒ๋ฆฌ๋๋๋ก ์ง์ ํฉ๋๋ค. ์ด ๊ฒฝ์ฐ PDF ๋ฐ HTML ํ์ผ ์ด์ธ์ ๋ชจ๋ ํ์ผ์ ๋์งํธ ํ์์ ์ํด ์ฒ๋ฆฌ๋ฉ๋๋ค.
curl -X POST \
-H "Authorization: Bearer $(gcloud auth print-access-token)" \
-H "Content-Type: application/json" \
-H "X-Goog-User-Project: exampleproject" \
"https://discoveryengine.googleapis.com/v1alpha/projects/exampleproject/locations/global/collections/default_collection/dataStores?dataStoreId=datastore123" \
-d '{
"displayName": "exampledatastore",
"industryVertical": "GENERIC",
"solutionTypes": ["SOLUTION_TYPE_SEARCH"],
"contentConfig": "CONTENT_REQUIRED",
"documentProcessingConfig": {
"parsingConfigOverrides": {
"pdf": {
"ocrParsingConfig": {
"useNativeText": "false"
},
},
"html": {
"layoutParsingConfig": {}
}
}
}
}'
JSON์ผ๋ก ํ์ฑ๋ ๋ฌธ์ ๊ฐ์ ธ์ค๊ธฐ
getProcessedDocument
๋ฉ์๋๋ฅผ ํธ์ถํ๊ณ PARSED_DOCUMENT
๋ฅผ ์ฒ๋ฆฌ๋ ๋ฌธ์ ์ ํ์ผ๋ก ์ง์ ํ์ฌ JSON ํ์์ผ๋ก ํ์ฑ๋ ๋ฌธ์๋ฅผ ๊ฐ์ ธ์ฌ ์ ์์ต๋๋ค. JSON์ผ๋ก ํ์ฑ๋ ๋ฌธ์๋ฅผ ๊ฐ์ ธ์ค๋ ๊ฒ์ ํ์ฑ๋ ๋ฌธ์๋ฅผ ๋ค๋ฅธ ์์น์ ์
๋ก๋ํด์ผ ํ๊ฑฐ๋ ์์ฒด ํ์ฑ๋ ๋ฌธ์ ์ฌ์ฉ ๊ธฐ๋ฅ์ ์ฌ์ฉํ์ฌ ํ์ฑ๋ ๋ฌธ์๋ฅผ Vertex AI Agent Builder๋ก ๋ค์ ๊ฐ์ ธ์ค๋ ค๋ ๊ฒฝ์ฐ์ ์ ์ฉํ ์ ์์ต๋๋ค.
REST
ํ์ฑ๋ ๋ฌธ์๋ฅผ JSON์ผ๋ก ๊ฐ์ ธ์ค๋ ค๋ฉด ๋ค์ ๋จ๊ณ๋ฅผ ๋ฐ๋ฅด์ธ์.
getProcessedDocument
๋ฉ์๋ ํธ์ถ:curl -X GET \ -H "Authorization: Bearer $(gcloud auth print-access-token)" \ "https://discoveryengine.googleapis.com/v1alpha/projects/PROJECT_ID/locations/global/collections/default_collection/dataStores/DATA_STORE_ID/branches/0/documents/DOCUMENT_ID:getProcessedDocument?processed_document_type=PARSED_DOCUMENT"
๋ค์์ ๋ฐ๊ฟ๋๋ค.
PROJECT_ID
: ํ๋ก์ ํธ์ ID์ ๋๋ค.DATA_STORE_ID
: ๋ฐ์ดํฐ ์คํ ์ด์ ID์ ๋๋ค.DOCUMENT_ID
: ๊ฐ์ ธ์ฌ ๋ฌธ์์ ID์ ๋๋ค.
์์ฒด ํ์ฑ๋ ๋ฌธ์ ์ฌ์ฉ
์ฌ์ ํ์ฑ๋ ๋น์ ํ ๋ฌธ์๋ฅผ Vertex AI Search ๋ฐ์ดํฐ ์คํ ์ด๋ก ๊ฐ์ ธ์ฌ ์ ์์ต๋๋ค. ์๋ฅผ ๋ค์ด ์์ PDF ๋ฌธ์๋ฅผ ๊ฐ์ ธ์ค๋ ๋์ PDF๋ฅผ ์ง์ ํ์ฑํ๊ณ ํ์ฑ ๊ฒฐ๊ณผ๋ฅผ ๊ฐ์ ธ์ฌ ์ ์์ต๋๋ค. ์ด๋ ๊ฒ ํ๋ฉด ๊ตฌ์กฐํ๋ ๋ฐฉ์์ผ๋ก ๋ฌธ์๋ฅผ ๊ฐ์ ธ์ ๊ฒ์ ๋ฐ ๋ต๋ณ ์์ฑ ์ ๋ฌธ์์ ๋ ์ด์์๊ณผ ์์์ ๊ดํ ์ ๋ณด๊ฐ ํฌํจ๋๋๋ก ํ ์ ์์ต๋๋ค.
ํ์ฑ๋ ๋น์ ํ ๋ฌธ์๋ ํ
์คํธ, ํ, ๋ชฉ๋ก ๋ธ๋ก์ ์ํ์ค๋ฅผ ์ฌ์ฉํ์ฌ ๋น์ ํ ๋ฌธ์๋ฅผ ์ค๋ช
ํ๋ JSON์ผ๋ก ํํ๋ฉ๋๋ค. PDF์ ๊ฐ์ ๋ค๋ฅธ ์ ํ์ ๋น์ ํ ๋ฌธ์๋ฅผ ๊ฐ์ ธ์ค๋ ๊ฒ๊ณผ ๋์ผํ ๋ฐฉ์์ผ๋ก ํ์ฑ๋ ๋น์ ํ ๋ฌธ์ ๋ฐ์ดํฐ๊ฐ ํฌํจ๋ JSON ํ์ผ์ ๊ฐ์ ธ์ต๋๋ค. ์ด ๊ธฐ๋ฅ์ ์ฌ์ฉ ์ค์ ํ๋ฉด JSON ํ์ผ์ด ์
๋ก๋๋๊ณ application/json
MIME ์ ํ ๋๋ .JSON ํ์ฅ์๋ก ์๋ณ๋ ๋๋ง๋ค ํ์ฑ๋ ๋ฌธ์๋ก ์ทจ๊ธ๋ฉ๋๋ค.
์ด ๊ธฐ๋ฅ์ ์ฌ์ฉ ์ค์ ํ๊ณ ์ฌ์ฉ ๋ฐฉ๋ฒ์ ๊ดํ ์์ธํ ๋ด์ฉ์ ์์๋ณด๋ ค๋ฉด Google ๊ณ์ ํ์ ๋ฌธ์ํ์ธ์.
RAG์ฉ ๋ฌธ์ ์ฒญํฌ ์ฒ๋ฆฌ
๊ธฐ๋ณธ์ ์ผ๋ก Vertex AI Search๋ ๊ฒ์ ์ฑ์ด ๊ฐ ๊ฒ์ ๊ฒฐ๊ณผ์ ํจ๊ป PDF ๋๋ ์นํ์ด์ง์ ๊ฐ์ ๋ฌธ์๋ฅผ ๋ฐํํ๋ ๋ฌธ์ ๊ฒ์์ ์ต์ ํ๋์ด ์์ต๋๋ค.
๋ฌธ์ ์ฒญํฌ ๊ธฐ๋ฅ์ ๋น์ ํ ๋ฐ์ดํฐ ์คํ ์ด๊ฐ ์๋ ์ผ๋ฐ ๊ฒ์ ์ฑ์์ ์ฌ์ฉํ ์ ์์ต๋๋ค.
๋์ Vertex AI Search๋ฅผ RAG์ ๋ง๊ฒ ์ต์ ํํ ์ ์์ต๋๋ค. ์ด ๊ฒฝ์ฐ ๊ฒ์ ์ฑ์ ์ฃผ๋ก LLM ์ถ๋ ฅ์ ๋ง์ถค ๋ฐ์ดํฐ๋ก ๋ณด๊ฐํ๋ ๋ฐ ์ฌ์ฉ๋ฉ๋๋ค. ๋ฌธ์ ์ฒญํฌ ์ฒ๋ฆฌ๊ฐ ์ฌ์ฉ ์ค์ ๋๋ฉด Vertex AI Search์์ ๋ฌธ์๋ฅผ ์ฒญํฌ๋ก ๋ถํ ํฉ๋๋ค. ๊ฒ์ ๊ฒฐ๊ณผ์์ ๊ฒ์ ์ฑ์ ์ ์ฒด ๋ฌธ์ ๋์ ๊ด๋ จ์ฑ ๋์ ๋ฐ์ดํฐ ์ฒญํฌ๋ฅผ ๋ฐํํ ์ ์์ต๋๋ค. RAG์ ์ฒญํฌ ๋ฐ์ดํฐ๋ฅผ ์ฌ์ฉํ๋ฉด LLM ์๋ต์ ๊ด๋ จ์ฑ์ด ๋์์ง๊ณ LLM์ ๊ณ์ฐ ๋ถํ๊ฐ ์ค์ด๋ญ๋๋ค.
RAG์ฉ Vertex AI Search๋ฅผ ์ฌ์ฉํ๋ ค๋ฉด ๋ค์ ๋จ๊ณ๋ฅผ ๋ฐ๋ฅด์ธ์.
๋ฐ์ดํฐ ์คํ ์ด๋ฅผ ๋ง๋ค ๋ ๋ฌธ์ ์ฒญํฌ ์ฒ๋ฆฌ๋ฅผ ์ฌ์ฉ ์ค์ ํฉ๋๋ค.
๋๋ ์ด๋ฏธ ์์ฒด ๋ฌธ์๋ฅผ ์ฒญํฌ ์ฒ๋ฆฌํ ๊ฒฝ์ฐ ์์ฒด ์ฒญํฌ๋ฅผ ์ ๋ก๋ํฉ๋๋ค(ํ์ฉ ๋ชฉ๋ก์ด ์๋ ๋ฏธ๋ฆฌ๋ณด๊ธฐ).
๋ค์๊ณผ ๊ฐ์ ๋ฐฉ๋ฒ์ผ๋ก ์ฒญํฌ๋ฅผ ๊ฒ์ํ๊ณ ํ์ธํฉ๋๋ค.
์ ํ์ฌํญ
์ฒญํฌ ์ฒ๋ฆฌ์๋ ๋ค์๊ณผ ๊ฐ์ ์ ํ์ฌํญ์ด ์ ์ฉ๋ฉ๋๋ค.
- ๋ฐ์ดํฐ ์คํ ์ด๋ฅผ ๋ง๋ ํ์๋ ๋ฌธ์ ์ฒญํฌ ์ฒ๋ฆฌ๋ฅผ ์ฌ์ฉ ์ค์ ํ๊ฑฐ๋ ์ฌ์ฉ ์ค์งํ ์ ์์ต๋๋ค.
- ๋ฌธ์ ์ฒญํฌ ์ฒ๋ฆฌ๋ฅผ ์ฌ์ฉ ์ค์ ํ ๋ฐ์ดํฐ ์คํ ์ด์์ ์ฒญํฌ ๋์ ๋ฌธ์์ ๋ํ ๊ฒ์ ์์ฒญ์ ํ ์ ์์ต๋๋ค. ๊ทธ๋ฌ๋ ๋ฌธ์ ์ฒญํฌ ์ฒ๋ฆฌ๊ฐ ์ฌ์ฉ ์ค์ ๋ ๋ฐ์ดํฐ ์คํ ์ด๋ ๋ฌธ์ ๋ฐํ์ ์ต์ ํ๋์ด ์์ง ์์ต๋๋ค. ๋ฌธ์๋ ์ฒญํฌ๋ฅผ ๋ฌธ์๋ก ์ง๊ณํ์ฌ ๋ฐํ๋ฉ๋๋ค.
- ๋ฌธ์ ์ฒญํฌ ์ฒ๋ฆฌ๊ฐ ์ฌ์ฉ ์ค์ ๋ ๊ฒฝ์ฐ ๊ฒ์ ์์ฝ ๋ฐ ํ์ ์กฐ์น๊ฐ ํฌํจ๋ ๊ฒ์์ ๊ณต๊ฐ ๋ฏธ๋ฆฌ๋ณด๊ธฐ์์ ์ง์๋์ง๋ง ์ ์ ๋ฒ์ ์์๋ ์ง์๋์ง ์์ต๋๋ค.
๋ฌธ์ ์ฒญํฌ ์ฒ๋ฆฌ ์ต์
์ด ์น์ ์์๋ ๋ฌธ์ ์ฒญํฌ ์ฒ๋ฆฌ๋ฅผ ์ฌ์ฉ ์ค์ ํ๊ธฐ ์ํด ์ง์ ํ๋ ์ต์ ์ ๋ํด ์ค๋ช ํฉ๋๋ค.
๋ฐ์ดํฐ ์คํ ์ด๋ฅผ ๋ง๋๋ ๋์ Vertex AI Search์์ ๋ฌธ์๋ฅผ ์ฒญํฌ๋ก ์์ธ์ ์์ฑํ ์ ์๋๋ก ๋ค์ ์ต์ ์ ์ฌ์ฉ ์ค์ ํฉ๋๋ค.
๋ ์ด์์ ์ธ์ ๋ฌธ์ ์ฒญํฌ ์ฒ๋ฆฌ. ์ด ์ต์ ์ ์ฌ์ฉ ์ค์ ํ๋ ค๋ฉด ๋ฐ์ดํฐ ์คํ ์ด ์์ฑ ์์ฒญ์
documentProcessingConfig
ํ๋๋ฅผ ํฌํจํ๊ณChunkingConfig.LayoutBasedChunkingConfig
๋ฅผ ์ง์ ํฉ๋๋ค.๋ ์ด์์ ์ธ์ ๋ฌธ์ ์ฒญํฌ ์ฒ๋ฆฌ๊ฐ ์ฌ์ฉ ์ค์ ๋๋ฉด Vertex AI Search๊ฐ ๋ฌธ์์ ๋ ์ด์์์ ๊ฐ์งํ๊ณ ์ฒญํฌ ์ฒ๋ฆฌ ์ค์ ์ด๋ฅผ ๊ณ ๋ คํฉ๋๋ค. ์ด๋ ๊ฒ ํ๋ฉด ๊ฒ์ ๋ฐ LLM ์์ฑ์ ์ฌ์ฉํ ๋ ์ฝํ ์ธ ์ ์๋งจํฑ ์ผ๊ด์ฑ์ด ๊ฐ์ ๋๊ณ ๋ ธ์ด์ฆ๊ฐ ์ค์ด๋ญ๋๋ค. ์ฒญํฌ์ ๋ชจ๋ ํ ์คํธ๋ ์ ๋ชฉ, ๋ถ์ ๋ชฉ, ๋ชฉ๋ก๊ณผ ๊ฐ์ ๋์ผํ ๋ ์ด์์ ํญ๋ชฉ์์ ๊ฐ์ ธ์ต๋๋ค.
๋ ์ด์์ ํ์ฑ. ์ด ์ต์ ์ ์ฌ์ฉ ์ค์ ํ๋ ค๋ฉด ๋ฐ์ดํฐ ์คํ ์ด๋ฅผ ๋ง๋ค ๋
ParsingConfig.LayoutParsingConfig
๋ฅผ ์ง์ ํฉ๋๋ค.๋ ์ด์์ ํ์๋ PDF, HTML, DOCX ํ์ผ์ ๋ ์ด์์์ ๊ฐ์งํฉ๋๋ค. ํ ์คํธ ๋ธ๋ก, ํ, ๋ชฉ๋ก, ์ ๋ชฉ, ๋จธ๋ฆฌ๊ธ๊ณผ ๊ฐ์ ์์๋ฅผ ์๋ณํ๊ณ ์ด๋ฅผ ์ฌ์ฉํ์ฌ ๋ฌธ์์ ๊ตฌ์ฑ๊ณผ ๊ณ์ธต ๊ตฌ์กฐ๋ฅผ ์ ์ํฉ๋๋ค.
๋ ์ด์์ ํ์ฑ์ ๊ดํ ์์ธํ ๋ด์ฉ์ ๋ ์ด์์ ํ์ฑ์ ์ฐธ๊ณ ํ์ธ์.
๋ฌธ์ ์ฒญํฌ ์ฒ๋ฆฌ ์ฌ์ฉ ์ค์
๋ฐ์ดํฐ ์คํ ์ด ์์ฑ ์์ฒญ์ documentProcessingConfig
๊ฐ์ฒด๋ฅผ ํฌํจํ๊ณ ๋ ์ด์์ ์ธ์ ๋ฌธ์ ์ฒญํฌ ์ฒ๋ฆฌ ๋ฐ ๋ ์ด์์ ํ์ฑ์ ์ฌ์ฉ ์ค์ ํ์ฌ ๋ฌธ์ ์ฒญํฌ ์ฒ๋ฆฌ๋ฅผ ์ฌ์ฉ ์ค์ ํ ์ ์์ต๋๋ค.
REST
๋ฌธ์ ์ฒญํฌ ์ฒ๋ฆฌ๋ฅผ ์ฌ์ฉ ์ค์ ํ๋ ค๋ฉด ๋ค์ ๋จ๊ณ๋ฅผ ๋ฐ๋ฅด์ธ์.
API๋ฅผ ์ฌ์ฉํ์ฌ ๊ฒ์ ๋ฐ์ดํฐ ์คํ ์ด๋ฅผ ๋ง๋ค ๋ ๋ฐ์ดํฐ ์คํ ์ด ์์ฑ ์์ฒญ์
documentProcessingConfig.chunkingConfig
๊ฐ์ฒด๋ฅผ ํฌํจํฉ๋๋ค."documentProcessingConfig": { "chunkingConfig": { "layoutBasedChunkingConfig": { "chunkSize": CHUNK_SIZE_LIMIT, "includeAncestorHeadings": HEADINGS_BOOLEAN, } }, "defaultParsingConfig": { "layoutParsingConfig": {} } }
๋ค์์ ๋ฐ๊ฟ๋๋ค.
CHUNK_SIZE_LIMIT
: ์ ํ์ฌํญ. ๊ฐ ์ฒญํฌ์ ํ ํฐ ํฌ๊ธฐ ์ ํ์ ๋๋ค. ๊ธฐ๋ณธ๊ฐ์ 500์ ๋๋ค. ์ง์๋๋ ๊ฐ์ 100~500(์ ๋๊ฐ ํฌํจ)์ ๋๋ค.HEADINGS_BOOLEAN
: ์ ํ์ฌํญ. ๊ฐ ์ฒญํฌ์ ์ ๋ชฉ์ด ํฌํจ๋๋์ง ์ฌ๋ถ๋ฅผ ๊ฒฐ์ ํฉ๋๋ค. ๊ธฐ๋ณธ๊ฐ์false
์ ๋๋ค. ๋ฌธ์ ์ค๊ฐ์์ ์ฒญํฌ์ ๋ชจ๋ ์์ค์ ์ ๋ชฉ๊ณผ ๋จธ๋ฆฌ๊ธ์ ์ถ๊ฐํ๋ฉด ์ฒญํฌ ๊ฒ์ ๋ฐ ์์ ์ง์ ์ ์ปจํ ์คํธ ์์ค์ ๋ฐฉ์งํ๋ ๋ฐ ๋์์ด ๋ ์ ์์ต๋๋ค.
์์ฒด ์ฒญํฌ ์ฌ์ฉ(ํ์ฉ ๋ชฉ๋ก ์ถ๊ฐ๋ฅผ ํตํ ๋ฏธ๋ฆฌ๋ณด๊ธฐ)
์ด๋ฏธ ์์ฒด ๋ฌธ์๋ฅผ ์ฒญํฌ ์ฒ๋ฆฌํ ๊ฒฝ์ฐ ๋ฌธ์ ์ฒญํฌ ์ฒ๋ฆฌ ์ต์ ์ ์ฌ์ฉ ์ค์ ํ๋ ๋์ ๋ฌธ์๋ฅผ Vertex AI Search์ ์ ๋ก๋ํ ์ ์์ต๋๋ค.
์์ฒด ์ฒญํฌ ์ฌ์ฉ์ ํ์ฉ ๋ชฉ๋ก ๊ธฐ๋ฅ์ด ์๋ ๋ฏธ๋ฆฌ๋ณด๊ธฐ์ ๋๋ค. ์ด ๊ธฐ๋ฅ์ ์ฌ์ฉํ๋ ค๋ฉด Google ๊ณ์ ํ์ ๋ฌธ์ํ์ธ์.
๋ฌธ์์ ์ฒญํฌ ๋์ด
ํน์ ๋ฌธ์์ ๋ชจ๋ ์ฒญํฌ๋ฅผ ๋์ดํ๋ ค๋ฉด Chunks.list
๋ฉ์๋๋ฅผ ํธ์ถํฉ๋๋ค.
REST
๋ฌธ์์ ์ฒญํฌ๋ฅผ ๋์ดํ๋ ค๋ฉด ๋ค์ ๋จ๊ณ๋ฅผ ๋ฐ๋ฅด์ธ์.
Chunks.list
๋ฉ์๋๋ฅผ ํธ์ถํฉ๋๋ค.curl -X GET \ -H "Authorization: Bearer $(gcloud auth print-access-token)" \ "https://discoveryengine.googleapis.com/v1alpha/projects/PROJECT_ID/locations/global/collections/default_collection/dataStores/DATA_STORE_ID/branches/0/documents/DOCUMENT_ID/chunks"
๋ค์์ ๋ฐ๊ฟ๋๋ค.
PROJECT_ID
: ํ๋ก์ ํธ์ ID์ ๋๋ค.DATA_STORE_ID
: ๋ฐ์ดํฐ ์คํ ์ด์ ID์ ๋๋ค.DOCUMENT_ID
: ์ฒญํฌ๋ฅผ ๋์ดํ ๋ฌธ์์ ID์ ๋๋ค.
์ฒ๋ฆฌ๋ ๋ฌธ์์์ JSON์ผ๋ก ์ฒญํฌ ๊ฐ์ ธ์ค๊ธฐ
getProcessedDocument
๋ฉ์๋๋ฅผ ํธ์ถํ์ฌ ํน์ ๋ฌธ์์ ๋ชจ๋ ์ฒญํฌ๋ฅผ JSON ํ์์ผ๋ก ๊ฐ์ ธ์ฌ ์ ์์ต๋๋ค. JSON์ผ๋ก ์ฒญํฌ๋ฅผ ๊ฐ์ ธ์ค๋ ๊ฒ์ ์ฒญํฌ๋ฅผ ๋ค๋ฅธ ์์น์ ์
๋ก๋ํด์ผ ํ๊ฑฐ๋ ์์ฒด ์ฒญํฌ ์ฌ์ฉ ๊ธฐ๋ฅ์ ์ฌ์ฉํ์ฌ Vertex AI Agent Builder์ ์ฒญํฌ๋ฅผ ๋ค์ ๊ฐ์ ธ์ค๊ธฐ๋ก ๊ฒฐ์ ํ ๊ฒฝ์ฐ์ ์ ์ฉํ ์ ์์ต๋๋ค.
REST
๋ฌธ์์ JSON ์ฒญํฌ๋ฅผ ๊ฐ์ ธ์ค๋ ค๋ฉด ๋ค์ ๋จ๊ณ๋ฅผ ๋ฐ๋ฅด์ธ์.
getProcessedDocument
๋ฉ์๋ ํธ์ถ:curl -X GET \ -H "Authorization: Bearer $(gcloud auth print-access-token)" \ "https://discoveryengine.googleapis.com/v1alpha/projects/PROJECT_ID/locations/global/collections/default_collection/dataStores/DATA_STORE_ID/branches/0/documents/DOCUMENT_ID/chunks:getProcessedDocument?processed_document_type=CHUNKED_DOCUMENT"
๋ค์์ ๋ฐ๊ฟ๋๋ค.
PROJECT_ID
: ํ๋ก์ ํธ์ ID์ ๋๋ค.DATA_STORE_ID
: ๋ฐ์ดํฐ ์คํ ์ด์ ID์ ๋๋ค.DOCUMENT_ID
: ์ฒญํฌ๋ฅผ ๊ฐ์ ธ์ฌ ๋ฌธ์์ ID์ ๋๋ค.
ํน์ ์ฒญํฌ ๊ฐ์ ธ์ค๊ธฐ
ํน์ ์ฒญํฌ๋ฅผ ๊ฐ์ ธ์ค๋ ค๋ฉด Chunks.get
๋ฉ์๋๋ฅผ ํธ์ถํฉ๋๋ค.
REST
ํน์ ์ฒญํฌ๋ฅผ ๊ฐ์ ธ์ค๋ ค๋ฉด ๋ค์ ๋จ๊ณ๋ฅผ ๋ฐ๋ฅด์ธ์.
Chunks.get
๋ฉ์๋๋ฅผ ํธ์ถํฉ๋๋ค.curl -X GET \ -H "Authorization: Bearer $(gcloud auth print-access-token)" \ "https://discoveryengine.googleapis.com/v1alpha/projects/PROJECT_ID/locations/global/collections/default_collection/dataStores/DATA_STORE_ID/branches/0/documents/DOCUMENT_ID/chunks/CHUNK_ID"
๋ค์์ ๋ฐ๊ฟ๋๋ค.
PROJECT_ID
: ํ๋ก์ ํธ์ ID์ ๋๋ค.DATA_STORE_ID
: ๋ฐ์ดํฐ ์คํ ์ด์ ID์ ๋๋ค.DOCUMENT_ID
: ์ฒญํฌ๊ฐ ํฌํจ๋ ๋ฌธ์์ ID์ ๋๋ค.CHUNK_ID
: ๋ฐํํ ์ฒญํฌ์ ID์ ๋๋ค.
๊ฒ์ ์์ฒญ์์ ์ฒญํฌ ๋ฐํ
๋ฐ์ดํฐ๊ฐ ์ฌ๋ฐ๋ฅด๊ฒ ์ฒญํฌ ์ฒ๋ฆฌ๋์์์ ํ์ธํ ํ Vertex AI Search์์ ๊ฒ์ ๊ฒฐ๊ณผ์ ์ฒญํฌ ์ฒ๋ฆฌ๋ ๋ฐ์ดํฐ๋ฅผ ๋ฐํํ ์ ์์ต๋๋ค.
์๋ต์ ๊ฒ์์ด์ ๊ด๋ จ๋ ์ฒญํฌ๋ฅผ ๋ฐํํฉ๋๋ค. ๋ํ ์์ค ๋ฌธ์์ ๊ด๋ จ ์ฒญํฌ ์๋ค์ ํ์๋๋ ์ธ์ ํ ์ฒญํฌ๋ฅผ ๋ฐํํ๋๋ก ์ ํํ ์ ์์ต๋๋ค. ์ธ์ ํ ์ฒญํฌ๋ฅผ ์ถ๊ฐํ๋ฉด ๋งฅ๋ฝ๊ณผ ์ ํ์ฑ์ ๋์ผ ์ ์์ต๋๋ค.
REST
์ฒญํฌ ๋ฐ์ดํฐ๋ฅผ ๊ฐ์ ธ์ค๋ ค๋ฉด ๋ค์ ๋จ๊ณ๋ฅผ ๋ฐ๋ฅด์ธ์.
๊ฒ์ ์์ฒญ์ ํ ๋๋
ContentSearchSpec.SearchResultMode
๋ฅผchunks
๋ก ์ง์ ํฉ๋๋ค.contentSearchSpec": { "searchResultMode": "RESULT_MODE", "chunkSpec": { "numPreviousChunks": NUMBER_OF_PREVIOUS_CHUNKS, "numNextChunks": NUMBER_OF_NEXT_CHUNKS } }
RESULT_MODE
: ๊ฒ์ ๊ฒฐ๊ณผ๊ฐ ์ ์ฒด ๋ฌธ์๋ก ๋ฐํ๋๋์ง ๋๋ ์ฒญํฌ๋ก ๋ฐํ๋๋์ง ๊ฒฐ์ ํฉ๋๋ค. ์ฒญํฌ๋ฅผ ๊ฐ์ ธ์ค๋ ค๋ฉด ๋ฐ์ดํฐ ์คํ ์ด์ ๋ฌธ์ ์ฒญํฌ ์ฒ๋ฆฌ๊ฐ ์ฌ์ฉ ์ค์ ๋์ด ์์ด์ผ ํฉ๋๋ค. ํ์ฉ๋๋ ๊ฐ์documents
๋ฐchunks
์ ๋๋ค. ๋ฐ์ดํฐ ์คํ ์ด์ ๋ฌธ์ ์ฒญํฌ ์ฒ๋ฆฌ๊ฐ ์ฌ์ฉ ์ค์ ๋ ๊ฒฝ์ฐ ๊ธฐ๋ณธ๊ฐ์chunks
์ ๋๋ค.NUMBER_OF_PREVIOUS_CHUNKS
: ๊ด๋ จ ์ฒญํฌ ๋ฐ๋ก ์์ ๋ฐํํ ์ฒญํฌ์ ์์ ๋๋ค. ํ์ฉ๋๋ ์ต๋๊ฐ์ 5์ ๋๋ค.NUMBER_OF_NEXT_CHUNKS
: ๊ด๋ จ ์ฒญํฌ ๋ฐ๋ก ๋ค์ ๋ฐํํ ์ฒญํฌ์ ์์ ๋๋ค. ํ์ฉ๋๋ ์ต๋๊ฐ์ 5์ ๋๋ค.
์์
๋ค์ ๊ฒ์์ด ์์ฒญ ์์์์๋ SearchResultMode
๋ฅผ chunks
๋ก ์ค์ ํ๊ณ , ์ด์ ์ฒญํฌ 1๊ฐ์ ๋ค์ ์ฒญํฌ 1๊ฐ๋ฅผ ์์ฒญํ๊ณ , pageSize
๋ฅผ ์ฌ์ฉํ์ฌ ๊ฒฐ๊ณผ ์๋ฅผ ๋จ์ผ ๊ด๋ จ ์ฒญํฌ๋ก ์ ํํฉ๋๋ค.
curl -X POST \
-H "Authorization: Bearer $(gcloud auth print-access-token)" \
-H "Content-Type: application/json" \
-H "X-Goog-User-Project: exampleproject" \
"https://discoveryengine.googleapis.com/v1alpha/projects/exampleproject/locations/global/collections/default_collection/dataStores/datastore123/servingConfigs/default_search:search" \
-d '{
"query": "animal",
"pageSize": 1,
"contentSearchSpec": {
"searchResultMode": "CHUNKS",
"chunkSpec": {
"numPreviousChunks": 1,
"numNextChunks": 1
}
}
}'
๋ค์ ์์๋ ์์ ์ฟผ๋ฆฌ์ ๋ฐํ๋ ์๋ต์ ๋ณด์ฌ์ค๋๋ค. ์๋ต์๋ ๊ด๋ จ ์ฒญํฌ, ์ด์ ์ฒญํฌ ๋ฐ ๋ค์ ์ฒญํฌ, ์๋ณธ ๋ฌธ์์ ๋ฉํ๋ฐ์ดํฐ, ๊ฐ ์ฒญํฌ๊ฐ ํ์๋ ๋ฌธ์ ํ์ด์ง ๋ฒ์๊ฐ ํฌํจ๋ฉ๋๋ค.
์๋ต
{ "results": [ { "chunk": { "name": "projects/961309680810/locations/global/collections/default_collection/dataStores/allie-pdf-adjacent-chunks_1711394998841/branches/0/documents/0d8619f429d7f20b3575b14cd0ad0813/chunks/c17", "id": "c17", "content": "\n# ESS10: Stakeholder Engagement and Information Disclosure\nReaders should also refer to ESS10 and its guidance notes, plus the template available for a stakeholder engagement plan. More detail on stakeholder engagement in projects with risks related to animal health is contained in section 4 below. The type of stakeholders (men and women) that can be engaged by the Borrower as part of the project's environmental and social assessment and project design and implementation are diverse and vary based on the type of intervention. The stakeholders can include: Pastoralists, farmers, herders, women's groups, women farmers, community members, fishermen, youths, etc. Cooperatives members, farmer groups, women's livestock associations, water user associations, community councils, slaughterhouse workers, traders, etc. Veterinarians, para-veterinary professionals, animal health workers, community animal health workers, faculties and students in veterinary colleges, etc. 8 \n# 4. Good Practice in Animal Health Risk Assessment and Management\n\n# Approach\nRisk assessment provides the transparent, adequate and objective evaluation needed by interested parties to make decisions on health-related risks associated with project activities involving live animals. As the ESF requires, it is conducted throughout the project cycle, to provide or indicate likelihood and impact of a given hazard, identify factors that shape the risk, and find proportionate and appropriate management options. The level of risk may be reduced by mitigation measures, such as infrastructure (e.g., diagnostic laboratories, border control posts, quarantine stations), codes of practice (e.g., good animal husbandry practices, on-farm biosecurity, quarantine, vaccination), policies and regulations (e.g., rules for importing live animals, ban on growth hormones and promotors, feed standards, distance required between farms, vaccination), institutional capacity (e.g., veterinary services, surveillance and monitoring), changes in individual behavior (e.g., hygiene, hand washing, care for animals). Annex 2 provides examples of mitigation practices. This list is not an exhaustive one but a compendium of most practiced interventions and activities. The cited measures should take into account social, economic, as well as cultural, gender and occupational aspects, and other factors that may affect the acceptability of mitigation practices by project beneficiaries and other stakeholders. Risk assessment is reviewed and updated through the project cycle (for example to take into account increased trade and travel connectivity between rural and urban settings and how this may affect risks of disease occurrence and/or outbreak). Projects monitor changes in risks (likelihood and impact) b by using data, triggers or indicators. ", "documentMetadata": { "uri": "gs://table_eval_set/pdf/worldbank/AnimalHealthGoodPracticeNote.pdf", "title": "AnimalHealthGoodPracticeNote" }, "pageSpan": { "pageStart": 14, "pageEnd": 15 }, "chunkMetadata": { "previousChunks": [ { "name": "projects/961309680810/locations/global/collections/default_collection/dataStores/allie-pdf-adjacent-chunks_1711394998841/branches/0/documents/0d8619f429d7f20b3575b14cd0ad0813/chunks/c16", "id": "c16", "content": "\n# ESS6: Biodiversity Conservation and Sustainable Management of Living Natural Resources\nThe risks associated with livestock interventions under ESS6 include animal welfare (in relation to housing, transport, and slaughter); diffusion of pathogens from domestic animals to wildlife, with risks for endemic species and biodiversity (e.g., sheep and goat plague in Mongolia affecting the saiga, an endemic species of wild antelope); the introduction of new breeds with potential risk of introducing exotic or new diseases; and the release of new species that are not endemic with competitive advantage, potentially putting endemic species at risk of extinction. Animal welfare relates to how an animal is coping with the conditions in which it lives. An animal is in a good state of welfare if it is healthy, comfortable, well nourished, safe, able to express innate behavior, 7 Good Practice Note - Animal Health and related risks and is not suffering from unpleasant states such as pain, fear or distress. Good animal welfare requires appropriate animal care, disease prevention and veterinary treatment; appropriate shelter, management and nutrition; humane handling, slaughter or culling. The OIE provides standards for animal welfare on farms, during transport and at the time of slaughter, for their welfare and for purposes of disease control, in its Terrestrial and Aquatic Codes. The 2014 IFC Good Practice Note: Improving Animal Welfare in Livestock Operations is another example of practical guidance provided to development practitioners for implementation in investments and operations. Pastoralists rely heavily on livestock as a source of food, income and social status. Emergency projects to restock the herds of pastoralists affected by drought, disease or other natural disaster should pay particular attention to animal welfare (in terms of transport, access to water, feed, and animal health) to avoid potential disease transmission and ensure humane treatment of animals. Restocking also entails assessing the assets of pastoralists and their ability to maintain livestock in good conditions (access to pasture and water, social relationship, technical knowledge, etc.). Pastoralist communities also need to be engaged by the project to determine the type of animals and breed and the minimum herd size to be considered for restocking. \n# Box 5. Safeguarding the welfare of animals and related risks in project activities\nIn Haiti, the RESEPAG project (Relaunching Agriculture: Strengthening Agriculture Public Services) financed housing for goats and provided technical recommendations for improving their welfare, which is critical to avoid the respiratory infections, including pneumonia, that are serious diseases for goats. To prevent these diseases, requires optimal sanitation and air quality in herd housing. This involves ensuring that buildings have adequate ventilation and dust levels are reduced to minimize the opportunity for infection. Good nutrition, water and minerals are also needed to support the goats' immune function. The project paid particular attention to: (i) housing design to ensure good ventilation; (ii) locating housing close to water sources and away from human habitation and noisy areas; (iii) providing mineral blocks for micronutrients; (iv) ensuring availability of drinking water and clean food troughs. ", "documentMetadata": { "uri": "gs://table_eval_set/pdf/worldbank/AnimalHealthGoodPracticeNote.pdf", "title": "AnimalHealthGoodPracticeNote" }, "pageSpan": { "pageStart": 13, "pageEnd": 14 } } ], "nextChunks": [ { "name": "projects/961309680810/locations/global/collections/default_collection/dataStores/allie-pdf-adjacent-chunks_1711394998841/branches/0/documents/0d8619f429d7f20b3575b14cd0ad0813/chunks/c18", "id": "c18", "content": "\n# Scoping of risks\nEarly scoping of risks related to animal health informs decisions to initiate more comprehensive risk assessment according to the type of livestock interventions and activities. It can be based on the following considerations: โข โข โข โข Type of livestock interventions supported by the project (such as expansion of feed resources, improvement of animal genetics, construction/upgrading and management of post-farm-gate facilities, etc. โ see also Annex 2); Geographic scope and scale of the livestock interventions; Human and animal populations that are likely to be affected (farmers, women, children, domestic animals, wildlife, etc.); and Changes in the project or project context (such as emerging disease outbreak, extreme weather or climatic conditions) that would require a re-assessment of risk levels, mitigation measures and their likely effect on risk reduction. Scenario planning can also help to identify project-specific vulnerabilities, country-wide or locally, and help shape pragmatic analyses that address single or multiple hazards. In this process, some populations may be identified as having disproportionate exposure or vulnerability to certain risks because of occupation, gender, age, cultural or religious affiliation, socio-economic or health status. For example, women and children may be the main caretakers of livestock in the case of 9 Good Practice Note - Animal Health and related risks household farming, which puts them into close contact with animals and animal products. In farms and slaughterhouses, workers and veterinarians are particularly exposed, as they may be in direct contact with sick animals (see Box 2 for an illustration). Fragility, conflict, and violence (FCV) can exacerbate risk, in terms of likelihood and impact. Migrants new to a geographic area may be immunologically naรฏve to endemic zoonotic diseases or they may inadvertently introduce exotic diseases; and refugees or internally displaced populations may have high population density with limited infrastructure, leaving them vulnerable to disease exposure. Factors such as lack of access to sanitation, hygiene, housing, and health and veterinary services may also affect disease prevalence, contributing to perpetuation of poverty in some populations. Risk assessment should identify populations at risk and prioritize vulnerable populations and circumstances where risks may be increased. It should be noted that activities that seem minor can still have major consequences. See Box 6 for an example illustrating how such small interventions in a project may have large-scale consequences. It highlights the need for risk assessment, even for simple livestock interventions and activities, and how this can help during the project cycle (from concept to implementation). ", "documentMetadata": { "uri": "gs://table_eval_set/pdf/worldbank/AnimalHealthGoodPracticeNote.pdf", "title": "AnimalHealthGoodPracticeNote" }, "pageSpan": { "pageStart": 15, "pageEnd": 16 } } ] } } } ], "totalSize": 61, "attributionToken": "jwHwjgoMCICPjbAGEISp2J0BEiQ2NjAzMmZhYS0wMDAwLTJjYzEtYWQxYS1hYzNlYjE0Mzc2MTQiB0dFTkVSSUMqUMLwnhXb7Ygtq8SKLa3Eii3d7Ygtj_enIqOAlyLm7Ygtt7eMLduPmiKN96cijr6dFcXL8xfdj5oi9-yILdSynRWCspoi-eyILYCymiLk7Ygt", "nextPageToken": "ANxYzNzQTMiV2MjFWLhFDZh1SMjNmMtADMwATL5EmZyMDM2YDJaMQv3yagQYAsciPgIwgExEgC", "guidedSearchResult": {}, "summary": {} }