Ver3.0 ๐ค ํ์ ๋ฉ๋ชจ ์์ฝ AI, ํ์ด์ฌ์ผ๋ก ์ง์ ๋ง๋ค์ด๋ณด์!

๐ค ํ์ ๋ฉ๋ชจ ์์ฝ AI, ํ์ด์ฌ์ผ๋ก ์ง์ ๋ง๋ค์ด๋ณด์!
์ง๋ฃจํ ํ์๋ก ์ ๋ฆฌ๋ ์ด์ ๊ทธ๋ง! AI๊ฐ ์์์ ์์ฝํด์ฃผ๋ ์๋ ๐
๐ฌ ํ์ ๋ฉ๋ชจ ์์ฝ AI, ์ ํ์ํ ๊น?
์ฌ๋ฌ๋ถ, ํ์ ๋๋๊ณ ํ์๋ก ์ ๋ฆฌํ๋๋ผ ๋จธ๋ฆฌ ์ํ ๋ ๊ฒฝํ ์์ผ์์ฃ ? ๐ซ ํ ์๊ฐ์ง๋ฆฌ ํ์ ๋ด์ฉ์ ์ ๋ฆฌํ๋ ๋ฐ ๋ ํ ์๊ฐ์ด ๊ฑธ๋ฆฌ๋ ๋ง๋ฒ ๊ฐ์ ์ผ์ด ๋ฒ์ด์ง๊ณค ํฉ๋๋ค. ํนํ ์์ฆ์ฒ๋ผ ์ฌํ๊ทผ๋ฌด์ ํ์ํ์๊ฐ ์ผ์ํ๋ ์๋์๋ ํ์ ๊ธฐ๋ก์ด ๋์ฑ ์ค์ํด์ก์ด์.๊ทธ๋ฐ๋ฐ ๋ง์ด์ฃ , ํ์ด์ฌ๊ณผ AI ๊ธฐ์ ์ ํ์ฉํ๋ฉด ์ด ์ง๋ฃจํ ์์ ์ ์๋ํํ ์ ์๋ต๋๋ค! ๐ ํ์ ๋ด์ฉ์ ํ ์คํธ๋ก ๋ณํํ๊ณ , ํต์ฌ๋ง ์์ ๋ฝ์๋ด๋ AI๋ฅผ ์ง์ ๋ง๋ค์ด๋ณผ ์ ์์ด์. ์ฌ๋ฅ๋ท ๊ฐ์ ํ๋ซํผ์์๋ ์ด๋ฐ AI ๊ฐ๋ฐ ๊ด๋ จ ์ฌ๋ฅ์ ๊ณต์ ํ๋ ๋ถ๋ค์ด ๋ง์์ง๊ณ ์๋๋ฐ์, ์ค๋์ ์ฌ๋ฌ๋ถ์ด ์ง์ ๋ง๋ค ์ ์๋๋ก ์น์ ํ๊ฒ ์๋ ค๋๋ฆด๊ฒ์!
โ ํ์ํ ํ์ด์ฌ ๋ผ์ด๋ธ๋ฌ๋ฆฌ์ API
โ ์ค์ ๊ตฌํ ์ฝ๋์ ๋จ๊ณ๋ณ ์ค๋ช
โ ์ฑ๋ฅ ํฅ์์ ์ํ ํ๊ณผ ํธ๋ฆญ
โ ์ค์ ํ์ฉ ๋ฐฉ๋ฒ๊ณผ ์ฃผ์์ฌํญ
๐ ํ์ ๋ฉ๋ชจ ์์ฝ AI์ ํต์ฌ ์๋ฆฌ
ํ์ ๋ฉ๋ชจ ์์ฝ AI๋ ํฌ๊ฒ ์ธ ๊ฐ์ง ๋จ๊ณ๋ก ์๋ํฉ๋๋ค. ๋ง์น ์ฌ๋์ด ํ์๋ก์ ์ ๋ฆฌํ๋ ๊ณผ์ ๊ณผ ๋น์ทํด์!1๋จ๊ณ: ์์ฑ์ ํ ์คํธ๋ก ๋ณํ (STT) ๐ค
ํ์ ๋ด์ฉ์ด ์์ฑ์ผ๋ก ๋ น์๋์ด ์๋ค๋ฉด, ๋จผ์ ์ด๋ฅผ ํ ์คํธ๋ก ๋ณํํด์ผ ํฉ๋๋ค. ์ด ๊ณผ์ ์ Speech-to-Text(STT)๋ผ๊ณ ๋ถ๋ฅด์ฃ . ํ์ด์ฌ์์๋ ์ฌ๋ฌ ๋ผ์ด๋ธ๋ฌ๋ฆฌ๋ฅผ ํ์ฉํ ์ ์์ด์:โข Google Speech Recognition API - ๋ฌด๋ฃ๋ก ์ฌ์ฉ ๊ฐ๋ฅํ์ง๋ง ์ ํ์ด ์์ด์
โข OpenAI Whisper - ์ต๊ทผ ๊ฐ์ฅ ํซํ ์คํ์์ค STT ๋ชจ๋ธ์ด์์
โข Azure Speech Service - ๋ง์ดํฌ๋ก์ํํธ์ ๊ฐ๋ ฅํ ์์ฉ ์๋น์ค
โข AssemblyAI - ๊ฐ๋ฐ์ ์นํ์ ์ธ API๋ก ์ธ๊ธฐ๊ฐ ๋ง์์
2๋จ๊ณ: ์์ฐ์ด ์ฒ๋ฆฌ (NLP) ๐ง
ํ ์คํธ๋ก ๋ณํ๋ ํ์ ๋ด์ฉ์ ์ดํดํ๊ณ ๋ถ์ํ๋ ๋จ๊ณ์ ๋๋ค. ์ฌ๊ธฐ์ AI์ ์ง๊ฐ๊ฐ ๋ฐํ๋์ฃ ! ๋ฌธ์ฅ์ ์๋ฏธ๋ฅผ ํ์ ํ๊ณ , ์ค์ํ ๋ถ๋ถ๊ณผ ๋ ์ค์ํ ๋ถ๋ถ์ ๊ตฌ๋ถํฉ๋๋ค.์ฃผ์ ๊ธฐ์ :
โข ํ ํฐํ(Tokenization) - ๋ฌธ์ฅ์ ๋จ์ด ๋จ์๋ก ๋ถ๋ฆฌ
โข ํ์ฌ ํ๊น (POS Tagging) - ๊ฐ ๋จ์ด์ ์ญํ ํ์
โข ๊ฐ์ฒด๋ช ์ธ์(NER) - ์ฌ๋ ์ด๋ฆ, ๋ ์ง, ์ฅ์ ๋ฑ ์ค์ ์ ๋ณด ์ถ์ถ
โข ๊ฐ์ ๋ถ์ - ํ์ ๋ถ์๊ธฐ๋ ์๊ฒฌ์ ๊ธ์ /๋ถ์ ํ๋จ
3๋จ๊ณ: ์์ฝ ์์ฑ ๐
๋ง์ง๋ง์ผ๋ก ๋ถ์๋ ๋ด์ฉ์ ๋ฐํ์ผ๋ก ๊ฐ๊ฒฐํ ์์ฝ๋ฌธ์ ์์ฑํฉ๋๋ค. ์์ฝ ๋ฐฉ์์ ํฌ๊ฒ ๋ ๊ฐ์ง๋ก ๋๋์ด์:์ถ์ถ์ ์์ฝ(Extractive Summarization)
์๋ฌธ์์ ์ค์ํ ๋ฌธ์ฅ๋ค์ ๊ทธ๋๋ก ๋ฝ์๋ด๋ ๋ฐฉ์์ด์์. ๋น๊ต์ ๊ตฌํ์ด ์ฝ๊ณ ์ ํ๋๊ฐ ๋์ต๋๋ค.
์์ฑ์ ์์ฝ(Abstractive Summarization)
AI๊ฐ ๋ด์ฉ์ ์ดํดํ๊ณ ์๋ก์ด ๋ฌธ์ฅ์ผ๋ก ์ฌ๊ตฌ์ฑํ๋ ๋ฐฉ์์ด์์. ๋ ์์ฐ์ค๋ฝ์ง๋ง ๊ตฌํ์ด ๋ณต์กํฉ๋๋ค.
๐ ๏ธ ํ์ํ ๋๊ตฌ์ ๋ผ์ด๋ธ๋ฌ๋ฆฌ ์ค๋นํ๊ธฐ
์, ์ด์ ๋ณธ๊ฒฉ์ ์ผ๋ก ์ฝ๋ฉ์ ์์ํด๋ณผ๊น์? ๋จผ์ ํ์ํ ๋๊ตฌ๋ค์ ์ค๋นํด์ผ ํฉ๋๋ค. ํ์ด์ฌ ๊ฐ๋ฐ ํ๊ฒฝ์ด ์ด๋ฏธ ์ค์ ๋์ด ์๋ค๊ณ ๊ฐ์ ํ๊ณ ์งํํ ๊ฒ์! ๐๐ฆ ํ์ ๋ผ์ด๋ธ๋ฌ๋ฆฌ ์ค์น
๊ธฐ๋ณธ์ ์ผ๋ก ํ์ํ ๋ผ์ด๋ธ๋ฌ๋ฆฌ๋ค์ ์ค์นํด๋ด ์๋ค. ํฐ๋ฏธ๋์ด๋ ๋ช ๋ น ํ๋กฌํํธ๋ฅผ ์ด๊ณ ๋ค์ ๋ช ๋ น์ด๋ฅผ ์ ๋ ฅํ์ธ์:pip install openai-whisper
pip install transformers
pip install torch
pip install nltk
pip install spacy
pip install python-docx
pip install pydub
pip install openai
๊ฐ ๋ผ์ด๋ธ๋ฌ๋ฆฌ์ ์ญํ ์ ๊ฐ๋จํ ์ค๋ช
ํ๋ฉด:openai-whisper - ์์ฑ์ ํ ์คํธ๋ก ๋ณํํ๋ ์ต๊ฐ STT ๋ชจ๋ธ
transformers - Hugging Face์ ๋ค์ํ AI ๋ชจ๋ธ ํ์ฉ
torch - ๋ฅ๋ฌ๋ ์ฐ์ฐ์ ์ํ PyTorch
nltk - ์์ฐ์ด ์ฒ๋ฆฌ์ ๊ธฐ๋ณธ ๋๊ตฌ
spacy - ๊ณ ๊ธ ์์ฐ์ด ์ฒ๋ฆฌ ๋ผ์ด๋ธ๋ฌ๋ฆฌ
python-docx - Word ๋ฌธ์ ์์ฑ์ฉ
pydub - ์ค๋์ค ํ์ผ ์ฒ๋ฆฌ
openai - OpenAI API ์ฌ์ฉ (์ ํ์ฌํญ)
python -m venv meeting_ai_envsource meeting_ai_env/bin/activate (Mac/Linux)meeting_ai_env\Scripts\activate (Windows)
๐ป ์ค์ ์ฝ๋ ๊ตฌํํ๊ธฐ
๋๋์ด ์ฝ๋ฉ ์๊ฐ์ ๋๋ค! ๐ ๋จ๊ณ๋ณ๋ก ์ฐจ๊ทผ์ฐจ๊ทผ ๊ตฌํํด๋ณผ๊ฒ์. ๊ฐ ์ฝ๋ ๋ธ๋ก๋ง๋ค ์์ธํ ์ค๋ช ์ ๋ฌ์๋์์ผ๋ ์ฒ์ฒํ ๋ฐ๋ผ์ค์ธ์.Step 1: ์์ฑ ํ์ผ์ ํ ์คํธ๋ก ๋ณํํ๊ธฐ
๋จผ์ Whisper ๋ชจ๋ธ์ ์ฌ์ฉํด์ ํ์ ๋ น์ ํ์ผ์ ํ ์คํธ๋ก ๋ณํํด๋ด ์๋ค. Whisper๋ OpenAI๊ฐ ๊ณต๊ฐํ ์คํ์์ค ๋ชจ๋ธ๋ก, ์ ํ๋๊ฐ ์ ๋ง ๋ฐ์ด๋์!import whisper
import torch
class MeetingTranscriber:
def __init__(self, model_size="base"):
"""
Whisper ๋ชจ๋ธ ์ด๊ธฐํ
model_size: tiny, base, small, medium, large ์ค ์ ํ
- tiny: ๊ฐ์ฅ ๋น ๋ฅด์ง๋ง ์ ํ๋ ๋ฎ์
- base: ์๋์ ์ ํ๋์ ๊ท ํ (์ถ์ฒ!)
- large: ๊ฐ์ฅ ์ ํํ์ง๋ง ๋๋ฆผ
"""
print(f"๐ค Whisper {model_size} ๋ชจ๋ธ์ ๋ก๋ฉ์ค...")
self.model = whisper.load_model(model_size)
self.device = "cuda" if torch.cuda.is_available() else "cpu"
print(f"โ
๋ชจ๋ธ ๋ก๋ฉ ์๋ฃ! ์ฌ์ฉ ๋๋ฐ์ด์ค: {self.device}")
def transcribe_audio(self, audio_path, language="ko"):
"""
์ค๋์ค ํ์ผ์ ํ
์คํธ๋ก ๋ณํ
audio_path: ์ค๋์ค ํ์ผ ๊ฒฝ๋ก
language: ์ธ์ด ์ฝ๋ (ko=ํ๊ตญ์ด, en=์์ด)
"""
print(f"๐ค ์์ฑ ํ์ผ ๋ณํ ์์: {audio_path}")
# Whisper๋ก ์์ฑ ์ธ์ ์ํ
result = self.model.transcribe(
audio_path,
language=language,
task="transcribe",
verbose=False
)
# ๊ฒฐ๊ณผ์์ ํ
์คํธ ์ถ์ถ
transcript = result["text"]
segments = result["segments"] # ํ์์คํฌํ ํฌํจ ์ธ๊ทธ๋จผํธ
print(f"โ
๋ณํ ์๋ฃ! ์ด {len(segments)}๊ฐ ์ธ๊ทธ๋จผํธ")
return {
"full_text": transcript,
"segments": segments,
"language": result["language"]
}
def save_transcript(self, transcript_data, output_path):
"""๋ณํ๋ ํ
์คํธ๋ฅผ ํ์ผ๋ก ์ ์ฅ"""
with open(output_path, 'w', encoding='utf-8') as f:
f.write("=== ํ์ ์ ์ฒด ๋ด์ฉ ===\n\n")
f.write(transcript_data["full_text"])
f.write("\n\n=== ํ์์คํฌํ๋ณ ๋ด์ฉ ===\n\n")
for segment in transcript_data["segments"]:
start_time = segment["start"]
end_time = segment["end"]
text = segment["text"]
f.write(f"[{start_time:.2f}s - {end_time:.2f}s] {text}\n")
print(f"๐พ ํ
์คํธ ํ์ผ ์ ์ฅ ์๋ฃ: {output_path}")
# ์ฌ์ฉ ์์
transcriber = MeetingTranscriber(model_size="base")
result = transcriber.transcribe_audio("meeting_recording.mp3", language="ko")
transcriber.save_transcript(result, "meeting_transcript.txt")
์ด ์ฝ๋์ ํต์ฌ ํฌ์ธํธ๋ฅผ ์ค๋ช
ํ๋ฉด:1. ๋ชจ๋ธ ํฌ๊ธฐ ์ ํ์ ์ค์์ฑ
๋ชจ๋ธ์ด ํด์๋ก ์ ํํ์ง๋ง ์ฒ๋ฆฌ ์๊ฐ์ด ์ค๋ ๊ฑธ๋ ค์. ์ค์๊ฐ ์ฒ๋ฆฌ๊ฐ ํ์ํ๋ฉด 'base'๋ 'small'์, ์ ํ๋๊ฐ ์ต์ฐ์ ์ด๋ฉด 'large'๋ฅผ ์ ํํ์ธ์.
2. GPU ํ์ฉ
CUDA๋ฅผ ์ง์ํ๋ GPU๊ฐ ์๋ค๋ฉด ์๋์ผ๋ก ํ์ฉ๋ฉ๋๋ค. CPU๋ณด๋ค 10๋ฐฐ ์ด์ ๋น ๋ฅด๊ฒ ์ฒ๋ฆฌํ ์ ์์ด์!
3. ํ์์คํฌํ ์ ๋ณด
segments์๋ ๊ฐ ๋ฐํ์ ์์/์ข ๋ฃ ์๊ฐ์ด ํฌํจ๋์ด ์์ด์, ๋์ค์ ํน์ ์์ ์ ๋ด์ฉ์ ์ฐพ์ ๋ ์ ์ฉํฉ๋๋ค.
Step 2: ํ ์คํธ ์ ์ฒ๋ฆฌ ๋ฐ ๋ถ์
๋ณํ๋ ํ ์คํธ๋ฅผ AI๊ฐ ๋ ์ ์ดํดํ ์ ์๋๋ก ์ ์ฒ๋ฆฌํ๊ณ ๋ถ์ํ๋ ๋จ๊ณ์ ๋๋ค. ์ฌ๊ธฐ์ NLTK์ spaCy๋ฅผ ํ์ฉํด์!import nltk
import spacy
import re
from collections import Counter
# ํ์ํ NLTK ๋ฐ์ดํฐ ๋ค์ด๋ก๋ (์ต์ด 1ํ๋ง)
nltk.download('punkt')
nltk.download('stopwords')
class TextAnalyzer:
def __init__(self):
"""ํ
์คํธ ๋ถ์๊ธฐ ์ด๊ธฐํ"""
print("๐ง ํ
์คํธ ๋ถ์๊ธฐ ์ด๊ธฐํ์ค...")
# spaCy ํ๊ตญ์ด ๋ชจ๋ธ ๋ก๋
try:
self.nlp = spacy.load("ko_core_news_sm")
except:
print("โ ๏ธ ํ๊ตญ์ด ๋ชจ๋ธ์ด ์์ต๋๋ค. ์ค์น ๋ช
๋ น์ด:")
print("python -m spacy download ko_core_news_sm")
self.nlp = None
# ํ๊ตญ์ด ๋ถ์ฉ์ด ๋ฆฌ์คํธ
self.stopwords = set([
'์ด', '๊ทธ', '์ ', '๊ฒ', '์', '๋ฑ', '๋ค', '๋ฐ', '์ข', '๋',
'๋ค', '์', '์', '์', '์ด', '๊ทธ๋์', '๊ทธ๋ฐ๋ฐ', '๊ทธ๋ฆฌ๊ณ '
])
print("โ
๋ถ์๊ธฐ ์ค๋น ์๋ฃ!")
def clean_text(self, text):
"""ํ
์คํธ ์ ์ """
# ํน์๋ฌธ์ ์ ๊ฑฐ (๋ฌธ์ฅ๋ถํธ๋ ์ ์ง)
text = re.sub(r'[^\w\s\.\,\!\?]', '', text)
# ์ฐ์๋ ๊ณต๋ฐฑ ์ ๊ฑฐ
text = re.sub(r'\s+', ' ', text)
# ์๋ค ๊ณต๋ฐฑ ์ ๊ฑฐ
text = text.strip()
return text
def extract_keywords(self, text, top_n=10):
"""ํต์ฌ ํค์๋ ์ถ์ถ"""
if not self.nlp:
return []
# spaCy๋ก ํ
์คํธ ๋ถ์
doc = self.nlp(text)
# ๋ช
์ฌ๋ง ์ถ์ถ (๋ถ์ฉ์ด ์ ์ธ)
nouns = [
token.text for token in doc
if token.pos_ == "NOUN" and token.text not in self.stopwords
and len(token.text) > 1 # ํ ๊ธ์ ๋จ์ด ์ ์ธ
]
# ๋น๋์ ๊ณ์ฐ
keyword_freq = Counter(nouns)
# ์์ N๊ฐ ํค์๋ ๋ฐํ
top_keywords = keyword_freq.most_common(top_n)
return top_keywords
def extract_entities(self, text):
"""๊ฐ์ฒด๋ช
์ถ์ถ (์ฌ๋, ์กฐ์ง, ๋ ์ง ๋ฑ)"""
if not self.nlp:
return {}
doc = self.nlp(text)
entities = {
"PERSON": [], # ์ฌ๋ ์ด๋ฆ
"ORG": [], # ์กฐ์ง/ํ์ฌ๋ช
"DATE": [], # ๋ ์ง
"TIME": [], # ์๊ฐ
"LOCATION": [] # ์ฅ์
}
for ent in doc.ents:
if ent.label_ in entities:
entities[ent.label_].append(ent.text)
# ์ค๋ณต ์ ๊ฑฐ
for key in entities:
entities[key] = list(set(entities[key]))
return entities
def split_into_sentences(self, text):
"""ํ
์คํธ๋ฅผ ๋ฌธ์ฅ ๋จ์๋ก ๋ถ๋ฆฌ"""
# ๋ฌธ์ฅ ์ข
๊ฒฐ ๋ถํธ๋ก ๋ถ๋ฆฌ
sentences = re.split(r'[.!?]+', text)
# ๋น ๋ฌธ์ฅ ์ ๊ฑฐ ๋ฐ ์ ์
sentences = [s.strip() for s in sentences if s.strip()]
return sentences
def analyze_meeting_structure(self, text):
"""ํ์ ๊ตฌ์กฐ ๋ถ์"""
sentences = self.split_into_sentences(text)
structure = {
"total_sentences": len(sentences),
"avg_sentence_length": sum(len(s) for s in sentences) / len(sentences) if sentences else 0,
"keywords": self.extract_keywords(text),
"entities": self.extract_entities(text),
"topics": self._identify_topics(sentences)
}
return structure
def _identify_topics(self, sentences):
"""์ฃผ์ ์๋ณ (๊ฐ๋จํ ๋ฒ์ )"""
# ๋ฌธ์ฅ๋ค์ ํด๋ฌ์คํฐ๋งํ์ฌ ์ฃผ์ ์ฃผ์ ํ์
# ์ฌ๊ธฐ์๋ ๊ฐ๋จํ ํค์๋ ๊ธฐ๋ฐ์ผ๋ก ๊ตฌํ
topics = []
# ์ค์ ๋ก๋ ๋ ๋ณต์กํ ํ ํฝ ๋ชจ๋ธ๋ง ์๊ณ ๋ฆฌ์ฆ ์ฌ์ฉ ๊ฐ๋ฅ
# (LDA, BERTopic ๋ฑ)
return topics
# ์ฌ์ฉ ์์
analyzer = TextAnalyzer()
# ํ
์คํธ ์ ์
cleaned_text = analyzer.clean_text(meeting_text)
# ํค์๋ ์ถ์ถ
keywords = analyzer.extract_keywords(cleaned_text, top_n=15)
print("๐ ํต์ฌ ํค์๋:", keywords)
# ๊ฐ์ฒด๋ช
์ถ์ถ
entities = analyzer.extract_entities(cleaned_text)
print("๐ฅ ์ธ๊ธ๋ ์ฌ๋:", entities["PERSON"])
print("๐ข ์ธ๊ธ๋ ์กฐ์ง:", entities["ORG"])
# ํ์ ๊ตฌ์กฐ ๋ถ์
structure = analyzer.analyze_meeting_structure(cleaned_text)
print(f"๐ ์ด ๋ฌธ์ฅ ์: {structure['total_sentences']}")
print(f"๐ ํ๊ท ๋ฌธ์ฅ ๊ธธ์ด: {structure['avg_sentence_length']:.1f}์")
์ด ๋ถ์ ๋จ๊ณ์์ ์ค์ํ ์ ๋ค:โข ๋ถ์ฉ์ด ์ฒ๋ฆฌ
'์ด', '๊ทธ', '์ ' ๊ฐ์ ์๋ฏธ ์๋ ๋จ์ด๋ค์ ์ ๊ฑฐํด์ผ ํต์ฌ ํค์๋๊ฐ ์ ํํ๊ฒ ์ถ์ถ๋ฉ๋๋ค.
โข ๊ฐ์ฒด๋ช ์ธ์์ ์ค์์ฑ
ํ์์์ ๋๊ฐ ๋ฌด์์ ๋งํ๋์ง, ์ด๋ค ํ๋ก์ ํธ๋ ์ ํ์ด ์ธ๊ธ๋์๋์ง ํ์ ํ๋ ๊ฒ์ด ์์ฝ์ ์ง์ ํฌ๊ฒ ๋์ฌ์ค๋๋ค.
โข ๋ฌธ์ฅ ๋ถ๋ฆฌ
๋์ค์ ์์ฝํ ๋ ๋ฌธ์ฅ ๋จ์๋ก ์ค์๋๋ฅผ ํ๊ฐํ๊ธฐ ์ํด ํ์ํ ๊ณผ์ ์ด์์.
Step 3: AI ๊ธฐ๋ฐ ์์ฝ ์์ฑ
์ด์ ๊ฐ์ฅ ํต์ฌ์ ์ธ ๋ถ๋ถ์ธ ์์ฝ ์์ฑ์ ๋๋ค! ์ฌ๊ธฐ์๋ Hugging Face์ Transformers ๋ผ์ด๋ธ๋ฌ๋ฆฌ๋ฅผ ํ์ฉํ ๊ฒ์. ๋ ๊ฐ์ง ๋ฐฉ์์ ๋ชจ๋ ๊ตฌํํด๋ณผ๊ฒ์.from transformers import pipeline, AutoTokenizer, AutoModelForSeq2SeqLM
import torch
class MeetingSummarizer:
def __init__(self, method="extractive"):
"""
์์ฝ๊ธฐ ์ด๊ธฐํ
method: "extractive" ๋๋ "abstractive"
"""
self.method = method
print(f"๐ค {method} ์์ฝ ๋ชจ๋ธ ๋ก๋ฉ์ค...")
if method == "extractive":
self._init_extractive_model()
else:
self._init_abstractive_model()
print("โ
์์ฝ ๋ชจ๋ธ ์ค๋น ์๋ฃ!")
def _init_extractive_model(self):
"""์ถ์ถ์ ์์ฝ ๋ชจ๋ธ ์ด๊ธฐํ"""
# ๋ฌธ์ฅ ์๋ฒ ๋ฉ์ ์ํ ๋ชจ๋ธ
from sentence_transformers import SentenceTransformer
self.sentence_model = SentenceTransformer('paraphrase-multilingual-MiniLM-L12-v2')
def _init_abstractive_model(self):
"""์์ฑ์ ์์ฝ ๋ชจ๋ธ ์ด๊ธฐํ"""
# ํ๊ตญ์ด ์์ฝ์ ํนํ๋ ๋ชจ๋ธ ์ฌ์ฉ
model_name = "eenzeenee/t5-base-korean-summarization"
self.tokenizer = AutoTokenizer.from_pretrained(model_name)
self.model = AutoModelForSeq2SeqLM.from_pretrained(model_name)
# GPU ์ฌ์ฉ ๊ฐ๋ฅํ๋ฉด GPU๋ก
self.device = "cuda" if torch.cuda.is_available() else "cpu"
self.model.to(self.device)
def extractive_summarize(self, text, num_sentences=5):
"""
์ถ์ถ์ ์์ฝ: ์๋ฌธ์์ ์ค์ํ ๋ฌธ์ฅ๋ค์ ์ ํ
"""
# ๋ฌธ์ฅ ๋ถ๋ฆฌ
sentences = self._split_sentences(text)
if len(sentences) <= num_sentences:
return " ".join(sentences)
# ๊ฐ ๋ฌธ์ฅ์ ๋ฒกํฐ๋ก ๋ณํ
sentence_embeddings = self.sentence_model.encode(sentences)
# ๋ฌธ์ฅ ๊ฐ ์ ์ฌ๋ ๊ณ์ฐ
from sklearn.metrics.pairwise import cosine_similarity
import numpy as np
# ์ ์ฒด ๋ฌธ์์์ ์ ์ฌ๋ ๊ณ์ฐ
doc_embedding = np.mean(sentence_embeddings, axis=0).reshape(1, -1)
similarities = cosine_similarity(sentence_embeddings, doc_embedding).flatten()
# ์ค์๋ ์ ์ ๊ณ์ฐ (์ ์ฌ๋ + ์์น ๊ฐ์ค์น)
scores = []
for idx, sim in enumerate(similarities):
# ์๋ถ๋ถ๊ณผ ๋ท๋ถ๋ถ ๋ฌธ์ฅ์ ๊ฐ์ค์น ๋ถ์ฌ
position_weight = 1.0
if idx < len(sentences) * 0.2: # ์ 20%
position_weight = 1.3
elif idx > len(sentences) * 0.8: # ๋ค 20%
position_weight = 1.2
scores.append(sim * position_weight)
# ์์ N๊ฐ ๋ฌธ์ฅ ์ ํ (์๋ ์์ ์ ์ง)
top_indices = np.argsort(scores)[-num_sentences:]
top_indices = sorted(top_indices)
summary_sentences = [sentences[i] for i in top_indices]
summary = " ".join(summary_sentences)
return summary
def abstractive_summarize(self, text, max_length=200, min_length=50):
"""
์์ฑ์ ์์ฝ: AI๊ฐ ์๋ก์ด ๋ฌธ์ฅ์ผ๋ก ์ฌ๊ตฌ์ฑ
"""
# ํ
์คํธ๊ฐ ๋๋ฌด ๊ธธ๋ฉด ์ฒญํฌ๋ก ๋๋๊ธฐ
max_input_length = 512
chunks = self._split_into_chunks(text, max_input_length)
summaries = []
for chunk in chunks:
# ํ ํฐํ
inputs = self.tokenizer(
chunk,
max_length=max_input_length,
truncation=True,
return_tensors="pt"
).to(self.device)
# ์์ฝ ์์ฑ
with torch.no_grad():
summary_ids = self.model.generate(
inputs["input_ids"],
max_length=max_length,
min_length=min_length,
length_penalty=2.0,
num_beams=4,
early_stopping=True
)
# ๋์ฝ๋ฉ
summary = self.tokenizer.decode(summary_ids[0], skip_special_tokens=True)
summaries.append(summary)
# ์ฌ๋ฌ ์ฒญํฌ์ ์์ฝ์ ํฉ์น๊ธฐ
final_summary = " ".join(summaries)
return final_summary
def summarize(self, text, **kwargs):
"""ํตํฉ ์์ฝ ๋ฉ์๋"""
if self.method == "extractive":
return self.extractive_summarize(text, **kwargs)
else:
return self.abstractive_summarize(text, **kwargs)
def _split_sentences(self, text):
"""๋ฌธ์ฅ ๋ถ๋ฆฌ"""
import re
sentences = re.split(r'[.!?]+', text)
return [s.strip() for s in sentences if s.strip()]
def _split_into_chunks(self, text, max_length):
"""๊ธด ํ
์คํธ๋ฅผ ์ฒญํฌ๋ก ๋ถ๋ฆฌ"""
sentences = self._split_sentences(text)
chunks = []
current_chunk = []
current_length = 0
for sentence in sentences:
sentence_length = len(self.tokenizer.encode(sentence))
if current_length + sentence_length > max_length:
if current_chunk:
chunks.append(" ".join(current_chunk))
current_chunk = [sentence]
current_length = sentence_length
else:
current_chunk.append(sentence)
current_length += sentence_length
if current_chunk:
chunks.append(" ".join(current_chunk))
return chunks
# ์ฌ์ฉ ์์
# ์ถ์ถ์ ์์ฝ
extractive_summarizer = MeetingSummarizer(method="extractive")
extractive_summary = extractive_summarizer.summarize(meeting_text, num_sentences=5)
print("๐ ์ถ์ถ์ ์์ฝ:\n", extractive_summary)
# ์์ฑ์ ์์ฝ
abstractive_summarizer = MeetingSummarizer(method="abstractive")
abstractive_summary = abstractive_summarizer.summarize(meeting_text, max_length=150)
print("\nโจ ์์ฑ์ ์์ฝ:\n", abstractive_summary)
๋ ์์ฝ ๋ฐฉ์์ ์ฐจ์ด์ ์ ์ ๋ฆฌํ๋ฉด:| ๊ตฌ๋ถ | ์ถ์ถ์ ์์ฝ | ์์ฑ์ ์์ฝ |
|---|---|---|
| ๋ฐฉ์ | ์๋ฌธ ๋ฌธ์ฅ์ ๊ทธ๋๋ก ์ ํ | ์๋ก์ด ๋ฌธ์ฅ์ผ๋ก ์ฌ๊ตฌ์ฑ |
| ์ฅ์ | ์ ํ๋ ๋์, ๋น ๋ฅธ ์ฒ๋ฆฌ | ์์ฐ์ค๋ฌ์ด ๋ฌธ์ฅ, ๊ฐ๊ฒฐํจ |
| ๋จ์ | ๋ฌธ๋งฅ์ด ์ด์ํ ์ ์์ | ์ฒ๋ฆฌ ์๊ฐ ์ค๋ ๊ฑธ๋ฆผ |
| ์ถ์ฒ ์ํฉ | ์ ํ์ฑ์ด ์ค์ํ ๊ฒฝ์ฐ | ๊ฐ๋ ์ฑ์ด ์ค์ํ ๊ฒฝ์ฐ |
์์ฑ์ ์์ฝ ๋ชจ๋ธ์ ๋ฉ๋ชจ๋ฆฌ๋ฅผ ๋ง์ด ์ฌ์ฉํฉ๋๋ค. GPU ๋ฉ๋ชจ๋ฆฌ๊ฐ ๋ถ์กฑํ๋ฉด ๋ฐฐ์น ํฌ๊ธฐ๋ฅผ ์ค์ด๊ฑฐ๋ ๋ ์์ ๋ชจ๋ธ์ ์ฌ์ฉํ์ธ์.
2. ํ๊ตญ์ด ๋ชจ๋ธ ์ ํ
ํ๊ตญ์ด ์์ฝ์๋ ํ๊ตญ์ด๋ก ํ์ต๋ ๋ชจ๋ธ์ ์ฌ์ฉํด์ผ ์ข์ ๊ฒฐ๊ณผ๋ฅผ ์ป์ ์ ์์ด์. ์์ด ๋ชจ๋ธ์ ๊ทธ๋๋ก ์ฌ์ฉํ๋ฉด ํ์ง์ด ๋จ์ด์ง๋๋ค.
3. ๊ธด ํ ์คํธ ์ฒ๋ฆฌ
๋๋ถ๋ถ์ ๋ชจ๋ธ์ ์ ๋ ฅ ๊ธธ์ด ์ ํ์ด ์์ต๋๋ค(๋ณดํต 512~1024 ํ ํฐ). ๊ธด ํ์๋ก์ ์ฒญํฌ๋ก ๋๋ ์ ์ฒ๋ฆฌํด์ผ ํด์.
๐จ ์์ฑ๋ ์์คํ ํตํฉํ๊ธฐ
์ด์ ์ง๊ธ๊น์ง ๋ง๋ ๋ชจ๋ ์ปดํฌ๋ํธ๋ฅผ ํ๋๋ก ํตํฉํด๋ด ์๋ค! ์ค์ ๋ก ์ฌ์ฉํ ์ ์๋ ์์ ํ ์์คํ ์ ๋ง๋ค์ด๋ณผ๊ฒ์. ๐ํตํฉ ํ์ ์์ฝ ์์คํ
import os
from datetime import datetime
from docx import Document
from docx.shared import Inches, Pt, RGBColor
from docx.enum.text import WD_ALIGN_PARAGRAPH
class MeetingAISystem:
def __init__(self):
"""ํ์ ์์ฝ AI ์์คํ
์ด๊ธฐํ"""
print("๐ ํ์ ์์ฝ AI ์์คํ
์์!")
print("=" * 50)
# ๊ฐ ์ปดํฌ๋ํธ ์ด๊ธฐํ
self.transcriber = MeetingTranscriber(model_size="base")
self.analyzer = TextAnalyzer()
self.summarizer = MeetingSummarizer(method="extractive")
print("=" * 50)
print("โ
๋ชจ๋ ์์คํ
์ค๋น ์๋ฃ!\n")
def process_meeting(self, audio_path, output_dir="output"):
"""
ํ์ ์ ์ฒด ์ฒ๋ฆฌ ํ์ดํ๋ผ์ธ
"""
# ์ถ๋ ฅ ๋๋ ํ ๋ฆฌ ์์ฑ
os.makedirs(output_dir, exist_ok=True)
# ํ์์คํฌํ๋ก ํ์ผ๋ช
์์ฑ
timestamp = datetime.now().strftime("%Y%m%d_%H%M%S")
print("๐ฌ ํ์ ์ฒ๋ฆฌ ์์!")
print(f"๐ ์
๋ ฅ ํ์ผ: {audio_path}")
print(f"๐ ์ถ๋ ฅ ๋๋ ํ ๋ฆฌ: {output_dir}\n")
# Step 1: ์์ฑ์ ํ
์คํธ๋ก ๋ณํ
print("1๏ธโฃ ์์ฑ ์ธ์ ์ค...")
transcript_data = self.transcriber.transcribe_audio(audio_path)
full_text = transcript_data["full_text"]
print(f" โ ๋ณํ ์๋ฃ! (์ด {len(full_text)}์)\n")
# Step 2: ํ
์คํธ ๋ถ์
print("2๏ธโฃ ํ
์คํธ ๋ถ์ ์ค...")
cleaned_text = self.analyzer.clean_text(full_text)
keywords = self.analyzer.extract_keywords(cleaned_text, top_n=10)
entities = self.analyzer.extract_entities(cleaned_text)
structure = self.analyzer.analyze_meeting_structure(cleaned_text)
print(f" โ ๋ถ์ ์๋ฃ! (ํค์๋ {len(keywords)}๊ฐ ์ถ์ถ)\n")
# Step 3: ์์ฝ ์์ฑ
print("3๏ธโฃ ์์ฝ ์์ฑ ์ค...")
summary = self.summarizer.summarize(cleaned_text, num_sentences=5)
print(f" โ ์์ฝ ์๋ฃ! (์๋ณธ ๋๋น {len(summary)/len(full_text)*100:.1f}%)\n")
# Step 4: ๊ฒฐ๊ณผ ์ ์ฅ
print("4๏ธโฃ ๊ฒฐ๊ณผ ์ ์ฅ ์ค...")
# ํ
์คํธ ํ์ผ ์ ์ฅ
txt_path = os.path.join(output_dir, f"transcript_{timestamp}.txt")
self.transcriber.save_transcript(transcript_data, txt_path)
# Word ๋ฌธ์ ์์ฑ
doc_path = os.path.join(output_dir, f"meeting_summary_{timestamp}.docx")
self._create_word_report(
doc_path,
summary,
keywords,
entities,
structure,
full_text
)
print(f" โ ์ ์ฅ ์๋ฃ!")
print(f" ๐ ํ
์คํธ: {txt_path}")
print(f" ๐ ์์ฝ ๋ฌธ์: {doc_path}\n")
# ๊ฒฐ๊ณผ ์์ฝ ์ถ๋ ฅ
print("=" * 50)
print("๐ ์ฒ๋ฆฌ ๊ฒฐ๊ณผ ์์ฝ")
print("=" * 50)
print(f"๐ ์๋ณธ ๊ธธ์ด: {len(full_text):,}์")
print(f"๐ ์์ฝ ๊ธธ์ด: {len(summary):,}์")
print(f"๐ ์์ถ๋ฅ : {(1 - len(summary)/len(full_text))*100:.1f}%")
print(f"๐ ํต์ฌ ํค์๋: {', '.join([k[0] for k in keywords[:5]])}")
print("=" * 50)
return {
"transcript": full_text,
"summary": summary,
"keywords": keywords,
"entities": entities,
"structure": structure,
"output_files": {
"transcript": txt_path,
"document": doc_path
}
}
def _create_word_report(self, output_path, summary, keywords,
entities, structure, full_text):
"""
Word ๋ฌธ์๋ก ๋ณด๊ธฐ ์ข์ ๋ณด๊ณ ์ ์์ฑ
"""
doc = Document()
# ์ ๋ชฉ
title = doc.add_heading('ํ์ ์์ฝ ๋ณด๊ณ ์', 0)
title.alignment = WD_ALIGN_PARAGRAPH.CENTER
# ์์ฑ ์ผ์
date_para = doc.add_paragraph()
date_para.add_run(f'์์ฑ ์ผ์: {datetime.now().strftime("%Y๋
%m์ %d์ผ %H:%M")}')
date_para.alignment = WD_ALIGN_PARAGRAPH.RIGHT
doc.add_paragraph() # ๋น ์ค
# 1. ์์ฝ
doc.add_heading('๐ ํ์ ์์ฝ', 1)
summary_para = doc.add_paragraph(summary)
summary_para.paragraph_format.line_spacing = 1.5
doc.add_paragraph()
# 2. ํต์ฌ ํค์๋
doc.add_heading('๐ ํต์ฌ ํค์๋', 1)
keywords_text = ', '.join([f"{k[0]}({k[1]}ํ)" for k in keywords])
doc.add_paragraph(keywords_text)
doc.add_paragraph()
# 3. ์ฃผ์ ์ธ๊ธ ์ฌํญ
doc.add_heading('๐ฅ ์ฃผ์ ์ธ๊ธ ์ฌํญ', 1)
if entities["PERSON"]:
doc.add_paragraph(f"โข ์ฐธ์์/์ธ๊ธ ์ธ๋ฌผ: {', '.join(entities['PERSON'])}")
if entities["ORG"]:
doc.add_paragraph(f"โข ์กฐ์ง/ํ์ฌ: {', '.join(entities['ORG'])}")
if entities["DATE"]:
doc.add_paragraph(f"โข ๋ ์ง: {', '.join(entities['DATE'])}")
doc.add_paragraph()
# 4. ํ์ ํต๊ณ
doc.add_heading('๐ ํ์ ํต๊ณ', 1)
doc.add_paragraph(f"โข ์ด ๋ฌธ์ฅ ์: {structure['total_sentences']}๊ฐ")
doc.add_paragraph(f"โข ํ๊ท ๋ฌธ์ฅ ๊ธธ์ด: {structure['avg_sentence_length']:.1f}์")
doc.add_paragraph(f"โข ์ ์ฒด ๊ธธ์ด: {len(full_text):,}์")
doc.add_paragraph()
# 5. ์ ์ฒด ๋ด์ฉ (์ ํ์ฌํญ)
doc.add_heading('๐ ์ ์ฒด ํ์ ๋ด์ฉ', 1)
full_text_para = doc.add_paragraph(full_text)
full_text_para.paragraph_format.line_spacing = 1.3
# ๋ฌธ์ ์ ์ฅ
doc.save(output_path)
# ์ค์ ์ฌ์ฉ ์์
if __name__ == "__main__":
# ์์คํ
์ด๊ธฐํ
meeting_ai = MeetingAISystem()
# ํ์ ๋
น์ ํ์ผ ์ฒ๋ฆฌ
audio_file = "meeting_recording.mp3"
if os.path.exists(audio_file):
result = meeting_ai.process_meeting(audio_file)
print("\n๐ ์ฒ๋ฆฌ ์๋ฃ!")
print(f"\n๐ ์์ฝ ๋ฏธ๋ฆฌ๋ณด๊ธฐ:")
print("-" * 50)
print(result["summary"])
print("-" * 50)
else:
print(f"โ ํ์ผ์ ์ฐพ์ ์ ์์ต๋๋ค: {audio_file}")
์ด ํตํฉ ์์คํ
์ ํน์ง:โจ ์๋ํ๋ ํ์ดํ๋ผ์ธ
์์ฑ ์ธ์๋ถํฐ ์์ฝ ์์ฑ, ๋ฌธ์ ์์ฑ๊น์ง ํ ๋ฒ์ ์ฒ๋ฆฌ๋ฉ๋๋ค.
๐ ์์ธํ ๋ถ์ ์ ๋ณด
๋จ์ ์์ฝ๋ฟ๋ง ์๋๋ผ ํค์๋, ๊ฐ์ฒด๋ช , ํต๊ณ ์ ๋ณด๊น์ง ์ ๊ณตํฉ๋๋ค.
๐ ์ ๋ฌธ์ ์ธ ๋ฌธ์ ์ถ๋ ฅ
Word ๋ฌธ์๋ก ๊น๋ํ๊ฒ ์ ๋ฆฌ๋ ๋ณด๊ณ ์๋ฅผ ์๋ ์์ฑํฉ๋๋ค.
๐ ํ์ฅ ๊ฐ๋ฅํ ๊ตฌ์กฐ
๊ฐ ์ปดํฌ๋ํธ๊ฐ ๋ ๋ฆฝ์ ์ด๋ผ ํ์์ ๋ฐ๋ผ ์ฝ๊ฒ ์์ ํ๊ฑฐ๋ ๊ต์ฒดํ ์ ์์ด์.
โก ์ฑ๋ฅ ์ต์ ํ ํ
์ค์ ๋ก ์ฌ์ฉํ๋ค ๋ณด๋ฉด ์ฑ๋ฅ์ด ์ค์ํด์ง๋ ์๊ฐ์ด ์ต๋๋ค. ํนํ ๊ธด ํ์๋ ์ฌ๋ฌ ํ์ผ์ ์ฒ๋ฆฌํ ๋๋ ์ต์ ํ๊ฐ ํ์์์! ๐ช1. GPU ๊ฐ์ ํ์ฉํ๊ธฐ
GPU๋ฅผ ์ฌ์ฉํ๋ฉด ์ฒ๋ฆฌ ์๋๊ฐ ๊ทน์ ์ผ๋ก ํฅ์๋ฉ๋๋ค. ํนํ Whisper๋ Transformer ๋ชจ๋ธ์ GPU ๊ฐ์์ ํํ์ ํฌ๊ฒ ๋ฐ์์!# GPU ์ฌ์ฉ ํ์ธ ๋ฐ ์ค์
import torch
def setup_device():
"""์ต์ ์ ๋๋ฐ์ด์ค ์ค์ """
if torch.cuda.is_available():
device = "cuda"
# GPU ๋ฉ๋ชจ๋ฆฌ ์ต์ ํ
torch.cuda.empty_cache()
print(f"โ
GPU ์ฌ์ฉ: {torch.cuda.get_device_name(0)}")
print(f"๐พ ์ฌ์ฉ ๊ฐ๋ฅ ๋ฉ๋ชจ๋ฆฌ: {torch.cuda.get_device_properties(0).total_memory / 1e9:.2f}GB")
else:
device = "cpu"
print("โ ๏ธ CPU ๋ชจ๋ (GPU๋ฅผ ์ฌ์ฉํ๋ฉด 10๋ฐฐ ์ด์ ๋น ๋ฆ
๋๋ค)")
return device
# ๋ฐฐ์น ์ฒ๋ฆฌ๋ก ์ฌ๋ฌ ํ์ผ ๋์ ์ฒ๋ฆฌ
def batch_process_meetings(audio_files, batch_size=4):
"""์ฌ๋ฌ ํ์ ํ์ผ์ ๋ฐฐ์น๋ก ์ฒ๋ฆฌ"""
results = []
for i in range(0, len(audio_files), batch_size):
batch = audio_files[i:i+batch_size]
print(f"๐ฆ ๋ฐฐ์น {i//batch_size + 1} ์ฒ๋ฆฌ ์ค... ({len(batch)}๊ฐ ํ์ผ)")
# ๋ณ๋ ฌ ์ฒ๋ฆฌ
batch_results = []
for audio_file in batch:
result = meeting_ai.process_meeting(audio_file)
batch_results.append(result)
results.extend(batch_results)
# GPU ๋ฉ๋ชจ๋ฆฌ ์ ๋ฆฌ
if torch.cuda.is_available():
torch.cuda.empty_cache()
return results
2. ๋ชจ๋ธ ์บ์ฑ๊ณผ ์ฌ์ฌ์ฉ
๋ชจ๋ธ์ ๋งค๋ฒ ๋ก๋ฉํ๋ ๊ฒ์ ์๊ฐ ๋ญ๋น์ ๋๋ค. ํ ๋ฒ ๋ก๋ฉํ ๋ชจ๋ธ์ ์ฌ์ฌ์ฉํ์ธ์!class CachedMeetingAI:
"""๋ชจ๋ธ ์บ์ฑ์ ์ง์ํ๋ ์ต์ ํ๋ ๋ฒ์ """
_instance = None
_models_loaded = False
def __new__(cls):
"""์ฑ๊ธํค ํจํด์ผ๋ก ์ธ์คํด์ค ์ฌ์ฌ์ฉ"""
if cls._instance is None:
cls._instance = super().__new__(cls)
return cls._instance
def __init__(self):
if not self._models_loaded:
print("๐ ๋ชจ๋ธ ๋ก๋ฉ ์ค... (์ต์ด 1ํ๋ง)")
self.transcriber = MeetingTranscriber()
self.analyzer = TextAnalyzer()
self.summarizer = MeetingSummarizer()
self._models_loaded = True
print("โ
๋ชจ๋ธ ์บ์ฑ ์๋ฃ!")
else:
print("โป๏ธ ์บ์๋ ๋ชจ๋ธ ์ฌ์ฌ์ฉ")
# ์ฌ์ฉ ์์
ai1 = CachedMeetingAI() # ๋ชจ๋ธ ๋ก๋ฉ
ai2 = CachedMeetingAI() # ์บ์๋ ๋ชจ๋ธ ์ฌ์ฌ์ฉ (๋น ๋ฆ!)
3. ๋ฉํฐํ๋ก์ธ์ฑ์ผ๋ก ๋ณ๋ ฌ ์ฒ๋ฆฌ
์ฌ๋ฌ ํ์ผ์ ๋์์ ์ฒ๋ฆฌํ๋ฉด ์ ์ฒด ์ฒ๋ฆฌ ์๊ฐ์ ํฌ๊ฒ ์ค์ผ ์ ์์ด์!from multiprocessing import Pool, cpu_count
import os
def process_single_meeting(args):
"""๋จ์ผ ํ์ ์ฒ๋ฆฌ (๋ฉํฐํ๋ก์ธ์ฑ์ฉ)"""
audio_file, output_dir = args
# ๊ฐ ํ๋ก์ธ์ค๋ง๋ค ๋
๋ฆฝ์ ์ธ AI ์ธ์คํด์ค ์์ฑ
ai = MeetingAISystem()
result = ai.process_meeting(audio_file, output_dir)
return result
def parallel_process_meetings(audio_files, output_dir="output", num_workers=None):
"""
์ฌ๋ฌ ํ์๋ฅผ ๋ณ๋ ฌ๋ก ์ฒ๋ฆฌ
num_workers: ์ฌ์ฉํ ํ๋ก์ธ์ค ์ (None์ด๋ฉด CPU ์ฝ์ด ์๋งํผ)
"""
if num_workers is None:
num_workers = max(1, cpu_count() - 1) # 1๊ฐ ์ฝ์ด๋ ์์คํ
์ฉ์ผ๋ก ๋จ๊น
print(f"๐ {num_workers}๊ฐ ํ๋ก์ธ์ค๋ก ๋ณ๋ ฌ ์ฒ๋ฆฌ ์์!")
print(f"๐ ์ด {len(audio_files)}๊ฐ ํ์ผ ์ฒ๋ฆฌ ์์ \n")
# ์ธ์ ์ค๋น
args_list = [(audio_file, output_dir) for audio_file in audio_files]
# ๋ณ๋ ฌ ์ฒ๋ฆฌ ์คํ
with Pool(num_workers) as pool:
results = pool.map(process_single_meeting, args_list)
print(f"\nโ
๋ชจ๋ ํ์ผ ์ฒ๋ฆฌ ์๋ฃ!")
return results
# ์ฌ์ฉ ์์
audio_files = [
"meeting1.mp3",
"meeting2.mp3",
"meeting3.mp3",
"meeting4.mp3"
]
results = parallel_process_meetings(audio_files, num_workers=4)
โ ๏ธ ์ฃผ์: ๋ฉํฐํ๋ก์ธ์ฑ์ CPU ์์
์ ํจ๊ณผ์ ์ด์ง๋ง, GPU๋ฅผ ์ฌ์ฉํ๋ ๊ฒฝ์ฐ ๋ฉ๋ชจ๋ฆฌ ๋ฌธ์ ๊ฐ ๋ฐ์ํ ์ ์์ด์. GPU ๋ฉ๋ชจ๋ฆฌ๊ฐ ์ถฉ๋ถํ์ง ํ์ธํ์ธ์!
์ต์ ํ ์ ํ๋ฅผ ๋น๊ตํ๋ ค๋ฉด ์ ํํ ์ธก์ ์ด ํ์ํฉ๋๋ค:
import time
def measure_performance(func, *args, **kwargs):
"""ํจ์ ์คํ ์๊ฐ ์ธก์ """
start_time = time.time()
result = func(*args, **kwargs)
end_time = time.time()
elapsed_time = end_time - start_time
print(f"โฑ๏ธ ์คํ ์๊ฐ: {elapsed_time:.2f}์ด")
return result, elapsed_time
# ์ฌ์ฉ ์์
result, time_taken = measure_performance(
meeting_ai.process_meeting,
"meeting.mp3"
)
๐ฏ ์ค์ ํ์ฉ ์๋๋ฆฌ์ค
์ด๋ก ์ ์ถฉ๋ถํ ๋ฐฐ์ ์ผ๋, ์ด์ ์ค์ ๋ก ์ด๋ป๊ฒ ํ์ฉํ ์ ์๋์ง ๊ตฌ์ฒด์ ์ธ ์๋๋ฆฌ์ค๋ฅผ ์ดํด๋ณผ๊น์? ๐์๋๋ฆฌ์ค 1: ์ผ์ผ ์คํ ๋์ ๋ฏธํ ์๋ ์ ๋ฆฌ
๋งค์ผ ์์นจ ์งํ๋๋ ์งง์ ์คํ ๋์ ๋ฏธํ ์ ์๋์ผ๋ก ์ ๋ฆฌํ๋ ์์คํ ์ ๋๋ค.class DailyStandupProcessor:
"""์ผ์ผ ์คํ ๋์
๋ฏธํ
์ ์ฉ ํ๋ก์ธ์"""
def __init__(self):
self.ai = MeetingAISystem()
self.template = {
"์ด์ ํ ์ผ": [],
"์ค๋ ํ ์ผ": [],
"์ด์/๋ธ๋ก์ปค": []
}
def process_standup(self, audio_file):
"""์คํ ๋์
๋ฏธํ
์ฒ๋ฆฌ"""
# ๊ธฐ๋ณธ ์ฒ๋ฆฌ
result = self.ai.process_meeting(audio_file)
# ์คํ ๋์
ํนํ ๋ถ์
standup_summary = self._extract_standup_items(result["transcript"])
# ์ฌ๋/์ด๋ฉ์ผ๋ก ์๋ ์ ์ก
self._send_to_slack(standup_summary)
return standup_summary
def _extract_standup_items(self, transcript):
"""์คํ ๋์
ํญ๋ชฉ ์ถ์ถ"""
# ํค์๋ ๊ธฐ๋ฐ ๋ถ๋ฅ
items = self.template.copy()
sentences = transcript.split('.')
for sentence in sentences:
if any(keyword in sentence for keyword in ['์ด์ ', 'ํ์ต๋๋ค', '์๋ฃ']):
items["์ด์ ํ ์ผ"].append(sentence.strip())
elif any(keyword in sentence for keyword in ['์ค๋', 'ํ ์์ ', '์งํ']):
items["์ค๋ ํ ์ผ"].append(sentence.strip())
elif any(keyword in sentence for keyword in ['๋ฌธ์ ', '์ด์', '๋ธ๋ก์ปค', '๋์']):
items["์ด์/๋ธ๋ก์ปค"].append(sentence.strip())
return items
def _send_to_slack(self, summary):
"""์ฌ๋์ผ๋ก ์์ฝ ์ ์ก"""
# ์ฌ๋ ์นํ
์ฌ์ฉ
import requests
import json
webhook_url = "YOUR_SLACK_WEBHOOK_URL"
message = {
"text": "๐ ์ค๋์ ์คํ ๋์
์์ฝ",
"blocks": [
{
"type": "section",
"text": {
"type": "mrkdwn",
"text": "*์ด์ ํ ์ผ:*\n" + "\n".join(f"โข {item}" for item in summary["์ด์ ํ ์ผ"])
}
},
{
"type": "section",
"text": {
"type": "mrkdwn",
"text": "*์ค๋ ํ ์ผ:*\n" + "\n".join(f"โข {item}" for item in summary["์ค๋ ํ ์ผ"])
}
}
]
}
# ์ค์ ์ ์ก (์ฃผ์ ์ฒ๋ฆฌ)
# requests.post(webhook_url, data=json.dumps(message))
print("๐ค ์ฌ๋ ์ ์ก ์๋ฃ!")
์๋๋ฆฌ์ค 2: ๊ณ ๊ฐ ๋ฏธํ ์ธ์ฌ์ดํธ ์ถ์ถ
์์ ํ์ด๋ CSํ์ ๊ณ ๊ฐ ๋ฏธํ ์์ ์ค์ํ ์ธ์ฌ์ดํธ๋ฅผ ์๋์ผ๋ก ์ถ์ถํฉ๋๋ค.class CustomerMeetingAnalyzer:
"""๊ณ ๊ฐ ๋ฏธํ
๋ถ์ ์ ์ฉ"""
def __init__(self):
self.ai = MeetingAISystem()
def analyze_customer_meeting(self, audio_file, customer_name):
"""๊ณ ๊ฐ ๋ฏธํ
๋ถ์"""
result = self.ai.process_meeting(audio_file)
# ๊ณ ๊ฐ ํนํ ๋ถ์
insights = {
"customer": customer_name,
"pain_points": self._extract_pain_points(result["transcript"]),
"requirements": self._extract_requirements(result["transcript"]),
"action_items": self._extract_action_items(result["transcript"]),
"sentiment": self._analyze_sentiment(result["transcript"]),
"next_steps": self._extract_next_steps(result["transcript"])
}
# CRM์ ์๋ ๊ธฐ๋ก
self._save_to_crm(insights)
return insights
def _extract_pain_points(self, transcript):
"""๊ณ ๊ฐ์ ๋ถํธ์ฌํญ ์ถ์ถ"""
pain_keywords = ['๋ฌธ์ ', '์ด๋ ค์', '๋ถํธ', '๊ฐ์ ', 'ํ๋ค๋ค']
pain_points = []
sentences = transcript.split('.')
for sentence in sentences:
if any(keyword in sentence for keyword in pain_keywords):
pain_points.append(sentence.strip())
return pain_points
def _extract_requirements(self, transcript):
"""๊ณ ๊ฐ ์๊ตฌ์ฌํญ ์ถ์ถ"""
req_keywords = ['ํ์', '์ํ๋ค', '์์ฒญ', 'ํด์ฃผ์ธ์', '๋ฐ๋๋๋ค']
requirements = []
sentences = transcript.split('.')
for sentence in sentences:
if any(keyword in sentence for keyword in req_keywords):
requirements.append(sentence.strip())
return requirements
def _extract_action_items(self, transcript):
"""์ก์
์์ดํ
์ถ์ถ"""
action_keywords = ['ํ๊ฒ ์ต๋๋ค', '์งํ', 'ํ์ธ', '๊ฒํ ', '์ค๋น']
actions = []
sentences = transcript.split('.')
for sentence in sentences:
if any(keyword in sentence for keyword in action_keywords):
actions.append(sentence.strip())
return actions
def _analyze_sentiment(self, transcript):
"""๊ฐ์ ๋ถ์"""
# ๊ฐ๋จํ ๊ฐ์ ๋ถ์ (์ค์ ๋ก๋ ๋ ์ ๊ตํ ๋ชจ๋ธ ์ฌ์ฉ)
positive_words = ['์ข๋ค', '๋ง์กฑ', 'ํ๋ฅญ', '๊ฐ์ฌ', '๊ธฐ๋']
negative_words = ['๋ถ๋ง', '์ค๋ง', '๋ฌธ์ ', '์ด๋ ต๋ค', 'ํ๋ค๋ค']
pos_count = sum(transcript.count(word) for word in positive_words)
neg_count = sum(transcript.count(word) for word in negative_words)
if pos_count > neg_count:
return "๊ธ์ ์ ๐"
elif neg_count > pos_count:
return "๋ถ์ ์ ๐"
else:
return "์ค๋ฆฝ์ ๐"
def _extract_next_steps(self, transcript):
"""๋ค์ ๋จ๊ณ ์ถ์ถ"""
next_keywords = ['๋ค์', '์ดํ', 'ํฅํ', '๊ณํ', '์์ ']
next_steps = []
sentences = transcript.split('.')
for sentence in sentences:
if any(keyword in sentence for keyword in next_keywords):
next_steps.append(sentence.strip())
return next_steps
def _save_to_crm(self, insights):
"""CRM ์์คํ
์ ์ ์ฅ"""
# ์ค์ CRM API ์ฐ๋ ์ฝ๋
print(f"๐พ CRM์ ์ ์ฅ: {insights['customer']}")
# API ํธ์ถ ๋ฑ...
์๋๋ฆฌ์ค 3: ๋ค๊ตญ์ด ํ์ ์ง์
๊ธ๋ก๋ฒ ํ์ ๋ค๊ตญ์ด ํ์๋ฅผ ์๋์ผ๋ก ๋ฒ์ญํ๊ณ ์์ฝํฉ๋๋ค.from googletrans import Translator
class MultilingualMeetingProcessor:
"""๋ค๊ตญ์ด ํ์ ์ฒ๋ฆฌ"""
def __init__(self):
self.ai = MeetingAISystem()
self.translator = Translator()
def process_multilingual_meeting(self, audio_file, source_lang="ko", target_langs=["en", "ja"]):
"""
๋ค๊ตญ์ด ํ์ ์ฒ๋ฆฌ
source_lang: ์๋ณธ ์ธ์ด
target_langs: ๋ฒ์ญํ ์ธ์ด๋ค
"""
# ๊ธฐ๋ณธ ์ฒ๋ฆฌ
result = self.ai.process_meeting(audio_file)
# ๋ค๊ตญ์ด ์์ฝ ์์ฑ
multilingual_summaries = {}
for lang in target_langs:
print(f"๐ {lang} ๋ฒ์ญ ์ค...")
translated = self.translator.translate(
result["summary"],
src=source_lang,
dest=lang
)
multilingual_summaries[lang] = translated.text
# ์๋ณธ ํฌํจ
multilingual_summaries[source_lang] = result["summary"]
# ๋ค๊ตญ์ด ๋ฌธ์ ์์ฑ
self._create_multilingual_document(multilingual_summaries)
return multilingual_summaries
def _create_multilingual_document(self, summaries):
"""๋ค๊ตญ์ด ๋ฌธ์ ์์ฑ"""
from docx import Document
doc = Document()
doc.add_heading('Multilingual Meeting Summary', 0)
lang_names = {
"ko": "ํ๊ตญ์ด",
"en": "English",
"ja": "ๆฅๆฌ่ช",
"zh": "ไธญๆ"
}
for lang, summary in summaries.items():
doc.add_heading(f'{lang_names.get(lang, lang)} Summary', 1)
doc.add_paragraph(summary)
doc.add_paragraph() # ๋น ์ค
doc.save("multilingual_summary.docx")
print("๐ ๋ค๊ตญ์ด ๋ฌธ์ ์์ฑ ์๋ฃ!")
๐ ๋ณด์๊ณผ ๊ฐ์ธ์ ๋ณด ๋ณดํธ
ํ์ ๋ด์ฉ์ ๋ฏผ๊ฐํ ์ ๋ณด๋ฅผ ํฌํจํ ์ ์์ด์. ๋ณด์์ ์ฒ ์ ํ ํด์ผ ํฉ๋๋ค! ๐ํ์ ๋ณด์ ์ฒดํฌ๋ฆฌ์คํธ
1. ๋ฐ์ดํฐ ์ํธํํ์ ๋ น์ ํ์ผ๊ณผ ํ ์คํธ๋ ๋ฐ๋์ ์ํธํํด์ ์ ์ฅํ์ธ์.
from cryptography.fernet import Fernet
import os
class SecureMeetingStorage:
"""์์ ํ ํ์ ๋ฐ์ดํฐ ์ ์ฅ"""
def __init__(self):
# ์ํธํ ํค ์์ฑ (์ค์ ๋ก๋ ์์ ํ ๊ณณ์ ๋ณด๊ด)
self.key = Fernet.generate_key()
self.cipher = Fernet(self.key)
def encrypt_file(self, file_path):
"""ํ์ผ ์ํธํ"""
with open(file_path, 'rb') as f:
data = f.read()
encrypted_data = self.cipher.encrypt(data)
# ์ํธํ๋ ํ์ผ ์ ์ฅ
encrypted_path = file_path + '.encrypted'
with open(encrypted_path, 'wb') as f:
f.write(encrypted_data)
# ์๋ณธ ํ์ผ ์ญ์
os.remove(file_path)
print(f"๐ ํ์ผ ์ํธํ ์๋ฃ: {encrypted_path}")
return encrypted_path
def decrypt_file(self, encrypted_path):
"""ํ์ผ ๋ณตํธํ"""
with open(encrypted_path, 'rb') as f:
encrypted_data = f.read()
decrypted_data = self.cipher.decrypt(encrypted_data)
# ๋ณตํธํ๋ ํ์ผ ์ ์ฅ
original_path = encrypted_path.replace('.encrypted', '')
with open(original_path, 'wb') as f:
f.write(decrypted_data)
print(f"๐ ํ์ผ ๋ณตํธํ ์๋ฃ: {original_path}")
return original_path
2. ๊ฐ์ธ์ ๋ณด ๋ง์คํน์ด๋ฆ, ์ ํ๋ฒํธ, ์ด๋ฉ์ผ ๋ฑ ๊ฐ์ธ์ ๋ณด๋ ์๋์ผ๋ก ๋ง์คํนํ์ธ์.
import re
class PrivacyProtector:
"""๊ฐ์ธ์ ๋ณด ๋ณดํธ"""
def mask_personal_info(self, text):
"""๊ฐ์ธ์ ๋ณด ๋ง์คํน"""
# ์ด๋ฉ์ผ ๋ง์คํน
text = re.sub(
r'\b[A-Za-z0-9._%+-]+@[A-Za-z0-9.-]+\.[A-Z|a-z]{2,}\b',
'[์ด๋ฉ์ผ]',
text
)
# ์ ํ๋ฒํธ ๋ง์คํน
text = re.sub(
r'\b\d{2,3}-\d{3,4}-\d{4}\b',
'[์ ํ๋ฒํธ]',
text
)
# ์ฃผ๋ฏผ๋ฑ๋ก๋ฒํธ ๋ง์คํน
text = re.sub(
r'\b\d{6}-\d{7}\b',
'[์ฃผ๋ฏผ๋ฒํธ]',
text
)
return text
def anonymize_speakers(self, text):
"""ํ์ ์ต๋ช
ํ"""
# ์ด๋ฆ์ ํ์1, ํ์2 ๋ฑ์ผ๋ก ๋ณ๊ฒฝ
names = self._extract_names(text)
for i, name in enumerate(names, 1):
text = text.replace(name, f"ํ์{i}")
return text
def _extract_names(self, text):
"""์ด๋ฆ ์ถ์ถ (๊ฐ๋จํ ๋ฒ์ )"""
# ์ค์ ๋ก๋ NER ๋ชจ๋ธ ์ฌ์ฉ
# ์ฌ๊ธฐ์๋ ์์๋ก ๊ฐ๋จํ ๊ตฌํ
return []
3. ์ ๊ทผ ๊ถํ ๊ด๋ฆฌํ์ ์์ฝ์ ๋ํ ์ ๊ทผ ๊ถํ์ ์ฒ ์ ํ ๊ด๋ฆฌํ์ธ์.
class AccessControl:
"""์ ๊ทผ ๊ถํ ๊ด๋ฆฌ"""
def __init__(self):
self.permissions = {}
def grant_access(self, user_id, meeting_id, permission_level="read"):
"""์ ๊ทผ ๊ถํ ๋ถ์ฌ"""
if meeting_id not in self.permissions:
self.permissions[meeting_id] = {}
self.permissions[meeting_id][user_id] = permission_level
print(f"โ
{user_id}์๊ฒ {meeting_id} {permission_level} ๊ถํ ๋ถ์ฌ")
def check_access(self, user_id, meeting_id, required_permission="read"):
"""์ ๊ทผ ๊ถํ ํ์ธ"""
if meeting_id not in self.permissions:
return False
user_permission = self.permissions[meeting_id].get(user_id)
permission_levels = ["read", "write", "admin"]
if user_permission in permission_levels:
user_level = permission_levels.index(user_permission)
required_level = permission_levels.index(required_permission)
return user_level >= required_level
return False
def revoke_access(self, user_id, meeting_id):
"""์ ๊ทผ ๊ถํ ์ทจ์"""
if meeting_id in self.permissions:
if user_id in self.permissions[meeting_id]:
del self.permissions[meeting_id][user_id]
print(f"๐ซ {user_id}์ {meeting_id} ์ ๊ทผ ๊ถํ ์ทจ์")
4. ๊ฐ์ฌ ๋ก๊ทธ๋๊ฐ ์ธ์ ์ด๋ค ํ์ ์์ฝ์ ์ ๊ทผํ๋์ง ๊ธฐ๋กํ์ธ์.
import logging
from datetime import datetime
class AuditLogger:
"""๊ฐ์ฌ ๋ก๊ทธ"""
def __init__(self, log_file="audit.log"):
logging.basicConfig(
filename=log_file,
level=logging.INFO,
format='%(asctime)s - %(levelname)s - %(message)s'
)
self.logger = logging.getLogger(__name__)
def log_access(self, user_id, meeting_id, action):
"""์ ๊ทผ ๊ธฐ๋ก"""
self.logger.info(f"User: {user_id} | Meeting: {meeting_id} | Action: {action}")
def log_modification(self, user_id, meeting_id, changes):
"""์์ ๊ธฐ๋ก"""
self.logger.info(f"User: {user_id} | Meeting: {meeting_id} | Changes: {changes}")
def log_deletion(self, user_id, meeting_id):
"""์ญ์ ๊ธฐ๋ก"""
self.logger.warning(f"User: {user_id} | Meeting: {meeting_id} | Action: DELETED")
๐ ํด๋ผ์ฐ๋ ๋ฐฐํฌํ๊ธฐ
๋ก์ปฌ์์๋ง ์ฌ์ฉํ๊ธฐ์ ์๊น์ฃ ? ํด๋ผ์ฐ๋์ ๋ฐฐํฌํด์ ํ ์ ์ฒด๊ฐ ์ฌ์ฉํ ์ ์๊ฒ ๋ง๋ค์ด๋ด ์๋ค! โ๏ธFlask ์น API ๋ง๋ค๊ธฐ
๊ฐ๋จํ ์น API๋ฅผ ๋ง๋ค์ด์ ์ด๋์๋ ์ ๊ทผํ ์ ์๊ฒ ํด๋ด ์๋ค.from flask import Flask, request, jsonify, send_file
from werkzeug.utils import secure_filename
import os
app = Flask(__name__)
app.config['UPLOAD_FOLDER'] = 'uploads'
app.config['MAX_CONTENT_LENGTH'] = 500 * 1024 * 1024 # 500MB ์ ํ
# AI ์์คํ
์ด๊ธฐํ
meeting_ai = CachedMeetingAI()
@app.route('/api/health', methods=['GET'])
def health_check():
"""ํฌ์ค ์ฒดํฌ"""
return jsonify({"status": "healthy", "message": "Meeting AI is running!"})
@app.route('/api/upload', methods=['POST'])
def upload_meeting():
"""ํ์ ํ์ผ ์
๋ก๋"""
if 'file' not in request.files:
return jsonify({"error": "No file provided"}), 400
file = request.files['file']
if file.filename == '':
return jsonify({"error": "Empty filename"}), 400
# ํ์ผ ์ ์ฅ
filename = secure_filename(file.filename)
filepath = os.path.join(app.config['UPLOAD_FOLDER'], filename)
file.save(filepath)
return jsonify({
"message": "File uploaded successfully",
"filename": filename
})
@app.route('/api/process', methods=['POST'])
def process_meeting():
"""ํ์ ์ฒ๋ฆฌ"""
data = request.json
filename = data.get('filename')
if not filename:
return jsonify({"error": "Filename required"}), 400
filepath = os.path.join(app.config['UPLOAD_FOLDER'], filename)
if not os.path.exists(filepath):
return jsonify({"error": "File not found"}), 404
try:
# ํ์ ์ฒ๋ฆฌ
result = meeting_ai.process_meeting(filepath)
return jsonify({
"status": "success",
"summary": result["summary"],
"keywords": [k[0] for k in result["keywords"][:10]],
"stats": {
"original_length": len(result["transcript"]),
"summary_length": len(result["summary"]),
"compression_ratio": f"{(1 - len(result['summary'])/len(result['transcript']))*100:.1f}%"
}
})
except Exception as e:
return jsonify({"error": str(e)}), 500
@app.route('/api/download/<filename>', methods=['GET'])
def download_result(filename):
"""๊ฒฐ๊ณผ ํ์ผ ๋ค์ด๋ก๋"""
filepath = os.path.join('output', filename)
if not os.path.exists(filepath):
return jsonify({"error": "File not found"}), 404
return send_file(filepath, as_attachment=True)
if __name__ == '__main__':
# ์
๋ก๋ ํด๋ ์์ฑ
os.makedirs(app.config['UPLOAD_FOLDER'], exist_ok=True)
os.makedirs('output', exist_ok=True)
# ์๋ฒ ์คํ
app.run(host='0.0.0.0', port=5000, debug=True)
์ด์ ๋ค์๊ณผ ๊ฐ์ด API๋ฅผ ์ฌ์ฉํ ์ ์์ด์:
# Python์์ API ํธ์ถ ์์
import requests
# 1. ํ์ผ ์
๋ก๋
files = {'file': open('meeting.mp3', 'rb')}
response = requests.post('http://localhost:5000/api/upload', files=files)
print(response.json())
# 2. ์ฒ๋ฆฌ ์์ฒญ
data = {'filename': 'meeting.mp3'}
response = requests.post('http://localhost:5000/api/process', json=data)
result = response.json()
print(f"์์ฝ: {result['summary']}")
# 3. ๊ฒฐ๊ณผ ๋ค์ด๋ก๋
response = requests.get('http://localhost:5000/api/download/meeting_summary_20240101_120000.docx')
with open('downloaded_summary.docx', 'wb') as f:
f.write(response.content)
Docker๋ก ์ปจํ ์ด๋ํ
Docker๋ฅผ ์ฌ์ฉํ๋ฉด ์ด๋์๋ ๋์ผํ ํ๊ฒฝ์์ ์คํํ ์ ์์ด์!# Dockerfile
FROM python:3.9-slim
WORKDIR /app
# ์์คํ
์์กด์ฑ ์ค์น
RUN apt-get update && apt-get install -y \
ffmpeg \
git \
&& rm -rf /var/lib/apt/lists/*
# Python ํจํค์ง ์ค์น
COPY requirements.txt .
RUN pip install --no-cache-dir -r requirements.txt
# ์ ํ๋ฆฌ์ผ์ด์
์ฝ๋ ๋ณต์ฌ
COPY . .
# ํฌํธ ๋
ธ์ถ
EXPOSE 5000
# ์คํ
CMD ["python", "app.py"]
# requirements.txt
flask==2.3.0
openai-whisper==20230314
transformers==4.30.0
torch==2.0.0
nltk==3.8.1
spacy==3.5.0
python-docx==0.8.11
pydub==0.25.1
sentence-transformers==2.2.2
cryptography==41.0.0
googletrans==4.0.0rc1
# docker-compose.yml
version: '3.8'
services:
meeting-ai:
build: .
ports:
- "5000:5000"
volumes:
- ./uploads:/app/uploads
- ./output:/app/output
environment:
- FLASK_ENV=production
restart: unless-stopped
์คํ ๋ฐฉ๋ฒ:
# Docker ์ด๋ฏธ์ง ๋น๋
docker-compose build
# ์ปจํ
์ด๋ ์คํ
docker-compose up -d
# ๋ก๊ทธ ํ์ธ
docker-compose logs -f
# ์ค์ง
docker-compose down
๐ก ์ถ๊ฐ ๊ฐ์ ์์ด๋์ด
๊ธฐ๋ณธ ๊ธฐ๋ฅ์ ์์ฑํ์ง๋ง, ๋ ๋ฐ์ ์ํฌ ์ ์๋ ์์ด๋์ด๋ค์ด ๋ง์์! ๐จ2. ํ์ ๋ถ๋ฆฌ(Speaker Diarization)
๋๊ฐ ๋ฌด์์ ๋งํ๋์ง ๊ตฌ๋ถํ๋ ๊ธฐ๋ฅ์ ์ถ๊ฐํ๋ฉด ๋ ์ ์ฉํด์ง๋๋ค. pyannote.audio ๋ผ์ด๋ธ๋ฌ๋ฆฌ๋ฅผ ํ์ฉํ์ธ์!
3. ๊ฐ์ ๋ถ์ ๊ฐํ
ํ์ ๋ถ์๊ธฐ๋ ์ฐธ์์๋ค์ ๊ฐ์ ์ํ๋ฅผ ๋ถ์ํด์ ์๊ฐํํ ์ ์์ด์.
4. ์ก์ ์์ดํ ์๋ ์ถ์ถ
"~ํ๊ธฐ๋ก ํ์ต๋๋ค", "~๊น์ง ์๋ฃ" ๊ฐ์ ํํ์์ ์๋์ผ๋ก ํ ์ผ ๋ชฉ๋ก์ ๋ง๋ค์ด์ค๋๋ค.
5. ์บ๋ฆฐ๋ ์ฐ๋
์ถ์ถ๋ ์ก์ ์์ดํ ์ ์๋์ผ๋ก ๊ตฌ๊ธ ์บ๋ฆฐ๋๋ ์์๋ฃฉ์ ๋ฑ๋กํ๋ ๊ธฐ๋ฅ!
6. ํ์ ํ์ง ํ๊ฐ
ํ์๊ฐ ์ผ๋ง๋ ํจ์จ์ ์ด์๋์ง, ์ฃผ์ ์์ ๋ฒ์ด๋ ๋ํ๋ ์์๋์ง ๋ฑ์ ๋ถ์ํฉ๋๋ค.
7. ๋ค์ค ๋ชจ๋ธ ์์๋ธ
์ฌ๋ฌ ์์ฝ ๋ชจ๋ธ์ ๊ฒฐ๊ณผ๋ฅผ ์กฐํฉํด์ ๋ ์ ํํ ์์ฝ์ ๋ง๋ค ์ ์์ด์.
8. ํ์ธํ๋
ํ์ฌ๋ ํ์ ํน์ ๋๋ฉ์ธ์ ๋ง๊ฒ ๋ชจ๋ธ์ ์ฌํ์ต์ํค๋ฉด ์ ํ๋๊ฐ ํฌ๊ฒ ํฅ์๋ฉ๋๋ค!
๐ ํ์ต ๋ฆฌ์์ค์ ์ปค๋ฎค๋ํฐ
๋ ๊น์ด ๊ณต๋ถํ๊ณ ์ถ๋ค๋ฉด ์ด๋ฐ ๋ฆฌ์์ค๋ค์ ํ์ฉํด๋ณด์ธ์! ๐โข Coursera - Natural Language Processing Specialization
โข Fast.ai - Practical Deep Learning for Coders
โข Hugging Face Course - ๋ฌด๋ฃ Transformers ๊ฐ์
๐ ์ถ์ฒ ๋์
โข "Speech and Language Processing" - Dan Jurafsky
โข "Natural Language Processing with Transformers" - Lewis Tunstall
โข "ํ์ด์ฌ ์์ฐ์ด ์ฒ๋ฆฌ์ ์ด๋ก ๊ณผ ์ค์ " - ํ๊ตญ์ด NLP ์ ๋ฌธ์
๐ฌ ์ปค๋ฎค๋ํฐ
โข Hugging Face Forums - ๋ชจ๋ธ ๊ด๋ จ ์ง๋ฌธ
โข Reddit r/MachineLearning - ์ต์ ์ฐ๊ตฌ ๋ํฅ
โข Stack Overflow - ์ฝ๋ฉ ๋ฌธ์ ํด๊ฒฐ
โข ์ฌ๋ฅ๋ท - AI ๊ฐ๋ฐ ์ฌ๋ฅ ๊ณต์ ๋ฐ ํ์ !
๐ง ์ ์ฉํ ๋๊ตฌ
โข Weights & Biases - ์คํ ์ถ์
โข TensorBoard - ๋ชจ๋ธ ์๊ฐํ
โข Gradio - ๋น ๋ฅธ ๋ฐ๋ชจ ์ ์
โข Streamlit - ์น ์ฑ ๊ตฌ์ถ
๐ ๋ง๋ฌด๋ฆฌํ๋ฉฐ
์! ์ฌ๊ธฐ๊น์ง ์ค๋๋ผ ์๊ณ ๋ง์ผ์ จ์ด์! ๐ ์ฐ๋ฆฌ๋ ์ง๊ธ๊น์ง ํ์ ๋ฉ๋ชจ ์์ฝ AI๋ฅผ ์ฒ์๋ถํฐ ๋๊น์ง ๋ง๋ค์ด๋ดค์ต๋๋ค.์ฐ๋ฆฌ๊ฐ ๋ฐฐ์ด ๋ด์ฉ์ ์ ๋ฆฌํ๋ฉด:
โ ์์ฑ์ ํ ์คํธ๋ก ๋ณํํ๋ STT ๊ธฐ์ (Whisper)
โ ์์ฐ์ด ์ฒ๋ฆฌ์ ํ ์คํธ ๋ถ์ (NLTK, spaCy)
โ ์ถ์ถ์ /์์ฑ์ ์์ฝ ๊ธฐ๋ฒ (Transformers)
โ ์ค์ ํ์ฉ ์๋๋ฆฌ์ค์ ์ต์ ํ ๋ฐฉ๋ฒ
โ ๋ณด์๊ณผ ๊ฐ์ธ์ ๋ณด ๋ณดํธ
โ ํด๋ผ์ฐ๋ ๋ฐฐํฌ์ API ๊ตฌ์ถ
์ด์ ์ฌ๋ฌ๋ถ์ ํ์ ๋ฉ๋ชจ ์์ฝ AI๋ฅผ ์ง์ ๋ง๋ค๊ณ ์ด์ํ ์ ์๋ ๋ฅ๋ ฅ์ ๊ฐ์ถ์ จ์ต๋๋ค! ๐ช
2. ์ปค์คํฐ๋ง์ด์ง - ํ์ฌ๋ ํ์ ํน์ฑ์ ๋ง๊ฒ ๊ธฐ๋ฅ์ ์ถ๊ฐํ๊ฑฐ๋ ์์ ํ์ธ์
3. ๊ณต์ ํ๊ธฐ - ์ฌ๋ฅ๋ท ๊ฐ์ ํ๋ซํผ์์ ์ฌ๋ฌ๋ถ์ ๋ ธํ์ฐ๋ฅผ ๊ณต์ ํ๊ณ ๋ค๋ฅธ ๊ฐ๋ฐ์๋ค๊ณผ ํ์ ํ์ธ์
4. ์ง์์ ๊ฐ์ - ์ฌ์ฉ์ ํผ๋๋ฐฑ์ ๋ฐ์์ ๊ณ์ ๋ฐ์ ์ํค์ธ์
AI ๊ธฐ์ ์ ๋น ๋ฅด๊ฒ ๋ฐ์ ํ๊ณ ์์ต๋๋ค. ์ค๋ ๋ฐฐ์ด ๋ด์ฉ์ ๊ธฐ๋ฐ์ผ๋ก ๊ณ์ ํ์ตํ๊ณ ์คํํ๋ฉด์ ๋ ๋์ ์์คํ ์ ๋ง๋ค์ด๊ฐ์ธ์! ๐
๊ทธ๋ผ ์ฌ๋ฌ๋ถ์ ๋ฉ์ง AI ํ๋ก์ ํธ๋ฅผ ์์ํฉ๋๋ค! ํ์ดํ ! ๐โจ
๊ด๋ จ ํค์๋
๋๊ธ ์์ฑ
์ด ๊ธ์ ๋ํ ์ฌ๋ฌ๋ถ์ ์๊ฐ์ ๋ค๋ ค์ฃผ์ธ์
๋ก๊ทธ์ธ์ด ํ์ํฉ๋๋ค
๋๊ธ์ ์์ฑํ๋ ค๋ฉด ๋จผ์ ๋ก๊ทธ์ธํด์ฃผ์ธ์.
๋๊ธ 0
์ง์์ธ์ ์ฒ - ์ง์ ์ฌ์ฐ๊ถ ๋ณดํธ ๊ณ ์ง
์ง์ ์ฌ์ฐ๊ถ ๋ณดํธ ๊ณ ์ง
- ์ ์๊ถ ๋ฐ ์์ ๊ถ: ๋ณธ ์ปจํ ์ธ ๋ ์ฌ๋ฅ๋ท์ ๋ ์ AI ๊ธฐ์ ๋ก ์์ฑ๋์์ผ๋ฉฐ, ๋ํ๋ฏผ๊ตญ ์ ์๊ถ๋ฒ ๋ฐ ๊ตญ์ ์ ์๊ถ ํ์ฝ์ ์ํด ๋ณดํธ๋ฉ๋๋ค.
- AI ์์ฑ ์ปจํ ์ธ ์ ๋ฒ์ ์ง์: ๋ณธ AI ์์ฑ ์ปจํ ์ธ ๋ ์ฌ๋ฅ๋ท์ ์ง์ ์ฐฝ์๋ฌผ๋ก ์ธ์ ๋๋ฉฐ, ๊ด๋ จ ๋ฒ๊ท์ ๋ฐ๋ผ ์ ์๊ถ ๋ณดํธ๋ฅผ ๋ฐ์ต๋๋ค.
- ์ฌ์ฉ ์ ํ: ์ฌ๋ฅ๋ท์ ๋ช ์์ ์๋ฉด ๋์ ์์ด ๋ณธ ์ปจํ ์ธ ๋ฅผ ๋ณต์ , ์์ , ๋ฐฐํฌ, ๋๋ ์์ ์ ์ผ๋ก ํ์ฉํ๋ ํ์๋ ์๊ฒฉํ ๊ธ์ง๋ฉ๋๋ค.
- ๋ฐ์ดํฐ ์์ง ๊ธ์ง: ๋ณธ ์ปจํ ์ธ ์ ๋ํ ๋ฌด๋จ ์คํฌ๋ํ, ํฌ๋กค๋ง, ๋ฐ ์๋ํ๋ ๋ฐ์ดํฐ ์์ง์ ๋ฒ์ ์ ์ฌ์ ๋์์ด ๋ฉ๋๋ค.
- AI ํ์ต ์ ํ: ์ฌ๋ฅ๋ท์ AI ์์ฑ ์ปจํ ์ธ ๋ฅผ ํ AI ๋ชจ๋ธ ํ์ต์ ๋ฌด๋จ ์ฌ์ฉํ๋ ํ์๋ ๊ธ์ง๋๋ฉฐ, ์ด๋ ์ง์ ์ฌ์ฐ๊ถ ์นจํด๋ก ๊ฐ์ฃผ๋ฉ๋๋ค.
์์ง ๋๊ธ์ด ์์ต๋๋ค.