Ver3.0 ๐ง ๋ฌธ์ ์์ฝ๋ถํฐ ๋ฉ์ผ ์ ์ก๊น์ง! AI๊ฐ ๋ค ํด์ฃผ๋ ์์ ์๋ํ ์์คํ ๊ตฌ์ถํ๊ธฐ โจ

๐ง ๋ฌธ์ ์์ฝ๋ถํฐ ๋ฉ์ผ ์ ์ก๊น์ง! AI๊ฐ ๋ค ํด์ฃผ๋ ์์ ์๋ํ ์์คํ ๊ตฌ์ถํ๊ธฐ โจ
๋ณต์กํ ์ ๋ฌด ํ๋ก์ธ์ค, ์ด์ AI ์์ด์ ํธ์๊ฒ ๋งก๊ธฐ์ธ์!
๐ฏ ์ ์ง๊ธ ๋ฌธ์ ์๋ํ๊ฐ ํ์ํ ๊น?
์ฌ๋ฌ๋ถ, ํน์ ์ด๋ฐ ๊ฒฝํ ์์ผ์ ๊ฐ์? ๐
๋งค์ผ ์์นจ ์ถ๊ทผํ๋ฉด ์์ฌ์๋ ๋ณด๊ณ ์๋ค์ ์ฝ๊ณ , ํต์ฌ ๋ด์ฉ์ ์ ๋ฆฌํด์, ๊ด๋ จ ๋ถ์์ ๋ฉ์ผ๋ก ๊ณต์ ํ๋ ์ผ...
์ฒ์์ "์ด ์ ๋์ผ ๋ญ" ํ๋ค๊ฐ๋, ๋งค์ผ ๋ฐ๋ณต๋๋ค ๋ณด๋ฉด ์ ๋ง ์ง์น์์์? ๐ซ
์ ๋ ์์ ์ ๋ง์ผํ
ํ์์ ์ผํ ๋ ๋น์ทํ ๊ฒฝํ์ด ์์์ด์.
๋งค์ฃผ ์์์ผ๋ง๋ค ์ง๋์ฃผ ์ฑ๊ณผ ๋ณด๊ณ ์๋ฅผ ์ฝ๊ณ , ์์ฝํด์, ๊ฒฝ์์ง๊ณผ ๊ฐ ํ์ ๋ฉ์ผ ๋ณด๋ด๋ ๊ฒ ์ ์
๋ฌด์๊ฑฐ๋ ์.
์ฒ์ ๋ช ์ฃผ๋ ๊ด์ฐฎ์๋๋ฐ, 3๊ฐ์์ฏค ์ง๋๋๊น "์ด๊ฑฐ ์ ๋ง ๋ด๊ฐ ํด์ผ ํ๋ ์ผ์ธ๊ฐ?" ํ๋ ํ์๊ฐ์ด ๋ค๋๋ผ๊ณ ์. ๐ค
๊ทธ๋ฐ๋ฐ ์ฌ๊ธฐ์ ์ค์ํ ํฌ์ธํธ!
์ด๋ฐ ๋ฐ๋ณต์ ์ธ ์
๋ฌด์ผ๋ง๋ก AI ์๋ํ์ ์ต๊ณ ์ ์ฉ ๋์์ด๋ผ๋ ๊ฑฐ์์.
์ฌ๋์ด ์ง์ ํ๋ฉด ์๊ฐ๋ ์ค๋ ๊ฑธ๋ฆฌ๊ณ , ์ค์๋ ์๊ธฐ๊ณ , ๋ฌด์๋ณด๋ค ์ฐฝ์์ ์ธ ์ผ์ ์ธ ์๋์ง๋ฅผ ์๋ชจํ๊ฒ ๋์ฃ .
โข ํด๋จผ ์๋ฌ: ์ฝ 85% ๊ฐ์ โ
โข ์ ๋ฌด ๋ง์กฑ๋: ํ๊ท 40% ์์น ๐
โข ์ฐ๊ฐ ์ ๊ฐ ๋น์ฉ: ์ง์ 1์ธ๋น ์ฝ 500๋ง์ ๐ฐ
(์ถ์ฒ: McKinsey Digital 2023 Automation Report)
์์ฆ์ AI ๊ธฐ์ ์ด ์ ๋ง ๋ง์ด ๋ฐ์ ํด์, ์์ ์๋ ์์๋ ๋ชปํ๋ ์์ค์ ์๋ํ๊ฐ ๊ฐ๋ฅํด์ก์ด์.
ํนํ GPT-4, Claude ๊ฐ์ ๋ํ ์ธ์ด ๋ชจ๋ธ(LLM)์ด ๋ฑ์ฅํ๋ฉด์, ๋จ์ํ ๋ฐ์ดํฐ๋ฅผ ์ฎ๊ธฐ๋ ์์ค์ ๋์ด์
๋ฌธ๋งฅ์ ์ดํดํ๊ณ , ํ๋จํ๊ณ , ์ ์ ํ ํค์ผ๋ก ๊ธ์ ์ฐ๋ ๊ฒ๊น์ง ๊ฐ๋ฅํด์ก์ฃ ! ๐
๐ง ์๋ํ ์์คํ ์ ํต์ฌ ๊ตฌ์ฑ ์์
์, ๊ทธ๋ผ ๋ณธ๊ฒฉ์ ์ผ๋ก ์ด๋ป๊ฒ ์ด๋ฐ ์์คํ
์ ๋ง๋ค ์ ์๋์ง ์์๋ณผ๊น์?
์๊ฐ๋ณด๋ค ๋ณต์กํ์ง ์์์! ํฌ๊ฒ 4๊ฐ์ง ํต์ฌ ์์๋ง ์ดํดํ๋ฉด ๋ฉ๋๋ค. ๐ฏ
1๏ธโฃ ๋ฌธ์ ์์ง ๋ฐ ์ ์ฒ๋ฆฌ ์์คํ
์ฒซ ๋ฒ์งธ ๋จ๊ณ๋ ๋ฌธ์๋ฅผ ์๋์ผ๋ก ์์งํ๋ ๊ฑฐ์์.
์ด๋ฉ์ผ ์ฒจ๋ถํ์ผ, ํด๋ผ์ฐ๋ ๋๋ผ์ด๋ธ, ์ฌ๋ด ์์คํ
๋ฑ ๋ค์ํ ๊ณณ์์ ๋ฌธ์๊ฐ ๋ค์ด์ฌ ์ ์์ฃ .
์ฌ๊ธฐ์ ์ค์ํ ๊ฑด ๋ค์ํ ํฌ๋งท์ ์ฒ๋ฆฌํ ์ ์์ด์ผ ํ๋ค๋ ์ ์ด์์!
PDF, DOCX, XLSX, TXT, ์ฌ์ง์ด ์ด๋ฏธ์ง ์ ํ
์คํธ(OCR)๊น์ง ๋ง์ด์ฃ . ๐
Python ๋ผ์ด๋ธ๋ฌ๋ฆฌ:
โข PyPDF2 / pdfplumber: PDF ํ์ผ ํ ์คํธ ์ถ์ถ
โข python-docx: Word ๋ฌธ์ ์ฒ๋ฆฌ
โข openpyxl / pandas: ์์ ํ์ผ ์ฒ๋ฆฌ
โข pytesseract: ์ด๋ฏธ์ง OCR (๊ดํ ๋ฌธ์ ์ธ์)
โข BeautifulSoup: ์น ํ์ด์ง ์คํฌ๋ํ
ํด๋ผ์ฐ๋ ์ฐ๋:
โข Google Drive API: ๊ตฌ๊ธ ๋๋ผ์ด๋ธ ์๋ ์ ๊ทผ
โข Dropbox API: ๋๋กญ๋ฐ์ค ํ์ผ ๋๊ธฐํ
โข OneDrive API: ๋ง์ดํฌ๋ก์ํํธ ํด๋ผ์ฐ๋ ์ฐ๋
โข AWS S3: ๋์ฉ๋ ํ์ผ ์ ์ฅ์
import pdfplumber
import os
def extract_text_from_pdf(pdf_path):
"""PDF ํ์ผ์์ ํ
์คํธ๋ฅผ ์ถ์ถํ๋ ํจ์"""
text_content = ""
try:
with pdfplumber.open(pdf_path) as pdf:
for page in pdf.pages:
text_content += page.extract_text() + "\n"
return text_content
except Exception as e:
print(f"์ค๋ฅ ๋ฐ์: {e}")
return None
# ์ฌ์ฉ ์์
pdf_file = "monthly_report.pdf"
extracted_text = extract_text_from_pdf(pdf_file)
print(f"์ถ์ถ๋ ํ
์คํธ ๊ธธ์ด: {len(extracted_text)} ๊ธ์")
์ด๋ ๊ฒ ์ถ์ถํ ํ
์คํธ๋ ๋ณดํต ์ ์ ๊ณผ์ ์ ๊ฑฐ์ณ์ผ ํด์.
๋ถํ์ํ ๊ณต๋ฐฑ, ํน์๋ฌธ์, ํ์ด์ง ๋ฒํธ ๊ฐ์ ๊ฒ๋ค์ ์ ๊ฑฐํ๋ ๊ฑฐ์ฃ .
์ด ๊ณผ์ ์ ์ ์ฒ๋ฆฌ(Preprocessing)๋ผ๊ณ ๋ถ๋ฆ
๋๋ค! ๐งน
2๏ธโฃ AI ๊ธฐ๋ฐ ๋ฌธ์ ์์ฝ ์์ง
์, ์ด์ ํต์ฌ ์ค์ ํต์ฌ! AI๊ฐ ๋ฌธ์๋ฅผ ์ฝ๊ณ ์์ฝํ๋ ๋ถ๋ถ์ด์์. ๐ค
์์ฆ์ OpenAI์ GPT-4, Anthropic์ Claude, Google์ Gemini ๊ฐ์
๊ฐ๋ ฅํ ์ธ์ด ๋ชจ๋ธ๋ค์ API๋ก ์ฝ๊ฒ ์ฌ์ฉํ ์ ์์ด์.
์ ๊ฐ ์ค์ ๋ก ํ๋ก์ ํธ์์ ์ฌ์ฉํด๋ณธ ๊ฒฐ๊ณผ, ๊ฐ ๋ชจ๋ธ๋ง๋ค ํน์ง์ด ์๋๋ผ๊ณ ์:
| AI ๋ชจ๋ธ | ์ฅ์ | ์ ํฉํ ์ฉ๋ | ๊ฐ๊ฒฉ๋ |
|---|---|---|---|
| GPT-4 Turbo | ๊ฐ์ฅ ๋ฐ์ด๋ ์ดํด๋ ฅ, ๋ค๊ตญ์ด ์ง์ | ๋ณต์กํ ๊ธฐ์ ๋ฌธ์, ๋ฒ๋ฅ ๋ฌธ์ | ์ค์ |
| Claude 3 Opus | ๊ธด ๋ฌธ์ ์ฒ๋ฆฌ ๋ฅ๋ ฅ, ์์ ์ฑ | ์ฅ๋ฌธ ๋ณด๊ณ ์, ํ์ ๋ ผ๋ฌธ | ์ค์ |
| GPT-3.5 Turbo | ๋น ๋ฅธ ์๋, ์ ๋ ดํ ๋น์ฉ | ์ผ๋ฐ ์ ๋ฌด ๋ฌธ์, ์ด๋ฉ์ผ | ์ |
| Gemini Pro | ๊ตฌ๊ธ ์ํ๊ณ ํตํฉ, ๋ฌด๋ฃ ํฐ์ด | ์คํํธ์ , ๊ฐ์ธ ํ๋ก์ ํธ | ์ |
๋ช ํํ ์ง์์ฌํญ์ ์ฃผ๋ ๊ฒ ์ค์ํฉ๋๋ค!
์ข์ ํ๋กฌํํธ ์์:
"๋ค์ ๋ณด๊ณ ์๋ฅผ ์ฝ๊ณ , 3๊ฐ์ง ํต์ฌ ํฌ์ธํธ๋ฅผ ์ถ์ถํด์ฃผ์ธ์.
๊ฐ ํฌ์ธํธ๋ ํ ๋ฌธ์ฅ์ผ๋ก ์์ฝํ๊ณ , ๊ตฌ์ฒด์ ์ธ ์์น๊ฐ ์๋ค๋ฉด ๋ฐ๋์ ํฌํจํด์ฃผ์ธ์.
์ ์ฒด ์์ฝ์ 200์ ์ด๋ด๋ก ์์ฑํด์ฃผ์ธ์."
์ด๋ ๊ฒ ๊ตฌ์ฒด์ ์ผ๋ก ์์ฒญํ๋ฉด ํจ์ฌ ์ผ๊ด๋ ๊ฒฐ๊ณผ๋ฅผ ์ป์ ์ ์์ด์! โจ
from openai import OpenAI
import os
client = OpenAI(api_key=os.environ.get("OPENAI_API_KEY"))
def summarize_document(text, max_length=200):
"""๋ฌธ์๋ฅผ AI๋ก ์์ฝํ๋ ํจ์"""
prompt = f"""
๋ค์ ๋ฌธ์๋ฅผ ๋ถ์ํ์ฌ ํต์ฌ ๋ด์ฉ์ ์์ฝํด์ฃผ์ธ์.
์๊ตฌ์ฌํญ:
1. 3๊ฐ์ง ์ฃผ์ ํฌ์ธํธ๋ฅผ ์ถ์ถ
2. ๊ฐ ํฌ์ธํธ๋ ํ ๋ฌธ์ฅ์ผ๋ก ํํ
3. ์ ์ฒด ์์ฝ์ {max_length}์ ์ด๋ด
4. ์ค์ํ ์์น๋ ๋ ์ง๋ ๋ฐ๋์ ํฌํจ
๋ฌธ์ ๋ด์ฉ:
{text[:4000]} # API ํ ํฐ ์ ํ ๊ณ ๋ ค
"""
try:
response = client.chat.completions.create(
model="gpt-4-turbo-preview",
messages=[
{"role": "system", "content": "๋น์ ์ ์ ๋ฌธ ๋ฌธ์ ์์ฝ ์ ๋ฌธ๊ฐ์
๋๋ค."},
{"role": "user", "content": prompt}
],
temperature=0.3, # ์ผ๊ด์ฑ์ ์ํด ๋ฎ์ ๊ฐ
max_tokens=500
)
summary = response.choices[0].message.content
return summary
except Exception as e:
print(f"์์ฝ ์ค ์ค๋ฅ ๋ฐ์: {e}")
return None
# ์ฌ์ฉ ์์
document_text = extract_text_from_pdf("report.pdf")
summary = summarize_document(document_text)
print("๐ ์์ฝ ๊ฒฐ๊ณผ:")
print(summary)
3๏ธโฃ ์ค๋งํธ ๋ฉ์ผ ์์ฑ ์์คํ
์์ฝ์ด ๋๋ฌ์ผ๋ฉด ์ด์ ๋ฉ์ผ์ ์์ฑํ ์ฐจ๋ก์์! ๐ง
์ฌ๊ธฐ์๋ AI์ ํ์ ๋น๋ฆด ์ ์์ด์.
๋จ์ํ ์์ฝ ๋ด์ฉ์ ๋ณต๋ถํ๋ ๊ฒ ์๋๋ผ,
์์ ์์ ๋ง๋ ํค๊ณผ ์คํ์ผ๋ก ๋ฉ์ผ์ ์์ฑํ๋ ๊ฑฐ์ฃ !
์๋ฅผ ๋ค์ด, ๊ฒฝ์์ง์๊ฒ ๋ณด๋ด๋ ๋ฉ์ผ๊ณผ ๋๋ฃ์๊ฒ ๋ณด๋ด๋ ๋ฉ์ผ์ ํค์ด ๋ฌ๋ผ์ผ ํ์์์? ๐
โข ๊ฒฝ์์ง์ฉ: ๊ฐ๊ฒฐํ๊ณ ํต์ฌ๋ง, ์์น ์ค์ฌ
โข ์ค๋ฌด์ง์ฉ: ์์ธํ ์ค๋ช , ์ก์ ์์ดํ ํฌํจ
โข ์ธ๋ถ ํํธ๋์ฉ: ๊ณต์์ ์ด๊ณ ์ ์คํ ํค
2. ๋์ ๋ณ์ ํ์ฉ
โข {์์ ์๋ช }, {๋ถ์๋ช }, {ํ๋ก์ ํธ๋ช } ๋ฑ ์๋ ์นํ
โข ๋ ์ง, ๊ธฐ๊ฐ, ์์น ๋ฑ ์ค์๊ฐ ๋ฐ์ดํฐ ๋ฐ์
3. A/B ํ ์คํ
โข ์ฌ๋ฌ ๋ฒ์ ์ ์ ๋ชฉ๊ณผ ๋ณธ๋ฌธ์ ํ ์คํธ
โข ์คํ์จ, ์๋ต๋ฅ ๋ฐ์ดํฐ ์์ง ๋ฐ ๊ฐ์
def generate_email(summary, recipient_type="general"):
"""์์ฝ ๋ด์ฉ์ ๋ฐํ์ผ๋ก ๋ฉ์ผ์ ์์ฑํ๋ ํจ์"""
# ์์ ์ ํ์
๋ณ ํค ์ค์
tone_instructions = {
"executive": "๊ฐ๊ฒฐํ๊ณ ์ ๋ฌธ์ ์ธ ํค. ํต์ฌ ์์น์ ๊ฒฐ๋ก ์ค์ฌ.",
"team": "์น๊ทผํ๊ณ ํ๋ ฅ์ ์ธ ํค. ์์ธํ ์ค๋ช
๊ณผ ๋ค์ ๋จ๊ณ ํฌํจ.",
"external": "๊ณต์์ ์ด๊ณ ์ ์คํ ํค. ๋ช
ํํ ์ ๋ณด ์ ๋ฌ."
}
tone = tone_instructions.get(recipient_type, "์ ๋ฌธ์ ์ด๊ณ ๋ช
ํํ ํค")
prompt = f"""
๋ค์ ์์ฝ ๋ด์ฉ์ ๋ฐํ์ผ๋ก ์ด๋ฉ์ผ์ ์์ฑํด์ฃผ์ธ์.
ํค: {tone}
์ด๋ฉ์ผ ๊ตฌ์กฐ:
1. ์ธ์ฌ๋ง
2. ๋ชฉ์ ์ค๋ช
(ํ ๋ฌธ์ฅ)
3. ์ฃผ์ ๋ด์ฉ (์์ฝ ๊ธฐ๋ฐ)
4. ๋ค์ ๋จ๊ณ ๋๋ ์์ฒญ์ฌํญ
5. ๋ง๋ฌด๋ฆฌ ์ธ์ฌ
์์ฝ ๋ด์ฉ:
{summary}
์ด๋ฉ์ผ ์ ๋ชฉ๋ ํจ๊ป ์ ์ํด์ฃผ์ธ์.
"""
try:
response = client.chat.completions.create(
model="gpt-4-turbo-preview",
messages=[
{"role": "system", "content": "๋น์ ์ ์ ๋ฌธ ๋น์ฆ๋์ค ์ปค๋ฎค๋์ผ์ด์
์ ๋ฌธ๊ฐ์
๋๋ค."},
{"role": "user", "content": prompt}
],
temperature=0.7, # ์ฐฝ์์ฑ์ ์ํด ์ฝ๊ฐ ๋์ ๊ฐ
max_tokens=800
)
email_content = response.choices[0].message.content
return email_content
except Exception as e:
print(f"๋ฉ์ผ ์์ฑ ์ค ์ค๋ฅ ๋ฐ์: {e}")
return None
# ์ฌ์ฉ ์์
email = generate_email(summary, recipient_type="executive")
print("๐ง ์์ฑ๋ ์ด๋ฉ์ผ:")
print(email)
4๏ธโฃ ์๋ ์ ์ก ๋ฐ ๋ชจ๋ํฐ๋ง ์์คํ
๋ง์ง๋ง ๋จ๊ณ! ์์ฑ๋ ๋ฉ์ผ์ ์ค์ ๋ก ๋ณด๋ด๋ ๋ถ๋ถ์ด์์. ๐ฎ
์ฌ๊ธฐ์๋ ์ด๋ฉ์ผ API๋ฅผ ์ฌ์ฉํ๊ฒ ๋๋๋ฐ, ์ฃผ๋ก ์ฌ์ฉ๋๋ ์๋น์ค๋ค์ ์ด๋ฐ ๊ฒ ์์ด์:
1. Gmail API (Google Workspace)
โข ์ฅ์ : ๋ฌด๋ฃ ํฐ์ด ๋๋ํจ, ๊ตฌ๊ธ ์ํ๊ณ ํตํฉ
โข ๋จ์ : OAuth ์ธ์ฆ ์ค์ ์ด ๋ค์ ๋ณต์ก
โข ์ผ์ผ ์ ์ก ์ ํ: 2,000ํต (์ผ๋ฐ), 10,000ํต (Workspace)
2. SendGrid
โข ์ฅ์ : ์ ๋ฌธ ์ด๋ฉ์ผ ์๋น์ค, ์์ธํ ๋ถ์ ์ ๊ณต
โข ๋จ์ : ๋ฌด๋ฃ ํฐ์ด๋ 100ํต/์ผ
โข ์ถ์ฒ: ๋ง์ผํ ์ด๋ฉ์ผ, ๋๋ ๋ฐ์ก
3. Amazon SES
โข ์ฅ์ : ๋งค์ฐ ์ ๋ ดํ ๋น์ฉ (1,000ํต๋น $0.10)
โข ๋จ์ : AWS ์ค์ ํ์, ์ด๊ธฐ ์๋๋ฐ์ค ์ ํ
โข ์ถ์ฒ: ๋๊ท๋ชจ ์์คํ , ๋น์ฉ ์ต์ ํ
4. Microsoft Graph API (Outlook)
โข ์ฅ์ : Office 365 ํตํฉ, ๊ธฐ์ ํ๊ฒฝ์ ์ ํฉ
โข ๋จ์ : ๋ผ์ด์ ์ค ํ์
โข ์ถ์ฒ: ๋ง์ดํฌ๋ก์ํํธ ์ค์ฌ ๊ธฐ์
from google.oauth2.credentials import Credentials
from googleapiclient.discovery import build
from email.mime.text import MIMEText
from email.mime.multipart import MIMEMultipart
import base64
def send_email_via_gmail(to_email, subject, body, cc_list=None):
"""Gmail API๋ฅผ ์ฌ์ฉํ์ฌ ์ด๋ฉ์ผ์ ์ ์กํ๋ ํจ์"""
try:
# Gmail API ์๋น์ค ์์ฑ
service = build('gmail', 'v1', credentials=creds)
# ์ด๋ฉ์ผ ๋ฉ์์ง ์์ฑ
message = MIMEMultipart()
message['To'] = to_email
message['Subject'] = subject
if cc_list:
message['Cc'] = ', '.join(cc_list)
# HTML ๋ณธ๋ฌธ ์ถ๊ฐ
html_body = MIMEText(body, 'html')
message.attach(html_body)
# ๋ฉ์์ง ์ธ์ฝ๋ฉ
raw_message = base64.urlsafe_b64encode(
message.as_bytes()
).decode('utf-8')
# ์ ์ก
send_message = service.users().messages().send(
userId='me',
body={'raw': raw_message}
).execute()
print(f"โ
๋ฉ์ผ ์ ์ก ์ฑ๊ณต! Message ID: {send_message['id']}")
return send_message['id']
except Exception as e:
print(f"โ ๋ฉ์ผ ์ ์ก ์คํจ: {e}")
return None
# ์ฌ์ฉ ์์
message_id = send_email_via_gmail(
to_email="team@company.com",
subject="[์๋๋ฐ์ก] ์ฃผ๊ฐ ๋ณด๊ณ ์ ์์ฝ",
body=email_content,
cc_list=["manager@company.com"]
)
1. API ํค ๊ด๋ฆฌ
โข ์ ๋ ์ฝ๋์ ์ง์ ํ๋์ฝ๋ฉํ์ง ๋ง ๊ฒ
โข ํ๊ฒฝ ๋ณ์๋ ๋น๋ฐ ๊ด๋ฆฌ ์๋น์ค ์ฌ์ฉ (AWS Secrets Manager, Azure Key Vault ๋ฑ)
โข ์ ๊ธฐ์ ์ผ๋ก ํค ๋กํ ์ด์
2. ๋ฐ์ดํฐ ์ํธํ
โข ๋ฏผ๊ฐํ ๋ฌธ์๋ ์ ์ก ๋ฐ ์ ์ฅ ์ ์ํธํ
โข HTTPS/TLS ์ฌ์ฉ ํ์
โข ๋ก์ปฌ ์ ์ฅ ์ ์ํธํ ๋ผ์ด๋ธ๋ฌ๋ฆฌ ํ์ฉ
3. ์ ๊ทผ ๊ถํ ๊ด๋ฆฌ
โข ์ต์ ๊ถํ ์์น ์ ์ฉ
โข ์ฌ์ฉ์๋ณ ๊ถํ ๋ ๋ฒจ ์ค์
โข ๊ฐ์ฌ ๋ก๊ทธ ๊ธฐ๋ก
4. GDPR ๋ฐ ๊ฐ์ธ์ ๋ณด๋ณดํธ๋ฒ ์ค์
โข ๊ฐ์ธ์ ๋ณด ์ฒ๋ฆฌ ๋์ ํ๋ณด
โข ๋ฐ์ดํฐ ๋ณด๊ด ๊ธฐ๊ฐ ์ค์
โข ์ญ์ ์์ฒญ ์ฒ๋ฆฌ ํ๋ก์ธ์ค ๊ตฌ์ถ
๐๏ธ ์ค์ ํ๋ก์ ํธ: ๋จ๊ณ๋ณ ๊ตฌ์ถ ๊ฐ์ด๋
์, ์ด์ ์ด๋ก ์ ์ถฉ๋ถํ ๋ฐฐ์ ์ผ๋ ์ค์ ๋ก ์์คํ
์ ๋ง๋ค์ด๋ณผ๊น์? ๐ ๏ธ
์ ๊ฐ ์ค์ ๋ก ๊ตฌ์ถํ๋ ํ๋ก์ ํธ๋ฅผ ๋ฐํ์ผ๋ก ๋จ๊ณ๋ณ๋ก ์ค๋ช
๋๋ฆด๊ฒ์!
์ด ํ๋ก์ ํธ๋ ๋งค์ผ ์์นจ 9์์ ์ ๋ ์ ํ๋งค ๋ณด๊ณ ์๋ฅผ ์๋์ผ๋ก ์์ฝํด์
๊ด๋ จ ๋ถ์์ ๋ฉ์ผ๋ก ๋ฐ์กํ๋ ์์คํ
์ด์์ด์. ๐
Step 1: ๊ฐ๋ฐ ํ๊ฒฝ ์ค์ ๐ฅ๏ธ
# requirements.txt ํ์ผ ์์ฑ
openai==1.12.0
google-auth==2.27.0
google-auth-oauthlib==1.2.0
google-auth-httplib2==0.2.0
google-api-python-client==2.116.0
pdfplumber==0.10.3
python-docx==1.1.0
pandas==2.2.0
python-dotenv==1.0.1
schedule==1.2.0
requests==2.31.0
# ์ค์น ๋ช
๋ น์ด
pip install -r requirements.txt
document-automation/ โ โโโ config/ โ โโโ settings.py # ์ค์ ํ์ผ โ โโโ credentials.json # API ์ธ์ฆ ์ ๋ณด โ โโโ src/ โ โโโ document_processor.py # ๋ฌธ์ ์ฒ๋ฆฌ ๋ชจ๋ โ โโโ ai_summarizer.py # AI ์์ฝ ๋ชจ๋ โ โโโ email_generator.py # ๋ฉ์ผ ์์ฑ ๋ชจ๋ โ โโโ email_sender.py # ๋ฉ์ผ ์ ์ก ๋ชจ๋ โ โโโ scheduler.py # ์ค์ผ์ค๋ฌ โ โโโ templates/ โ โโโ email_template.html # ๋ฉ์ผ ํ ํ๋ฆฟ โ โโโ summary_template.txt # ์์ฝ ํ ํ๋ฆฟ โ โโโ logs/ โ โโโ automation.log # ๋ก๊ทธ ํ์ผ โ โโโ data/ โ โโโ input/ # ์ ๋ ฅ ๋ฌธ์ โ โโโ processed/ # ์ฒ๋ฆฌ๋ ๋ฌธ์ โ โโโ tests/ โ โโโ test_automation.py # ํ ์คํธ ์ฝ๋ โ โโโ main.py # ๋ฉ์ธ ์คํ ํ์ผ โโโ requirements.txt โโโ README.md
Step 2: ๋ฌธ์ ์ฒ๋ฆฌ ๋ชจ๋ ๊ตฌํ ๐
import pdfplumber
import docx
import os
from pathlib import Path
import logging
class DocumentProcessor:
"""๋ค์ํ ํ์์ ๋ฌธ์๋ฅผ ์ฒ๋ฆฌํ๋ ํด๋์ค"""
def __init__(self, input_dir="data/input"):
self.input_dir = Path(input_dir)
self.logger = logging.getLogger(__name__)
def process_all_documents(self):
"""์
๋ ฅ ํด๋์ ๋ชจ๋ ๋ฌธ์๋ฅผ ์ฒ๋ฆฌ"""
documents = []
for file_path in self.input_dir.glob("*"):
if file_path.suffix.lower() in ['.pdf', '.docx', '.txt']:
text = self.extract_text(file_path)
if text:
documents.append({
'filename': file_path.name,
'content': text,
'file_type': file_path.suffix
})
self.logger.info(f"์ฒ๋ฆฌ ์๋ฃ: {file_path.name}")
return documents
def extract_text(self, file_path):
"""ํ์ผ ํ์์ ๋ฐ๋ผ ํ
์คํธ ์ถ์ถ"""
try:
if file_path.suffix.lower() == '.pdf':
return self._extract_from_pdf(file_path)
elif file_path.suffix.lower() == '.docx':
return self._extract_from_docx(file_path)
elif file_path.suffix.lower() == '.txt':
return self._extract_from_txt(file_path)
else:
self.logger.warning(f"์ง์ํ์ง ์๋ ํ์ผ ํ์: {file_path}")
return None
except Exception as e:
self.logger.error(f"ํ
์คํธ ์ถ์ถ ์ค๋ฅ ({file_path}): {e}")
return None
def _extract_from_pdf(self, file_path):
"""PDF์์ ํ
์คํธ ์ถ์ถ"""
text = ""
with pdfplumber.open(file_path) as pdf:
for page in pdf.pages:
text += page.extract_text() + "\n"
return self._clean_text(text)
def _extract_from_docx(self, file_path):
"""Word ๋ฌธ์์์ ํ
์คํธ ์ถ์ถ"""
doc = docx.Document(file_path)
text = "\n".join([paragraph.text for paragraph in doc.paragraphs])
return self._clean_text(text)
def _extract_from_txt(self, file_path):
"""ํ
์คํธ ํ์ผ ์ฝ๊ธฐ"""
with open(file_path, 'r', encoding='utf-8') as f:
text = f.read()
return self._clean_text(text)
def _clean_text(self, text):
"""ํ
์คํธ ์ ์ """
# ์ฐ์๋ ๊ณต๋ฐฑ ์ ๊ฑฐ
text = ' '.join(text.split())
# ์ฐ์๋ ์ค๋ฐ๊ฟ ์ ๊ฑฐ
text = '\n'.join([line.strip() for line in text.split('\n') if line.strip()])
return text
Step 3: AI ์์ฝ ๋ชจ๋ ๊ตฌํ ๐ค
from openai import OpenAI
import os
from dotenv import load_dotenv
import logging
load_dotenv()
class AISummarizer:
"""OpenAI API๋ฅผ ์ฌ์ฉํ ๋ฌธ์ ์์ฝ ํด๋์ค"""
def __init__(self):
self.client = OpenAI(api_key=os.getenv("OPENAI_API_KEY"))
self.logger = logging.getLogger(__name__)
def summarize(self, text, summary_type="executive"):
"""๋ฌธ์๋ฅผ ์์ฝํ๋ ๋ฉ์ธ ํจ์"""
# ํ
์คํธ๊ฐ ๋๋ฌด ๊ธธ๋ฉด ์ฒญํฌ๋ก ๋๋๊ธฐ
if len(text) > 12000:
return self._summarize_long_document(text, summary_type)
else:
return self._summarize_single(text, summary_type)
def _summarize_single(self, text, summary_type):
"""๋จ์ผ ์์ฝ ์ํ"""
prompts = {
"executive": """
๋ค์ ๋ฌธ์๋ฅผ ๊ฒฝ์์ง์ ์ํ ์์ฝ์ผ๋ก ์์ฑํด์ฃผ์ธ์.
์๊ตฌ์ฌํญ:
- 3-5๊ฐ์ ํต์ฌ ํฌ์ธํธ
- ๊ฐ ํฌ์ธํธ๋ ํ ๋ฌธ์ฅ์ผ๋ก
- ์ค์ํ ์์น์ ๋ ์ง ํฌํจ
- ์ ์ฒด 200์ ์ด๋ด
- ๊ฒฐ๋ก ๊ณผ ๊ถ์ฅ์ฌํญ ํฌํจ
""",
"detailed": """
๋ค์ ๋ฌธ์๋ฅผ ์์ธํ๊ฒ ์์ฝํด์ฃผ์ธ์.
์๊ตฌ์ฌํญ:
- ์ฃผ์ ์น์
๋ณ๋ก ๊ตฌ๋ถ
- ๊ตฌ์ฒด์ ์ธ ๋ด์ฉ๊ณผ ๋งฅ๋ฝ ํฌํจ
- ์ค์ํ ๋ฐ์ดํฐ์ ํต๊ณ ๋ชจ๋ ํฌํจ
- 500์ ์ด๋ด
""",
"brief": """
๋ค์ ๋ฌธ์๋ฅผ ๊ฐ๋จํ ์์ฝํด์ฃผ์ธ์.
์๊ตฌ์ฌํญ:
- ํต์ฌ ๋ฉ์์ง 1-2๊ฐ
- 100์ ์ด๋ด
- ์ฆ์ ์ดํด ๊ฐ๋ฅํ ํํ
"""
}
prompt = prompts.get(summary_type, prompts["executive"])
try:
response = self.client.chat.completions.create(
model="gpt-4-turbo-preview",
messages=[
{
"role": "system",
"content": "๋น์ ์ ์ ๋ฌธ ๋ฌธ์ ๋ถ์๊ฐ์
๋๋ค. ๋ช
ํํ๊ณ ๊ฐ๊ฒฐํ ์์ฝ์ ์ ๊ณตํฉ๋๋ค."
},
{
"role": "user",
"content": f"{prompt}\n\n๋ฌธ์ ๋ด์ฉ:\n{text}"
}
],
temperature=0.3,
max_tokens=1000
)
summary = response.choices[0].message.content
self.logger.info(f"์์ฝ ์๋ฃ (ํ์
: {summary_type})")
return summary
except Exception as e:
self.logger.error(f"์์ฝ ์ค ์ค๋ฅ: {e}")
return None
def _summarize_long_document(self, text, summary_type):
"""๊ธด ๋ฌธ์๋ฅผ ์ฒญํฌ๋ก ๋๋์ด ์์ฝ"""
# ํ
์คํธ๋ฅผ ์ฒญํฌ๋ก ๋ถํ
chunk_size = 10000
chunks = [text[i:i+chunk_size] for i in range(0, len(text), chunk_size)]
# ๊ฐ ์ฒญํฌ ์์ฝ
chunk_summaries = []
for i, chunk in enumerate(chunks):
self.logger.info(f"์ฒญํฌ {i+1}/{len(chunks)} ์์ฝ ์ค...")
summary = self._summarize_single(chunk, "brief")
if summary:
chunk_summaries.append(summary)
# ์ฒญํฌ ์์ฝ๋ค์ ๋ค์ ์ข
ํฉ ์์ฝ
combined_text = "\n\n".join(chunk_summaries)
final_summary = self._summarize_single(combined_text, summary_type)
return final_summary
def extract_key_points(self, text, num_points=5):
"""ํต์ฌ ํฌ์ธํธ๋ง ์ถ์ถ"""
prompt = f"""
๋ค์ ๋ฌธ์์์ ๊ฐ์ฅ ์ค์ํ {num_points}๊ฐ์ง ํฌ์ธํธ๋ฅผ ์ถ์ถํด์ฃผ์ธ์.
๊ฐ ํฌ์ธํธ๋ ํ ๋ฌธ์ฅ์ผ๋ก ์์ฑํ๊ณ , ๋ฒํธ๋ฅผ ๋งค๊ฒจ์ฃผ์ธ์.
๋ฌธ์ ๋ด์ฉ:
{text[:8000]}
"""
try:
response = self.client.chat.completions.create(
model="gpt-3.5-turbo",
messages=[
{"role": "system", "content": "ํต์ฌ ํฌ์ธํธ ์ถ์ถ ์ ๋ฌธ๊ฐ"},
{"role": "user", "content": prompt}
],
temperature=0.2,
max_tokens=500
)
key_points = response.choices[0].message.content
return key_points
except Exception as e:
self.logger.error(f"ํต์ฌ ํฌ์ธํธ ์ถ์ถ ์ค๋ฅ: {e}")
return None
Step 4: ๋ฉ์ผ ์์ฑ ๋ฐ ์ ์ก ๋ชจ๋ ๐
from datetime import datetime
import logging
class EmailGenerator:
"""์ด๋ฉ์ผ ์ฝํ
์ธ ๋ฅผ ์์ฑํ๋ ํด๋์ค"""
def __init__(self, template_path="templates/email_template.html"):
self.template_path = template_path
self.logger = logging.getLogger(__name__)
def generate_email(self, summary, document_info, recipient_type="general"):
"""์์ฝ์ ๋ฐํ์ผ๋ก ์ด๋ฉ์ผ ์์ฑ"""
subject = self._generate_subject(document_info)
body = self._generate_body(summary, document_info, recipient_type)
return {
'subject': subject,
'body': body,
'timestamp': datetime.now().isoformat()
}
def _generate_subject(self, document_info):
"""์ด๋ฉ์ผ ์ ๋ชฉ ์์ฑ"""
date_str = datetime.now().strftime("%Y-%m-%d")
doc_name = document_info.get('filename', '๋ฌธ์')
return f"[์๋๋ฐ์ก] {doc_name} ์์ฝ - {date_str}"
def _generate_body(self, summary, document_info, recipient_type):
"""์ด๋ฉ์ผ ๋ณธ๋ฌธ ์์ฑ"""
# HTML ํ
ํ๋ฆฟ ๋ก๋
try:
with open(self.template_path, 'r', encoding='utf-8') as f:
template = f.read()
except:
# ํ
ํ๋ฆฟ์ด ์์ผ๋ฉด ๊ธฐ๋ณธ HTML ์ฌ์ฉ
template = self._get_default_template()
# ๋ณ์ ์นํ
body = template.format(
recipient_type=recipient_type,
summary=summary,
document_name=document_info.get('filename', '๋ฌธ์'),
date=datetime.now().strftime("%Y๋
%m์ %d์ผ"),
file_type=document_info.get('file_type', 'N/A')
)
return body
def _get_default_template(self):
"""๊ธฐ๋ณธ ์ด๋ฉ์ผ ํ
ํ๋ฆฟ"""
return """
<!DOCTYPE html>
<html>
<head>
<style>.tx-header{background:linear-gradient(135deg,#f5f7fa 0%,#e8ecf1 100%);
border-radius:16px;
padding:40px;
text-align:center;
margin-bottom:40px;
box-shadow:0 4px 15px rgba(0,0,0,0.08);}
.tx-section{margin:50px 0;
line-height:1.9;}
.tx-highlight{background:linear-gradient(120deg,#fff3cd 0%,#fff9e6 100%);
padding:25px;
border-radius:12px;
border-left:5px solid #ffc107;
margin:30px 0;
box-shadow:0 2px 10px rgba(0,0,0,0.05);}
.tx-tip-box{background:linear-gradient(135deg,#e3f2fd 0%,#f0f7ff 100%);
padding:25px;
border-radius:12px;
margin:30px 0;
border-left:5px solid #2196f3;
box-shadow:0 2px 10px rgba(0,0,0,0.05);}
.tx-warning-box{background:linear-gradient(135deg,#fff3e0 0%,#fff8f0 100%);
padding:25px;
border-radius:12px;
margin:30px 0;
border-left:5px solid #ff9800;
box-shadow:0 2px 10px rgba(0,0,0,0.05);}
.tx-step{background:#ffffff;
padding:20px;
border-radius:10px;
margin:20px 0;
border:2px solid #e9ecef;
box-shadow:0 2px 8px rgba(0,0,0,0.04);}
.tx-table-wrap{overflow-x:auto;
margin:30px 0;}
.tx-table{width:100%;
border-collapse:collapse;
background:#fff;
border-radius:10px;
overflow:hidden;
box-shadow:0 2px 10px rgba(0,0,0,0.05);}
.tx-table th{background:linear-gradient(135deg,#667eea 0%,#764ba2 100%);
color:#fff;
padding:15px;
text-align:left;
font-weight:600;}
.tx-table td{padding:15px;
border-bottom:1px solid #e9ecef;}
.tx-table tr:hover{background:#f8f9fa;}
.tx-subtitle{color:#667eea;
font-size:1.3em;
font-weight:700;
margin:40px 0 20px 0;
padding-left:15px;
border-left:4px solid #667eea;}
.tx-emphasis{color:#764ba2;
font-weight:700;}
.tx-svg-container{text-align:center;
margin:40px 0;}</style>
</head>
<body>
<div class="container">
<div class="header">
<h2>๐ ๋ฌธ์ ์์ฝ ์๋ ๋ฐ์ก</h2>
<p>{date}</p>
</div>
<div class="content">
<h3>๐ ๋ฌธ์ ์ ๋ณด</h3>
<p><strong>ํ์ผ๋ช
:</strong> {document_name}</p>
<p><strong>ํ์:</strong> {file_type}</p>
<h3>๐ ์์ฝ ๋ด์ฉ</h3>
<div style="background: white; padding: 15px; border-radius: 5px;">
{summary}
</div>
</div>
<div class="footer">
<p>์ด ๋ฉ์ผ์ ์๋ํ ์์คํ
์ ์ํด ๋ฐ์ก๋์์ต๋๋ค.</p>
<p>๋ฌธ์์ฌํญ์ด ์์ผ์๋ฉด IT ์ง์ํ์ผ๋ก ์ฐ๋ฝ์ฃผ์ธ์.</p>
</div>
</div>
</body>
</html>
"""
Step 5: ์ค์ผ์ค๋ฌ ๋ฐ ๋ฉ์ธ ๋ก์ง โฐ
import schedule
import time
import logging
from datetime import datetime
from pathlib import Path
from src.document_processor import DocumentProcessor
from src.ai_summarizer import AISummarizer
from src.email_generator import EmailGenerator
from src.email_sender import EmailSender
# ๋ก๊น
์ค์
logging.basicConfig(
level=logging.INFO,
format='%(asctime)s - %(name)s - %(levelname)s - %(message)s',
handlers=[
logging.FileHandler('logs/automation.log'),
logging.StreamHandler()
]
)
logger = logging.getLogger(__name__)
class DocumentAutomationSystem:
"""๋ฌธ์ ์๋ํ ์์คํ
๋ฉ์ธ ํด๋์ค"""
def __init__(self):
self.doc_processor = DocumentProcessor()
self.summarizer = AISummarizer()
self.email_generator = EmailGenerator()
self.email_sender = EmailSender()
logger.info("์๋ํ ์์คํ
์ด๊ธฐํ ์๋ฃ")
def run_automation(self):
"""์๋ํ ํ๋ก์ธ์ค ์คํ"""
logger.info("=" * 50)
logger.info("์๋ํ ํ๋ก์ธ์ค ์์")
logger.info(f"์คํ ์๊ฐ: {datetime.now()}")
try:
# 1๋จ๊ณ: ๋ฌธ์ ์ฒ๋ฆฌ
logger.info("1๋จ๊ณ: ๋ฌธ์ ์ฒ๋ฆฌ ์ค...")
documents = self.doc_processor.process_all_documents()
if not documents:
logger.warning("์ฒ๋ฆฌํ ๋ฌธ์๊ฐ ์์ต๋๋ค.")
return
logger.info(f"์ด {len(documents)}๊ฐ ๋ฌธ์ ๋ฐ๊ฒฌ")
# 2๋จ๊ณ: ๊ฐ ๋ฌธ์ ์์ฝ ๋ฐ ๋ฉ์ผ ๋ฐ์ก
for doc in documents:
logger.info(f"\n์ฒ๋ฆฌ ์ค: {doc['filename']}")
# ์์ฝ ์์ฑ
logger.info("2๋จ๊ณ: AI ์์ฝ ์์ฑ ์ค...")
summary = self.summarizer.summarize(
doc['content'],
summary_type="executive"
)
if not summary:
logger.error(f"์์ฝ ์คํจ: {doc['filename']}")
continue
# ๋ฉ์ผ ์์ฑ
logger.info("3๋จ๊ณ: ์ด๋ฉ์ผ ์์ฑ ์ค...")
email_content = self.email_generator.generate_email(
summary=summary,
document_info=doc,
recipient_type="team"
)
# ๋ฉ์ผ ๋ฐ์ก
logger.info("4๋จ๊ณ: ์ด๋ฉ์ผ ๋ฐ์ก ์ค...")
recipients = self._get_recipients(doc)
for recipient in recipients:
success = self.email_sender.send_email(
to_email=recipient['email'],
subject=email_content['subject'],
body=email_content['body']
)
if success:
logger.info(f"โ
๋ฐ์ก ์ฑ๊ณต: {recipient['email']}")
else:
logger.error(f"โ ๋ฐ์ก ์คํจ: {recipient['email']}")
# ์ฒ๋ฆฌ๋ ๋ฌธ์ ์ด๋
self._move_processed_document(doc['filename'])
logger.info("\n์๋ํ ํ๋ก์ธ์ค ์๋ฃ!")
logger.info("=" * 50)
except Exception as e:
logger.error(f"์๋ํ ํ๋ก์ธ์ค ์ค๋ฅ: {e}", exc_info=True)
def _get_recipients(self, document_info):
"""๋ฌธ์ ํ์
์ ๋ฐ๋ฅธ ์์ ์ ๋ชฉ๋ก ๋ฐํ"""
# ์ค์ ๋ก๋ ๋ฐ์ดํฐ๋ฒ ์ด์ค๋ ์ค์ ํ์ผ์์ ๊ฐ์ ธ์ด
return [
{'email': 'team@company.com', 'name': 'ํ'},
{'email': 'manager@company.com', 'name': '๋งค๋์ '}
]
def _move_processed_document(self, filename):
"""์ฒ๋ฆฌ๋ ๋ฌธ์๋ฅผ processed ํด๋๋ก ์ด๋"""
try:
source = Path(f"data/input/{filename}")
dest = Path(f"data/processed/{filename}")
source.rename(dest)
logger.info(f"๋ฌธ์ ์ด๋ ์๋ฃ: {filename}")
except Exception as e:
logger.error(f"๋ฌธ์ ์ด๋ ์คํจ: {e}")
def main():
"""๋ฉ์ธ ํจ์"""
system = DocumentAutomationSystem()
# ์ฆ์ ์คํ (ํ
์คํธ์ฉ)
# system.run_automation()
# ์ค์ผ์ค ์ค์
schedule.every().day.at("09:00").do(system.run_automation)
schedule.every().day.at("18:00").do(system.run_automation)
logger.info("์ค์ผ์ค๋ฌ ์์๋จ")
logger.info("์คํ ์๊ฐ: ๋งค์ผ 09:00, 18:00")
# ์ค์ผ์ค๋ฌ ์คํ
while True:
schedule.run_pending()
time.sleep(60) # 1๋ถ๋ง๋ค ์ฒดํฌ
if __name__ == "__main__":
main()
์ ๋ ์ฒ์์ ์ค์๋ฅผ ๋ง์ด ํ๊ฑฐ๋ ์. ๐
์ถ์ฒํ๋ ๊ตฌ์ถ ์์:
1์ฃผ์ฐจ: ๋ฌธ์ ์ฒ๋ฆฌ ๋ชจ๋๋ง ๊ตฌํํ๊ณ ํ ์คํธ
โ ๋ค์ํ ํ์ผ ํ์์ผ๋ก ์คํํด๋ณด๊ธฐ
2์ฃผ์ฐจ: AI ์์ฝ ๊ธฐ๋ฅ ์ถ๊ฐ
โ ํ๋กฌํํธ ํ๋์ ์๊ฐ ํฌ์ํ๊ธฐ
โ ์ฌ๋ฌ ๋ฌธ์๋ก ํ์ง ํ ์คํธ
3์ฃผ์ฐจ: ๋ฉ์ผ ์์ฑ ๋ฐ ์ ์ก ๊ธฐ๋ฅ
โ ๋จผ์ ์์ ์๊ฒ๋ง ํ ์คํธ ๋ฉ์ผ ๋ณด๋ด๊ธฐ
โ ํ ํ๋ฆฟ ๋์์ธ ๊ฐ์
4์ฃผ์ฐจ: ์ค์ผ์ค๋ฌ ๋ฐ ์๋ฌ ์ฒ๋ฆฌ
โ ๋ก๊น ์์คํ ๊ฐํ
โ ์์ธ ์ํฉ ๋์ ๋ก์ง ์ถ๊ฐ
์ด๋ ๊ฒ ๋จ๊ณ๋ณ๋ก ๊ตฌ์ถํ๋ฉด ๊ฐ ๋จ๊ณ์์ ๋ฌธ์ ๋ฅผ ๋ฐ๊ฒฌํ๊ณ ํด๊ฒฐํ ์ ์์ด์! ๐ฏ
๐ ๊ณ ๊ธ ๊ธฐ๋ฅ ์ถ๊ฐํ๊ธฐ
๊ธฐ๋ณธ ์์คํ
์ด ์์ฑ๋์๋ค๋ฉด, ์ด์ ๋ ์ค๋งํธํ ๊ธฐ๋ฅ๋ค์ ์ถ๊ฐํด๋ณผ ์ฐจ๋ก์์!
์ค์ ์
๋ฌด ํ๊ฒฝ์์ ์ ์ฉํ๊ฒ ์ฐ์ด๋ ๊ณ ๊ธ ๊ธฐ๋ฅ๋ค์ ์๊ฐํ ๊ฒ์. โจ
1๏ธโฃ ์ง๋ฅํ ์์ ์ ๋ถ๋ฅ ์์คํ ๐ฏ
๋ชจ๋ ์ฌ๋์๊ฒ ๊ฐ์ ๋ด์ฉ์ ๋ณด๋ด๋ ๊ฑด ๋นํจ์จ์ ์ด์ฃ ?
๋ฌธ์ ๋ด์ฉ์ ๋ถ์ํด์ ๊ด๋ จ ์๋ ์ฌ๋์๊ฒ๋ง ์๋์ผ๋ก ๋ฐ์กํ๋ ๊ธฐ๋ฅ์ด์์!
class SmartRecipientClassifier:
"""๋ฌธ์ ๋ด์ฉ ๊ธฐ๋ฐ ์์ ์ ์๋ ๋ถ๋ฅ"""
def __init__(self):
self.department_keywords = {
'sales': ['๋งค์ถ', 'ํ๋งค', '์์
', '๊ณ ๊ฐ', '๊ณ์ฝ'],
'marketing': ['๋ง์ผํ
', '๊ด๊ณ ', '์บ ํ์ธ', '๋ธ๋๋', 'SNS'],
'tech': ['๊ฐ๋ฐ', '์์คํ
', '์๋ฒ', '๋ฒ๊ทธ', '๋ฐฐํฌ'],
'hr': ['์ธ์ฌ', '์ฑ์ฉ', '๊ต์ก', '๋ณต์ง', 'ํ๊ฐ'],
'finance': ['์ฌ๋ฌด', 'ํ๊ณ', '์์ฐ', '๋น์ฉ', 'ํฌ์']
}
def classify_recipients(self, document_text, summary):
"""๋ฌธ์ ๋ด์ฉ์ ๋ถ์ํ์ฌ ๊ด๋ จ ๋ถ์ ํ์
"""
relevant_departments = []
# ํค์๋ ๊ธฐ๋ฐ ๋ถ์
for dept, keywords in self.department_keywords.items():
score = sum(1 for keyword in keywords
if keyword in document_text or keyword in summary)
if score >= 2: # 2๊ฐ ์ด์ ํค์๋ ๋งค์นญ
relevant_departments.append(dept)
# AI๋ฅผ ํ์ฉํ ์ถ๊ฐ ๋ถ์
if not relevant_departments:
relevant_departments = self._ai_classify(summary)
return relevant_departments
def _ai_classify(self, summary):
"""AI๋ก ๋ถ์ ๋ถ๋ฅ"""
prompt = f"""
๋ค์ ์์ฝ ๋ด์ฉ์ ์ฝ๊ณ , ์ด ์ ๋ณด๊ฐ ๊ฐ์ฅ ๊ด๋ จ ์๋ ๋ถ์๋ฅผ ์ ํํด์ฃผ์ธ์.
์ ํ์ง: sales, marketing, tech, hr, finance
์ฌ๋ฌ ๋ถ์๊ฐ ๊ด๋ จ๋ ์ ์์ผ๋ฉด ๋ชจ๋ ๋์ดํด์ฃผ์ธ์ (์ผํ๋ก ๊ตฌ๋ถ).
์์ฝ:
{summary}
๋ต๋ณ ํ์: ๋ถ์๋ช
๋ง (์: sales, marketing)
"""
# OpenAI API ํธ์ถ (์๋ต)
# ...
return ['sales', 'marketing'] # ์์ ๋ฐํ๊ฐ
2๏ธโฃ ๊ฐ์ฑ ๋ถ์ ๋ฐ ์ฐ์ ์์ ์ค์ ๐
๋ฌธ์์ ๊ธด๊ธ๋๋ ์ค์๋๋ฅผ ์๋์ผ๋ก ํ๋จํด์,
์ค์ํ ๋ด์ฉ์ ์ฆ์ ์๋ฆผ์ ๋ณด๋ด๊ณ , ์ผ๋ฐ์ ์ธ ๋ด์ฉ์ ์ผ์ผ ์์ฝ์ผ๋ก ๋ณด๋ด๋ ๊ธฐ๋ฅ์ด์์!
โข ํค์๋: "๊ธด๊ธ", "์ฆ์", "์ค๋ ์ค", "๋ง๊ฐ", "์๊ธฐ"
โข ์กฐ์น: ์ฆ์ SMS/์ฌ๋ ์๋ฆผ + ์ด๋ฉ์ผ
โข ์์ ์: ๊ด๋ จ ๋ถ์์ฅ + ๋ด๋น์
์ค์ (Important):
โข ํค์๋: "์ค์", "๊ฒํ ํ์", "์น์ธ", "๊ฒฐ์ "
โข ์กฐ์น: 2์๊ฐ ์ด๋ด ์ด๋ฉ์ผ ๋ฐ์ก
โข ์์ ์: ๊ด๋ จ ๋ถ์ ์ ์ฒด
์ผ๋ฐ (Normal):
โข ์ผ์์ ์ธ ๋ณด๊ณ ์, ์ ๋ฐ์ดํธ
โข ์กฐ์น: ์ผ์ผ ์์ฝ ๋ฉ์ผ์ ํฌํจ
โข ์์ ์: ๊ตฌ๋ ์ ๋ชฉ๋ก
3๏ธโฃ ๋์๋ณด๋ ๋ฐ ๋ถ์ ๋ฆฌํฌํธ ๐
์๋ํ ์์คํ
์ด ์ผ๋ง๋ ์ ์๋ํ๊ณ ์๋์ง ๋ชจ๋ํฐ๋งํ๋ ๊ฒ๋ ์ค์ํด์!
๊ฐ๋จํ ์น ๋์๋ณด๋๋ฅผ ๋ง๋ค์ด์ ์ค์๊ฐ์ผ๋ก ํ์ธํ ์ ์์ด์.
from flask import Flask, render_template, jsonify
import sqlite3
from datetime import datetime, timedelta
app = Flask(__name__)
class DashboardData:
"""๋์๋ณด๋ ๋ฐ์ดํฐ ๊ด๋ฆฌ"""
def __init__(self, db_path="automation.db"):
self.db_path = db_path
self._init_database()
def _init_database(self):
"""๋ฐ์ดํฐ๋ฒ ์ด์ค ์ด๊ธฐํ"""
conn = sqlite3.connect(self.db_path)
cursor = conn.cursor()
cursor.execute("""
CREATE TABLE IF NOT EXISTS automation_logs (
id INTEGER PRIMARY KEY AUTOINCREMENT,
timestamp DATETIME,
document_name TEXT,
status TEXT,
recipients_count INTEGER,
processing_time REAL
)
""")
conn.commit()
conn.close()
def get_statistics(self, days=7):
"""์ต๊ทผ ํต๊ณ ์กฐํ"""
conn = sqlite3.connect(self.db_path)
cursor = conn.cursor()
start_date = datetime.now() - timedelta(days=days)
# ์ด ์ฒ๋ฆฌ ๋ฌธ์ ์
cursor.execute("""
SELECT COUNT(*) FROM automation_logs
WHERE timestamp >= ?
""", (start_date,))
total_docs = cursor.fetchone()[0]
# ์ฑ๊ณต๋ฅ
cursor.execute("""
SELECT
COUNT(CASE WHEN status = 'success' THEN 1 END) * 100.0 / COUNT(*)
FROM automation_logs
WHERE timestamp >= ?
""", (start_date,))
success_rate = cursor.fetchone()[0] or 0
# ํ๊ท ์ฒ๋ฆฌ ์๊ฐ
cursor.execute("""
SELECT AVG(processing_time)
FROM automation_logs
WHERE timestamp >= ?
""", (start_date,))
avg_time = cursor.fetchone()[0] or 0
conn.close()
return {
'total_documents': total_docs,
'success_rate': round(success_rate, 2),
'average_processing_time': round(avg_time, 2),
'period_days': days
}
@app.route('/')
def dashboard():
"""๋์๋ณด๋ ๋ฉ์ธ ํ์ด์ง"""
data = DashboardData()
stats = data.get_statistics(days=7)
return render_template('dashboard.html', stats=stats)
@app.route('/api/stats')
def api_stats():
"""ํต๊ณ API"""
data = DashboardData()
stats = data.get_statistics(days=30)
return jsonify(stats)
if __name__ == '__main__':
app.run(debug=True, port=5000)
4๏ธโฃ ๋ค๊ตญ์ด ์ง์ ๐
๊ธ๋ก๋ฒ ๊ธฐ์
์ด๋ผ๋ฉด ๋ค๊ตญ์ด ์ง์๋ ํ์ํ๊ฒ ์ฃ ?
AI๋ฅผ ํ์ฉํ๋ฉด ์๋ ๋ฒ์ญ๋ ๊ฐ๋ฅํด์!
class MultilingualSupport:
"""๋ค๊ตญ์ด ์ง์ ํด๋์ค"""
def __init__(self):
self.supported_languages = {
'ko': 'ํ๊ตญ์ด',
'en': 'English',
'ja': 'ๆฅๆฌ่ช',
'zh': 'ไธญๆ'
}
def translate_summary(self, summary, target_language='en'):
"""์์ฝ์ ๋ชฉํ ์ธ์ด๋ก ๋ฒ์ญ"""
if target_language == 'ko':
return summary # ์๋ณธ์ด ํ๊ตญ์ด
prompt = f"""
๋ค์ ํ๊ตญ์ด ํ
์คํธ๋ฅผ {target_language}๋ก ๋ฒ์ญํด์ฃผ์ธ์.
๋น์ฆ๋์ค ๋ฌธ์ ์คํ์ผ์ ์ ์งํ๊ณ , ์ ๋ฌธ ์ฉ์ด๋ ์ ํํ๊ฒ ๋ฒ์ญํด์ฃผ์ธ์.
์๋ฌธ:
{summary}
"""
# OpenAI API ํธ์ถ
response = client.chat.completions.create(
model="gpt-4-turbo-preview",
messages=[
{"role": "system", "content": "์ ๋ฌธ ๋ฒ์ญ๊ฐ"},
{"role": "user", "content": prompt}
],
temperature=0.3
)
translated = response.choices[0].message.content
return translated
def send_multilingual_email(self, summary, recipients):
"""์์ ์ ์ธ์ด ์ค์ ์ ๋ง์ถฐ ์ด๋ฉ์ผ ๋ฐ์ก"""
for recipient in recipients:
lang = recipient.get('language', 'ko')
if lang != 'ko':
translated_summary = self.translate_summary(summary, lang)
else:
translated_summary = summary
# ์ด๋ฉ์ผ ๋ฐ์ก
self.send_email(
to=recipient['email'],
subject=f"[Auto] Document Summary ({lang.upper()})",
body=translated_summary
)
๐ฐ ๋น์ฉ ์ต์ ํ ์ ๋ต
AI API๋ฅผ ์ฌ์ฉํ๋ค ๋ณด๋ฉด ๋น์ฉ์ด ๊ฝค ๋์ฌ ์ ์์ด์.
ํนํ ๋๋์ ๋ฌธ์๋ฅผ ์ฒ๋ฆฌํ๋ ๊ฒฝ์ฐ์๋ ๋์ฑ ๊ทธ๋ ์ฃ ! ๐ธ
์ ๊ฐ ์ค์ ๋ก ์ ์ฉํด์ ์ ๋น์ฉ์ 70% ์ ๊ฐํ๋ ๋ฐฉ๋ฒ๋ค์ ๊ณต์ ํ ๊ฒ์!
| ์ต์ ํ ๋ฐฉ๋ฒ | ์ ๊ฐ ํจ๊ณผ | ๊ตฌํ ๋์ด๋ | ์ถ์ฒ๋ |
|---|---|---|---|
| ์บ์ฑ ์์คํ | 40-50% | ์ค | โญโญโญโญโญ |
| ๋ฐฐ์น ์ฒ๋ฆฌ | 20-30% | ํ | โญโญโญโญ |
| ๋ชจ๋ธ ์ ํ ์ต์ ํ | 30-40% | ํ | โญโญโญโญโญ |
| ํ ํฐ ์ฌ์ฉ๋ ์ต์ ํ | 15-25% | ์ค | โญโญโญโญ |
| ํ์ด๋ธ๋ฆฌ๋ ์ ๊ทผ | 25-35% | ์ | โญโญโญ |
1๏ธโฃ ์ค๋งํธ ์บ์ฑ ์์คํ ๐พ
๊ฐ์ ๋ฌธ์๋ฅผ ์ฌ๋ฌ ๋ฒ ์์ฝํ ํ์๋ ์์์์?
ํ ๋ฒ ์์ฝํ ๊ฒฐ๊ณผ๋ฅผ ์ ์ฅํด๋๊ณ ์ฌ์ฌ์ฉํ๋ ๊ฑฐ์์!
import hashlib
import json
import os
from datetime import datetime, timedelta
class SummaryCache:
"""์์ฝ ๊ฒฐ๊ณผ ์บ์ฑ ์์คํ
"""
def __init__(self, cache_dir="cache", ttl_days=7):
self.cache_dir = cache_dir
self.ttl_days = ttl_days
os.makedirs(cache_dir, exist_ok=True)
def get_cache_key(self, text):
"""ํ
์คํธ์ ํด์๊ฐ์ ์บ์ ํค๋ก ์ฌ์ฉ"""
return hashlib.md5(text.encode()).hexdigest()
def get(self, text):
"""์บ์์์ ์์ฝ ๊ฒฐ๊ณผ ์กฐํ"""
cache_key = self.get_cache_key(text)
cache_file = os.path.join(self.cache_dir, f"{cache_key}.json")
if not os.path.exists(cache_file):
return None
# ์บ์ ํ์ผ ์ฝ๊ธฐ
with open(cache_file, 'r', encoding='utf-8') as f:
cache_data = json.load(f)
# TTL ์ฒดํฌ
cached_time = datetime.fromisoformat(cache_data['timestamp'])
if datetime.now() - cached_time > timedelta(days=self.ttl_days):
os.remove(cache_file) # ๋ง๋ฃ๋ ์บ์ ์ญ์
return None
return cache_data['summary']
def set(self, text, summary):
"""์์ฝ ๊ฒฐ๊ณผ๋ฅผ ์บ์์ ์ ์ฅ"""
cache_key = self.get_cache_key(text)
cache_file = os.path.join(self.cache_dir, f"{cache_key}.json")
cache_data = {
'summary': summary,
'timestamp': datetime.now().isoformat(),
'text_length': len(text)
}
with open(cache_file, 'w', encoding='utf-8') as f:
json.dump(cache_data, f, ensure_ascii=False, indent=2)
def clear_expired(self):
"""๋ง๋ฃ๋ ์บ์ ํ์ผ ์ ๋ฆฌ"""
for filename in os.listdir(self.cache_dir):
filepath = os.path.join(self.cache_dir, filename)
with open(filepath, 'r') as f:
cache_data = json.load(f)
cached_time = datetime.fromisoformat(cache_data['timestamp'])
if datetime.now() - cached_time > timedelta(days=self.ttl_days):
os.remove(filepath)
# ์ฌ์ฉ ์์
cache = SummaryCache()
def summarize_with_cache(text):
"""์บ์๋ฅผ ํ์ฉํ ์์ฝ"""
# ์บ์ ํ์ธ
cached_summary = cache.get(text)
if cached_summary:
print("โ
์บ์์์ ์์ฝ ๊ฒฐ๊ณผ ๋ก๋!")
return cached_summary
# ์บ์ ๋ฏธ์ค - ์๋ก ์์ฝ
print("๐ ์๋ก์ด ์์ฝ ์์ฑ ์ค...")
summary = summarizer.summarize(text)
# ์บ์์ ์ ์ฅ
cache.set(text, summary)
return summary
โข ์ ์ ๋ฌธ์ (๊ณ์ฝ์, ๋งค๋ด์ผ): 30์ผ
โข ์ฃผ๊ธฐ์ ๋ณด๊ณ ์ (์ฃผ๊ฐ, ์๊ฐ): 7์ผ
โข ์ค์๊ฐ ๋ฐ์ดํฐ: 1์ผ ๋๋ ์บ์ฑ ์ ํจ
2. ์บ์ ์๋ฐ์
โข ์์ฃผ ์ฌ์ฉ๋๋ ๋ฌธ์๋ ๋ฏธ๋ฆฌ ์บ์ฑ
โข ์ผ๊ฐ ์๊ฐ๋์ ๋ฐฐ์น๋ก ์ฒ๋ฆฌ
3. ์บ์ ๋ฌดํจํ
โข ๋ฌธ์๊ฐ ์ ๋ฐ์ดํธ๋๋ฉด ์บ์ ์ญ์
โข ๋ฒ์ ๊ด๋ฆฌ ์์คํ ๊ณผ ์ฐ๋
2๏ธโฃ ๋ชจ๋ธ ์ ํ ์ต์ ํ ๐ฏ
๋ชจ๋ ์์
์ GPT-4๋ฅผ ์ธ ํ์๋ ์์ด์!
์์
์ ๋ณต์ก๋์ ๋ฐ๋ผ ์ ์ ํ ๋ชจ๋ธ์ ์ ํํ๋ฉด ๋น์ฉ์ ํฌ๊ฒ ์ค์ผ ์ ์์ด์.
โข ๋ณต์กํ ๊ธฐ์ ๋ฌธ์
โข ๋ฒ๋ฅ ๋ฌธ์
โข ๋ค๊ตญ์ด ๋ฒ์ญ
โข ๋น์ฉ: $0.01 / 1K tokens (input)
GPT-3.5 Turbo (๊ฐ์ฑ๋น ์ต๊ณ )
โข ์ผ๋ฐ ์ ๋ฌด ๋ฌธ์
โข ๊ฐ๋จํ ์์ฝ
โข ์ด๋ฉ์ผ ์์ฑ
โข ๋น์ฉ: $0.0005 / 1K tokens (input)
โ GPT-4 ๋๋น 20๋ฐฐ ์ ๋ ด!
Claude 3 Haiku (๋น ๋ฅด๊ณ ์ ๋ ด)
โข ๋๋ ๋ฌธ์ ์ฒ๋ฆฌ
โข ์ค์๊ฐ ์๋ต ํ์
โข ๋น์ฉ: $0.00025 / 1K tokens
๋ก์ปฌ ๋ชจ๋ธ (๋ฌด๋ฃ!)
โข Llama 2, Mistral ๋ฑ
โข ๋ฏผ๊ฐํ ๋ฐ์ดํฐ ์ฒ๋ฆฌ
โข ๋น์ฉ: ์๋ฒ ์ด์๋น๋ง
class SmartModelSelector:
"""์์
๋ณต์ก๋์ ๋ฐ๋ฅธ ๋ชจ๋ธ ์๋ ์ ํ"""
def __init__(self):
self.model_costs = {
'gpt-4-turbo': {'input': 0.01, 'output': 0.03},
'gpt-3.5-turbo': {'input': 0.0005, 'output': 0.0015},
'claude-3-haiku': {'input': 0.00025, 'output': 0.00125}
}
def select_model(self, text, task_type="summary"):
"""์ต์ ๋ชจ๋ธ ์ ํ"""
# ๋ฌธ์ ๋ณต์ก๋ ๋ถ์
complexity = self._analyze_complexity(text)
# ์์
ํ์
๋ณ ๋ชจ๋ธ ์ ํ
if task_type == "translation" or complexity == "high":
return "gpt-4-turbo"
elif task_type == "summary" and complexity == "medium":
return "gpt-3.5-turbo"
else:
return "claude-3-haiku"
def _analyze_complexity(self, text):
"""๋ฌธ์ ๋ณต์ก๋ ๋ถ์"""
# ๊ฐ๋จํ ํด๋ฆฌ์คํฑ
word_count = len(text.split())
# ์ ๋ฌธ ์ฉ์ด ๋น์จ
technical_terms = ['API', '์๊ณ ๋ฆฌ์ฆ', 'ํ๋กํ ์ฝ', '์ํคํ
์ฒ']
tech_ratio = sum(1 for term in technical_terms if term in text) / len(technical_terms)
# ๋ฌธ์ฅ ํ๊ท ๊ธธ์ด
sentences = text.split('.')
avg_sentence_length = sum(len(s.split()) for s in sentences) / len(sentences)
# ๋ณต์ก๋ ํ๋จ
if word_count > 5000 or tech_ratio > 0.5 or avg_sentence_length > 30:
return "high"
elif word_count > 2000 or tech_ratio > 0.3:
return "medium"
else:
return "low"
def estimate_cost(self, text, model):
"""์์ ๋น์ฉ ๊ณ์ฐ"""
token_count = len(text.split()) * 1.3 # ๋๋ต์ ์ธ ํ ํฐ ์
cost = (token_count / 1000) * self.model_costs[model]['input']
return round(cost, 4)
# ์ฌ์ฉ ์์
selector = SmartModelSelector()
def smart_summarize(text):
"""๋น์ฉ ์ต์ ํ๋ ์์ฝ"""
# ์ต์ ๋ชจ๋ธ ์ ํ
model = selector.select_model(text, task_type="summary")
estimated_cost = selector.estimate_cost(text, model)
print(f"์ ํ๋ ๋ชจ๋ธ: {model}")
print(f"์์ ๋น์ฉ: ${estimated_cost}")
# ์์ฝ ์คํ
summary = summarizer.summarize(text, model=model)
return summary
๐ ๋ณด์ ๋ฐ ์ปดํ๋ผ์ด์ธ์ค
์๋ํ ์์คํ
์ ์ด์ํ๋ค ๋ณด๋ฉด ๋ฏผ๊ฐํ ์ ๋ณด๋ฅผ ๋ค๋ฃจ๊ฒ ๋ ์ ์์ด์.
๋ณด์๊ณผ ๊ท์ ์ค์๋ ์ ํ์ด ์๋๋ผ ํ์์์! ๐ก๏ธ
โข ์ ์ก ์ค ์ํธํ: TLS/SSL ์ฌ์ฉ
โข ์ ์ฅ ์ ์ํธํ: AES-256 ๊ถ์ฅ
โข ๋ฐ์ดํฐ๋ฒ ์ด์ค ์ํธํ: ๋ฏผ๊ฐ ํ๋๋ ๋ณ๋ ์ํธํ
2. ์ ๊ทผ ์ ์ด
โข ์ญํ ๊ธฐ๋ฐ ์ ๊ทผ ์ ์ด (RBAC)
โข ๋ค๋จ๊ณ ์ธ์ฆ (MFA) ์ ์ฉ
โข IP ํ์ดํธ๋ฆฌ์คํธ ์ค์
3. ๊ฐ์ฌ ๋ก๊ทธ
โข ๋ชจ๋ ์์ ๊ธฐ๋ก
โข ๋ก๊ทธ ๋ณ์กฐ ๋ฐฉ์ง
โข ์ ๊ธฐ์ ์ธ ๋ก๊ทธ ๊ฒํ
4. ๊ท์ ์ค์
โข GDPR (์ ๋ฝ ๊ฐ์ธ์ ๋ณด๋ณดํธ๋ฒ)
โข CCPA (์บ๋ฆฌํฌ๋์ ์๋น์ ํ๋ผ์ด๋ฒ์๋ฒ)
โข ๊ฐ์ธ์ ๋ณด๋ณดํธ๋ฒ (ํ๊ตญ)
โข ISO 27001 ์ธ์ฆ ๊ณ ๋ ค
from cryptography.fernet import Fernet
import os
import logging
class SecureDocumentHandler:
"""๋ณด์์ด ๊ฐํ๋ ๋ฌธ์ ์ฒ๋ฆฌ ํด๋์ค"""
def __init__(self):
# ์ํธํ ํค ๋ก๋ (ํ๊ฒฝ ๋ณ์์์)
key = os.environ.get('ENCRYPTION_KEY')
if not key:
raise ValueError("์ํธํ ํค๊ฐ ์ค์ ๋์ง ์์์ต๋๋ค!")
self.cipher = Fernet(key.encode())
self.logger = logging.getLogger(__name__)
def encrypt_document(self, content):
"""๋ฌธ์ ๋ด์ฉ ์ํธํ"""
try:
encrypted = self.cipher.encrypt(content.encode())
self.logger.info("๋ฌธ์ ์ํธํ ์๋ฃ")
return encrypted
except Exception as e:
self.logger.error(f"์ํธํ ์คํจ: {e}")
raise
def decrypt_document(self, encrypted_content):
"""๋ฌธ์ ๋ด์ฉ ๋ณตํธํ"""
try:
decrypted = self.cipher.decrypt(encrypted_content)
self.logger.info("๋ฌธ์ ๋ณตํธํ ์๋ฃ")
return decrypted.decode()
except Exception as e:
self.logger.error(f"๋ณตํธํ ์คํจ: {e}")
raise
def sanitize_content(self, text):
"""๋ฏผ๊ฐ ์ ๋ณด ๋ง์คํน"""
import re
# ์ฃผ๋ฏผ๋ฑ๋ก๋ฒํธ ๋ง์คํน
text = re.sub(r'\d{6}-\d{7}', '******-*******', text)
# ์ด๋ฉ์ผ ๋ถ๋ถ ๋ง์คํน
text = re.sub(
r'([a-zA-Z0-9._%+-]+)@([a-zA-Z0-9.-]+\.[a-zA-Z]{2,})',
r'\1***@\2',
text
)
# ์ ํ๋ฒํธ ๋ง์คํน
text = re.sub(r'\d{3}-\d{4}-\d{4}', '***-****-****', text)
return text
def audit_log(self, action, user, document_id, details=None):
"""๊ฐ์ฌ ๋ก๊ทธ ๊ธฐ๋ก"""
log_entry = {
'timestamp': datetime.now().isoformat(),
'action': action,
'user': user,
'document_id': document_id,
'details': details,
'ip_address': self._get_client_ip()
}
# ๋ก๊ทธ๋ฅผ ๋ณ๋์ ๋ณด์ ๋ก๊ทธ ํ์ผ์ ๊ธฐ๋ก
with open('logs/audit.log', 'a') as f:
f.write(json.dumps(log_entry) + '\n')
self.logger.info(f"๊ฐ์ฌ ๋ก๊ทธ ๊ธฐ๋ก: {action} by {user}")
def _get_client_ip(self):
"""ํด๋ผ์ด์ธํธ IP ์ฃผ์ ์กฐํ"""
# ์ค์ ๊ตฌํ์์๋ ์์ฒญ ๊ฐ์ฒด์์ ๊ฐ์ ธ์ด
return "127.0.0.1"
๐ ์ค์ ํ์ฉ ์ฌ๋ก
์ด๋ก ๋ง ๋ฐฐ์ฐ๋ฉด ์ฌ๋ฏธ์์ฃ ? ๐
์ค์ ๋ก ์ด ์๋ํ ์์คํ
์ ์ด๋ป๊ฒ ํ์ฉํ๊ณ ์๋์ง ์ฌ๋ก๋ฅผ ๊ณต์ ํ ๊ฒ์!
์ฌ๋ก 1: ์คํํธ์ A์ฌ - ๊ณ ๊ฐ ํผ๋๋ฐฑ ์๋ ๋ถ์ ๐
โข ๋งค์ผ 100๊ฑด ์ด์์ ๊ณ ๊ฐ ํผ๋๋ฐฑ ์ ์
โข CSํ์ด ์๋์ผ๋ก ๋ถ๋ฅํ๊ณ ์์ฝํ๋ ๋ฐ ํ๋ฃจ 3์๊ฐ ์์
โข ์ค์ํ ์ด์๋ฅผ ๋์น๋ ๊ฒฝ์ฐ ๋ฐ์
๐ ๏ธ ๊ตฌํ ๋ด์ฉ
โข ๊ณ ๊ฐ ํผ๋๋ฐฑ ์๋ ์์ง (์ด๋ฉ์ผ, ์ฑํ , ์ค๋ฌธ)
โข AI๋ก ๊ฐ์ฑ ๋ถ์ ๋ฐ ์นดํ ๊ณ ๋ฆฌ ๋ถ๋ฅ
โข ๊ธด๊ธ ์ด์๋ ์ฆ์ ์ฌ๋ ์๋ฆผ
โข ์ผ๋ฐ ํผ๋๋ฐฑ์ ์ผ์ผ ์์ฝ ๋ฆฌํฌํธ
๐ ์ฑ๊ณผ
โข CSํ ์ ๋ฌด ์๊ฐ 70% ๊ฐ์
โข ๊ณ ๊ฐ ์๋ต ์๊ฐ 50% ๋จ์ถ
โข ๊ณ ๊ฐ ๋ง์กฑ๋ 15% ์์น
โข ์ฐ๊ฐ ์ฝ 3,000๋ง์ ์ธ๊ฑด๋น ์ ๊ฐ
์ฌ๋ก 2: ์ค๊ฒฌ๊ธฐ์ B์ฌ - ๊ณ์ฝ์ ๊ฒํ ์๋ํ ๐
โข ์ํ๊ท 50๊ฑด์ ๊ณ์ฝ์ ๊ฒํ
โข ๋ฒ๋ฌดํ์ด ๊ฐ ๊ณ์ฝ์๋น 2-3์๊ฐ ์์
โข ํ์ค ์กฐํญ ํ์ธ์ ๋ง์ ์๊ฐ ๋ญ๋น
๐ ๏ธ ๊ตฌํ ๋ด์ฉ
โข ๊ณ์ฝ์ ์๋ ์ ๋ก๋ ๋ฐ ํ ์คํธ ์ถ์ถ
โข AI๋ก ์ฃผ์ ์กฐํญ ์๋ ์ถ์ถ
โข ํ์ค ๊ณ์ฝ์์ ์ฐจ์ด์ ๋น๊ต
โข ๋ฆฌ์คํฌ ํญ๋ชฉ ์๋ ํ๋๊น
โข ๊ฒํ ์๊ฒฌ์ ์๋ ์์ฑ
๐ ์ฑ๊ณผ
โข ์ด๊ธฐ ๊ฒํ ์๊ฐ 80% ๊ฐ์
โข ๋ฒ๋ฌดํ์ด ๊ณ ์ํ ๊ณ์ฝ์ ์ง์ค ๊ฐ๋ฅ
โข ๊ณ์ฝ ์ฒด๊ฒฐ ์๋ 2๋ฐฐ ํฅ์
โข ์ฐ๊ฐ ์ฝ 5,000๋ง์ ๋น์ฉ ์ ๊ฐ
์ฌ๋ก 3: ๋๊ธฐ์ C์ฌ - ์ฐ๊ตฌ ๋ ผ๋ฌธ ๋ชจ๋ํฐ๋ง ๐ฌ
โข R&Dํ์ด ๋งค์ผ ์์ญ ๊ฐ์ ๋ ผ๋ฌธ ๋ชจ๋ํฐ๋ง ํ์
โข ๊ด๋ จ ๋ ผ๋ฌธ ์ฐพ๊ณ ์ฝ๋ ๋ฐ ํ๋ฃจ 2์๊ฐ ์์
โข ์ค์ํ ์ฐ๊ตฌ ๋ํฅ์ ๋์น๋ ๊ฒฝ์ฐ ๋ฐ์
๐ ๏ธ ๊ตฌํ ๋ด์ฉ
โข arXiv, PubMed ๋ฑ์์ ์๋ ๋ ผ๋ฌธ ์์ง
โข ํค์๋ ๊ธฐ๋ฐ ํํฐ๋ง
โข AI๋ก ์ด๋ก ์์ฝ ๋ฐ ๊ด๋ จ๋ ํ๊ฐ
โข ์ฃผ๊ฐ ํธ๋ ๋ ๋ฆฌํฌํธ ์๋ ์์ฑ
โข ๊ด๋ จ ์ฐ๊ตฌ์์๊ฒ ๋ง์ถค ์ถ์ฒ
๐ ์ฑ๊ณผ
โข ๋ ผ๋ฌธ ๋ชจ๋ํฐ๋ง ์๊ฐ 90% ๊ฐ์
โข ๊ด๋ จ ๋ ผ๋ฌธ ๋ฐ๊ฒฌ์จ 3๋ฐฐ ์ฆ๊ฐ
โข ์ฐ๊ตฌ ์์ฐ์ฑ 25% ํฅ์
โข ํนํ ์ถ์ ๊ฑด์ 40% ์ฆ๊ฐ
1. ๋ช ํํ ๋ฌธ์ ์ ์
โข "๋ฌด์์" ์๋ํํ ์ง ๊ตฌ์ฒด์ ์ผ๋ก ํ์
โข ํ์ฌ ํ๋ก์ธ์ค์ ๋ณ๋ชฉ ์ง์ ๋ถ์
2. ๋จ๊ณ์ ์ ๊ทผ
โข ์ฒ์๋ถํฐ ์๋ฒฝํ๊ฒ ๋ง๋ค๋ ค ํ์ง ์์
โข MVP(์ต์ ๊ธฐ๋ฅ ์ ํ)๋ถํฐ ์์
โข ํผ๋๋ฐฑ ๋ฐ์ผ๋ฉฐ ์ ์ง์ ๊ฐ์
3. ์ฌ๋๊ณผ AI์ ํ์
โข AI๊ฐ ๋ชจ๋ ๊ฑธ ๋์ฒดํ๋ ๊ฒ ์๋
โข ๋ฐ๋ณต์ ์ด๊ณ ์๊ฐ ์๋ชจ์ ์ธ ์์ ๋ง ์๋ํ
โข ์ฌ๋์ ํ๋จ๊ณผ ์์ฌ๊ฒฐ์ ์ ์ง์ค
4. ์ง์์ ์ธ ๋ชจ๋ํฐ๋ง
โข ์๋ํ ์์คํ ์ ์ฑ๋ฅ ์ถ์
โข ์ค๋ฅ์จ, ์ฒ๋ฆฌ ์๊ฐ, ์ฌ์ฉ์ ๋ง์กฑ๋ ์ธก์
โข ๋ฐ์ดํฐ ๊ธฐ๋ฐ ๊ฐ์
๐ ์ฌ๋ฅ๋ท์์ ์๋ํ ์ ๋ฌธ๊ฐ ์ฐพ๊ธฐ
์ฌ๊ธฐ๊น์ง ์ฝ์ผ์
จ๋ค๋ฉด ์๋ํ ์์คํ
๊ตฌ์ถ์ ๋ํด ๋ง์ด ๋ฐฐ์ฐ์
จ์ ๊ฑฐ์์! ๐
ํ์ง๋ง "์ด๋ก ์ ์๊ฒ ๋๋ฐ, ์ค์ ๋ก ์ฐ๋ฆฌ ํ์ฌ์ ์ ์ฉํ๋ ค๋ฉด ์ด๋ป๊ฒ ํด์ผ ํ์ง?" ํ๋ ๋ถ๋ค๋ ๊ณ์ค ๊ฑฐ์์.
๊ทธ๋ด ๋๋ ์ฌ๋ฅ๋ท(jaenung.net)์ ํ์ฉํด๋ณด์ธ์!
์๋ํ ์์คํ
๊ตฌ์ถ, AI ๊ฐ๋ฐ, ํ๋ก์ธ์ค ์ปจ์คํ
๋ฑ ๋ค์ํ ์ ๋ฌธ๊ฐ๋ค์ด ์์ด์. ๐ฏ
ํนํ ์ด๋ฐ ๋ถ๋ค์๊ฒ ์ถ์ฒ๋๋ ค์:
โข "์ฐ๋ฆฌ ํ์ฌ์ ๋ง๋ ์๋ํ๊ฐ ๊ฐ๋ฅํ์ง ๋จผ์ ํ์ธํ๊ณ ์ถ์ด์"
โข ์ฌ๋ฅ๋ท์์ ํ๋กํ ํ์ ๊ฐ๋ฐ ์ ๋ฌธ๊ฐ๋ฅผ ์ฐพ์๋ณด์ธ์
โข ๋น์ฉ: 50๋ง์~200๋ง์ (2-4์ฃผ)
2. ๊ธฐ์ ์ปจ์คํ ์ด ํ์ํ ๊ฒฝ์ฐ
โข "์ด๋ค ๊ธฐ์ ์คํ์ ์ ํํด์ผ ํ ์ง ๋ชจ๋ฅด๊ฒ ์ด์"
โข AI/์๋ํ ์ปจ์คํดํธ์ ์๋ดํด๋ณด์ธ์
โข ๋น์ฉ: ์๊ฐ๋น 5๋ง์~15๋ง์
3. ์ ์ฒด ์์คํ ๊ตฌ์ถ
โข "์ฒ์๋ถํฐ ๋๊น์ง ์์ฑ๋ ์์คํ ์ด ํ์ํด์"
โข ํ์คํ ๊ฐ๋ฐ์๋ ๊ฐ๋ฐํ์ ์ฐพ์๋ณด์ธ์
โข ๋น์ฉ: 500๋ง์~3,000๋ง์ (ํ๋ก์ ํธ ๊ท๋ชจ์ ๋ฐ๋ผ)
4. ์ ์ง๋ณด์ ๋ฐ ๊ฐ์
โข "์ด๋ฏธ ์์คํ ์ ์๋๋ฐ ๊ฐ์ ์ด ํ์ํด์"
โข ์ ์ง๋ณด์ ์ ๋ฌธ๊ฐ๋ฅผ ์ฐพ์๋ณด์ธ์
โข ๋น์ฉ: ์ 50๋ง์~200๋ง์
์ฌ๋ฅ๋ท์ ์ฅ์ ์ ๋ค์ํ ์ ๋ฌธ๊ฐ๋ฅผ ๋น๊ตํ๊ณ ์ ํํ ์ ์๋ค๋ ๊ฑฐ์์.
ํฌํธํด๋ฆฌ์ค, ๋ฆฌ๋ทฐ, ๊ฐ๊ฒฉ์ ๋ณด๊ณ ์ฐ๋ฆฌ ํ๋ก์ ํธ์ ๋ง๋ ์ฌ๋์ ์ฐพ์ ์ ์์ฃ ! ๐
๐ฏ ๋ง๋ฌด๋ฆฌํ๋ฉฐ
์, ์ฌ๊ธฐ๊น์ง ์ ๋ง ๊ธด ์ฌ์ ์ด์๋ค์! ๐
๋ฌธ์ ์์ฝ๋ถํฐ ๋ฉ์ผ ์ ์ก๊น์ง ์์ ์๋ํํ๋ ์์คํ
์ ๋ํด ์์๋ดค์ด์.
ํต์ฌ์ ๋ค์ ํ๋ฒ ์ ๋ฆฌํ๋ฉด:
โ ๋ฌธ์ ์์ง ๋ฐ ์ ์ฒ๋ฆฌ
โก AI ๊ธฐ๋ฐ ์์ฝ
โข ์ค๋งํธ ๋ฉ์ผ ์์ฑ
โฃ ์๋ ์ ์ก ๋ฐ ๋ชจ๋ํฐ๋ง
2. ์ฑ๊ณต์ ํต์ฌ ์์
โข ๋ช ํํ ๋ชฉํ ์ค์
โข ๋จ๊ณ์ ๊ตฌ์ถ
โข ์ง์์ ์ธ ๊ฐ์
โข ๋ณด์ ๋ฐ ์ปดํ๋ผ์ด์ธ์ค
3. ๋น์ฉ ์ต์ ํ
โข ์บ์ฑ ์์คํ ํ์ฉ
โข ์ ์ ํ ๋ชจ๋ธ ์ ํ
โข ๋ฐฐ์น ์ฒ๋ฆฌ
โข ํ์ด๋ธ๋ฆฌ๋ ์ ๊ทผ
4. ์ค์ ํ
โข ์๊ฒ ์์ํ๊ธฐ
โข ์ฌ์ฉ์ ํผ๋๋ฐฑ ์์ง
โข ๋ฐ์ดํฐ ๊ธฐ๋ฐ ์์ฌ๊ฒฐ์
โข ์ ๋ฌธ๊ฐ ๋์ ๋ฐ๊ธฐ (์ฌ๋ฅ๋ท ํ์ฉ!)
์๋ํ๋ ๋จ์ํ ์๊ฐ์ ์ ์ฝํ๋ ๊ฒ ์ด์์ ์๋ฏธ๊ฐ ์์ด์.
์ฌ๋๋ค์ด ๋ ์ฐฝ์์ ์ด๊ณ ์๋ฏธ ์๋ ์ผ์ ์ง์คํ ์ ์๊ฒ ํด์ฃผ์ฃ . ๐
์ ๊ฐ ์ฒ์ ์๋ํ ์์คํ
์ ๋ง๋ค์์ ๋๊ฐ ์๊ฐ๋๋ค์.
๋งค์ผ 2์๊ฐ์ฉ ํ๋ ๋ฐ๋ณต ์์
์ด 5๋ถ์ผ๋ก ์ค์ด๋ค์์ ๋์ ๊ทธ ํด๋ฐฉ๊ฐ!
๊ทธ ์๊ฐ์ ์ ๋ง ํ๊ณ ์ถ์๋ ํ๋ก์ ํธ๋ฅผ ์์ํ ์ ์์์ด์. ๐
์ฌ๋ฌ๋ถ๋ ์ด ๊ธ์ ์ฝ๊ณ ์๋ํ์ ์ฒซ๊ฑธ์์ ๋ด๋์ผ์
จ์ผ๋ฉด ์ข๊ฒ ์ด์.
์ฒ์์ ์ด๋ ค์ ๋ณด์ด์ง๋ง, ํ๋์ฉ ๋ฐ๋ผ ํ๋ค ๋ณด๋ฉด ์ด๋์ ๋ฉ์ง ์์คํ
์ด ์์ฑ๋์ด ์์ ๊ฑฐ์์!
ํน์ ๋งํ๋ ๋ถ๋ถ์ด ์๊ฑฐ๋ ๋์์ด ํ์ํ๋ฉด,
์ฌ๋ฅ๋ท์์ ์ ๋ฌธ๊ฐ๋ค์ ๋์์ ๋ฐ๋ ๊ฒ๋ ์ข์ ๋ฐฉ๋ฒ์ด์์. ๐ช
์, ์ด์ ์ฌ๋ฌ๋ถ์ ์ฐจ๋ก์์!
์ค๋ ๋ฐฐ์ด ๋ด์ฉ์ ๋ฐํ์ผ๋ก ์ฒซ ๋ฒ์งธ ์๋ํ ํ๋ก์ ํธ๋ฅผ ์์ํด๋ณด์ธ์! ๐
ํ์ดํ
! ๐ชโจ
๐ ์ฌ๊ธฐ๊น์ง ์ฝ์ด์ฃผ์ ์ ๊ฐ์ฌํฉ๋๋ค!
์๋ํ๋ก ๋ ๋์ ์ ๋ฌด ํ๊ฒฝ์ ๋ง๋ค์ด๊ฐ์ธ์! ๐
๊ด๋ จ ํค์๋
๋๊ธ ์์ฑ
์ด ๊ธ์ ๋ํ ์ฌ๋ฌ๋ถ์ ์๊ฐ์ ๋ค๋ ค์ฃผ์ธ์
๋ก๊ทธ์ธ์ด ํ์ํฉ๋๋ค
๋๊ธ์ ์์ฑํ๋ ค๋ฉด ๋จผ์ ๋ก๊ทธ์ธํด์ฃผ์ธ์.
๋๊ธ 0
์ง์์ธ์ ์ฒ - ์ง์ ์ฌ์ฐ๊ถ ๋ณดํธ ๊ณ ์ง
์ง์ ์ฌ์ฐ๊ถ ๋ณดํธ ๊ณ ์ง
- ์ ์๊ถ ๋ฐ ์์ ๊ถ: ๋ณธ ์ปจํ ์ธ ๋ ์ฌ๋ฅ๋ท์ ๋ ์ AI ๊ธฐ์ ๋ก ์์ฑ๋์์ผ๋ฉฐ, ๋ํ๋ฏผ๊ตญ ์ ์๊ถ๋ฒ ๋ฐ ๊ตญ์ ์ ์๊ถ ํ์ฝ์ ์ํด ๋ณดํธ๋ฉ๋๋ค.
- AI ์์ฑ ์ปจํ ์ธ ์ ๋ฒ์ ์ง์: ๋ณธ AI ์์ฑ ์ปจํ ์ธ ๋ ์ฌ๋ฅ๋ท์ ์ง์ ์ฐฝ์๋ฌผ๋ก ์ธ์ ๋๋ฉฐ, ๊ด๋ จ ๋ฒ๊ท์ ๋ฐ๋ผ ์ ์๊ถ ๋ณดํธ๋ฅผ ๋ฐ์ต๋๋ค.
- ์ฌ์ฉ ์ ํ: ์ฌ๋ฅ๋ท์ ๋ช ์์ ์๋ฉด ๋์ ์์ด ๋ณธ ์ปจํ ์ธ ๋ฅผ ๋ณต์ , ์์ , ๋ฐฐํฌ, ๋๋ ์์ ์ ์ผ๋ก ํ์ฉํ๋ ํ์๋ ์๊ฒฉํ ๊ธ์ง๋ฉ๋๋ค.
- ๋ฐ์ดํฐ ์์ง ๊ธ์ง: ๋ณธ ์ปจํ ์ธ ์ ๋ํ ๋ฌด๋จ ์คํฌ๋ํ, ํฌ๋กค๋ง, ๋ฐ ์๋ํ๋ ๋ฐ์ดํฐ ์์ง์ ๋ฒ์ ์ ์ฌ์ ๋์์ด ๋ฉ๋๋ค.
- AI ํ์ต ์ ํ: ์ฌ๋ฅ๋ท์ AI ์์ฑ ์ปจํ ์ธ ๋ฅผ ํ AI ๋ชจ๋ธ ํ์ต์ ๋ฌด๋จ ์ฌ์ฉํ๋ ํ์๋ ๊ธ์ง๋๋ฉฐ, ์ด๋ ์ง์ ์ฌ์ฐ๊ถ ์นจํด๋ก ๊ฐ์ฃผ๋ฉ๋๋ค.
์์ง ๋๊ธ์ด ์์ต๋๋ค.