Files
2nd/10_Wiki/Topic_Programming/AI_and_ML/Linguistic-Analysis-in-AI.md
T
Antigravity Agent 9148c358d0 docs(10_Wiki): 위키 전체 재구성 — Topic_* 폴더를 4개 카테고리로 통합 + 대규모 중복 제거
Topic_Agent/Topic_Blog/Topics/Topics_Biz/Topics_Meeting/Topics_Rag의 마크다운 지식 문서를
Topic_General/Topic_Programming/Topic_Graphic/Topic_Business 4개 카테고리로 재분류.

- 중복 제거: frontmatter의 status:duplicate/merged + duplicate_of/redirect_to 필드로
  자기 자신을 중복으로 선언한 리다이렉트 stub 1032개 제거, 완전 동일 내용 파일 472개 제거,
  동일 파일명·다른 내용 충돌 시 더 큰(완전한) 버전만 유지(162개 제거) — 총 1639개 중복 제거.
- 분류: 폴더 단위로 명확한 항목(AI_and_ML/Coding/Architecture 등 → Programming,
  Comfyui/Visual_Effects → Graphic, Topics_Biz/Topics_Meeting/사업 등 → Business,
  Poetic_Blog_Writing/창의성/Game_Design 등 → General)은 폴더 우선순위로,
  나머지 혼재 폴더(Topic_Agent/Topic_Blog/Topics 루트/Thinking & Reasoning/Other/UI_UX_Assets)는
  title/tags 키워드 스코어링으로 파일 단위 분류(불명확한 경우 General로 폴백).
  원본 폴더명은 "From_*" 서브폴더로 보존해 추적 가능성 유지.
- 최종 배치: Programming 2784 / General 1608 / Graphic 285 / Business 249 = 4926개 문서.
- 에이전트 운영 상태(.astra/.agent/.obsidian/sessions/memory/_company/docs/lessons/_shared/src)는
  지식 콘텐츠가 아니므로 재분류 대상에서 제외하고 원위치 유지.
- Topics/Topic_email(상위 보호 폴더 Topic_email과 파일명 100% 중복) 삭제 — 보호 폴더 자체는 미변경.
- 완전히 비게 된 Topic_Agent/Topic_Blog/Topics_Biz/Topics_Rag 폴더 제거.
2026-07-05 00:33:48 +09:00

4.4 KiB

id, title, category, status, canonical_id, aliases, duplicate_of, source_trust_level, confidence_score, verification_status, tags, raw_sources, last_reinforced, github_commit, tech_stack
id title category status canonical_id aliases duplicate_of source_trust_level confidence_score verification_status tags raw_sources last_reinforced github_commit tech_stack
wiki-2026-0508-linguistic-analysis-in-ai Linguistic Analysis in AI 10_Wiki/Topics verified self
NLP Linguistic Analysis
Syntactic Analysis
Linguistic Features
none A 0.85 applied
nlp
ai
linguistics
parsing
ner
llm
2026-05-10 pending
language framework
python spacy-stanza-llm

Linguistic Analysis in AI

매 한 줄

"매 LLM 시대에도 구조 분석은 살아있다". POS/dependency/NER 같은 전통 분석은 여전히 정보 추출·검색·평가에 쓰이지만, 2026엔 LLM이 zero-shot으로 대부분 대체.

매 핵심

매 분석 단계

  • Tokenization: 단어/subword 분리.
  • POS tagging: 품사 (NOUN, VERB, ADJ).
  • Lemmatization / Stemming: 어간 정규화.
  • Dependency parsing: 단어 간 문법 관계 트리.
  • Constituency parsing: 구 구조 (NP, VP).
  • NER: Named Entity Recognition (PER, ORG, LOC).
  • SRL: Semantic Role Labeling (agent, patient).
  • Coreference: 대명사 해결.

매 응용

  1. 정보 추출 (KG 구축, relation extraction).
  2. 검색 쿼리 재작성, 의도 파싱.
  3. RAG에서 entity 기반 chunking.
  4. 평가 (LLM 출력의 grammaticality, faithfulness).
  5. 저자원 언어 도구 체인.
  6. 데이터 정제 / privacy redaction (NER로 PII 마스킹).

💻 패턴

Pattern 1 — spaCy 표준 파이프라인

import spacy
nlp = spacy.load('ko_core_news_lg')
doc = nlp("애플은 2026년 비전 프로 2를 출시했다.")
for tok in doc:
    print(tok.text, tok.pos_, tok.dep_, tok.head.text)
for ent in doc.ents:
    print(ent.text, ent.label_)

Pattern 2 — Stanza (다국어 정확도)

import stanza
nlp = stanza.Pipeline('ko', processors='tokenize,pos,lemma,depparse,ner')
doc = nlp(text)

Pattern 3 — LLM zero-shot NER

from anthropic import Anthropic
client = Anthropic()
resp = client.messages.create(
    model='claude-opus-4-7',
    messages=[{'role':'user','content':
        f'Extract entities as JSON [{{"text","type"}}]:\n{text}'}],
    max_tokens=1024,
)

Pattern 4 — Dependency 기반 관계 추출

for tok in doc:
    if tok.dep_ == 'nsubj' and tok.head.pos_ == 'VERB':
        print('subject:', tok.text, '->', tok.head.text)

Pattern 5 — PII Redaction (NER)

def redact(text):
    doc = nlp(text)
    out = text
    for ent in reversed(doc.ents):
        if ent.label_ in {'PERSON','GPE','PHONE'}:
            out = out[:ent.start_char] + f'[{ent.label_}]' + out[ent.end_char:]
    return out

Pattern 6 — Hybrid (LLM + parser 검증)

# LLM으로 빠르게 추출 → spaCy로 검증/정렬
candidates = llm_extract(text)
doc = nlp(text)
verified = [c for c in candidates if any(c['text']==e.text for e in doc.ents)]

매 결정 기준

상황 도구
대량 / 저예산 / 정형 spaCy / Stanza
정확도 우선 다국어 Stanza, Trankit
Zero-shot, 도메인 특수 LLM (Claude/GPT)
실시간 latency spaCy small model
학습 데이터 라벨링 LLM weak supervision + 검수
Production NER 한국어 KoNLPy + spaCy ko 또는 LLM

기본값: 2026 - LLM zero-shot이 default, spaCy는 비용 민감/대량 처리에.

🔗 Graph

🤖 LLM 활용

언제:

  • 짧은 텍스트 entity/relation 추출 (zero-shot).
  • spaCy/Stanza 파이프라인 코드 생성.
  • 한국어/저자원 언어 빠른 프로토타입.

언제 X:

  • 100M doc 배치 (비용 - 전통 도구가 100배 저렴).
  • 결정론적 재현성 필수 (LLM 비결정성).

안티패턴

  • LLM에 토크나이저 정보 의존 (모델별 상이).
  • 영어 모델로 한국어 NER (도메인 mismatch).
  • Dependency tree 결과를 ground truth로 (parser도 ~92%).
  • 모든 문제에 LLM (단순 POS 태깅에 GPT-4 호출은 낭비).
  • Tokenization 영향 무시 (subword가 단어 경계 깨짐).

🧪 검증 / 중복

  • Verified. spaCy 3.7+/Stanza 1.8 기준. 신뢰도 A.

🕓 Changelog

날짜 변경
2026-05-08 Phase 1
2026-05-10 Manual cleanup