Chapter 04: 데이터 형식 명세

弘益人間
표준화된 데이터가 협력을 가능하게 합니다

4.1 메타데이터 스키마

언어 정보 (Language Metadata)

// 언어 메타데이터 인터페이스
interface LanguageMetadata {
  code: string;           // ISO 639-3 코드
  name: string;           // 영어 이름
  nativeName: string;     // 원어민 표기
  glottologId: string;    // Glottolog ID
  family: string;         // 언어 가족
  endangerment: {
    status: EndangermentLevel;
    unescoLevel: number;  // 0-5
    speakerCount: number;
    lastUpdated: string;
  };
  region: {
    countries: string[];
    areas: string[];
    coordinates: { lat: number; lng: number };
  };
  script: {
    primary: string;
    romanization: string;
    unicodeBlocks: string[];
  };
  dialects: Dialect[];
}

type EndangermentLevel =
  | 'safe'
  | 'vulnerable'
  | 'definitely_endangered'
  | 'severely_endangered'
  | 'critically_endangered'
  | 'extinct';

4.2 작업별 데이터 형식

기계 번역 (Machine Translation)

// 병렬 말뭉치 형식
interface ParallelCorpusEntry {
  id: string;
  source: {
    language: string;
    text: string;
    romanization?: string;
    gloss?: string;
  };
  target: {
    language: string;
    text: string;
    romanization?: string;
  };
  metadata: {
    domain: string;
    formality: 'formal' | 'informal' | 'polite';
    dialect?: string;
    verified: boolean;
    verifier?: string;
    culturalSignificance?: string;
    usageRestrictions?: string;
  };
}

// 예시 데이터
const ainuJaParallel: ParallelCorpusEntry = {
  id: 'ain-ja-001',
  source: {
    language: 'ain',
    text: 'イランカラプテ',
    romanization: 'irankarapte',
    gloss: 'greet-polite'
  },
  target: {
    language: 'ja',
    text: 'こんにちは',
    romanization: 'konnichiwa'
  },
  metadata: {
    domain: 'greetings',
    formality: 'polite',
    dialect: 'Hokkaido',
    verified: true
  }
};

음성 인식 (ASR)

필드타입설명필수
audio.pathstring오디오 파일 경로✅
audio.durationnumber재생 시간(초)✅
transcription.textstring전사 텍스트✅
speaker.idstring화자 ID (익명)✅
speaker.dialectstring방언⚪
recording.environmentstring녹음 환경⚪

텍스트 음성 변환 (TTS)

// TTS 훈련 데이터
interface TTSTrainingData {
  id: string;
  text: {
    raw: string;
    normalized: string;
    phonemes: string;
    prosodyMarkers?: string;
  };
  audio: {
    path: string;
    duration: number;
    sampleRate: number;  // 권장: 22050
  };
  phonemeAlignment: PhonemeTimestamp[];
  prosody?: {
    pitch: number[];
    energy: number[];
    speakingRate: number;
  };
}

interface PhonemeTimestamp {
  phoneme: string;
  start: number;
  end: number;
}

4.3 모델 형식

형식용도플랫폼파일
HuggingFace사전 훈련PyTorchpytorch_model.bin
ONNX배포크로스 플랫폼model.onnx
TFLite모바일Android/iOSmodel.tflite
Adapter미세조정경량화adapter_model.bin
// 어댑터 기반 미세 조정
interface AdapterConfig {
  adapterSize: number;       // 64 (기본 768에서 축소)
  adapterLayers: number[];   // [6, 11] 중간/마지막만
  trainableParams: number;   // 전체의 0.5%
  compressionRatio: number;  // 200배 압축
  baseModel: string;         // 참조할 기본 모델
}

// 파일 구조
// ain-ja-translation-adapter/
// ├── adapter_config.json   (설정)
// ├── adapter_model.bin     (5MB, 가중치만)
// └── base_model: "ain-bert-base"

4.4 데이터 검증

// WIA-LANG-005 데이터 검증기
class WIALang005Validator {
  async validateDataset(path: string): Promise<ValidationResult> {
    const errors: string[] = [];

    // 1. 스키마 검증
    if (!await this.validateSchema(path)) {
      errors.push('Schema validation failed');
    }

    // 2. 메타데이터 검증
    const metadata = await this.loadMetadata(path);
    if (!this.validateMetadata(metadata)) {
      errors.push('Invalid metadata');
    }

    // 3. 언어 코드 검증 (ISO 639-3)
    if (!this.validateLanguageCode(metadata.language.code)) {
      errors.push('Invalid ISO 639-3 code');
    }

    // 4. 데이터 무결성
    if (!await this.validateDataIntegrity(path)) {
      errors.push('Data integrity failed');
    }

    // 5. 체크섬 검증
    if (!await this.validateChecksums(path)) {
      errors.push('Checksum mismatch');
    }

    return {
      valid: errors.length === 0,
      errors
    };
  }
}

4.5 프라이버시 및 문화적 민감성

ℹ️ 문화적 민감성 태그:
// 익명화 요구사항
interface PrivacyConfig {
  anonymizationRequired: boolean;
  piiFields: string[];  // 개인정보 필드
  anonymizationMethods: {
    speakerId: 'hashed_uuid';
    location: 'generalized_to_region';
    dates: 'year_only';
  };
  retention: {
    rawAudio: 'encrypted_storage';
    transcriptions: 'hashed_speaker_ids';
    accessLogs: '90_days';
  };
}

📚 핵심 요약

  1. 메타데이터: 언어 정보, 위기 상태, 지역, 방언을 포함합니다.
  2. 작업별 형식: MT, ASR, TTS, LM, NER 각각에 특화된 형식입니다.
  3. 모델 형식: HuggingFace, ONNX, TFLite, Adapter를 지원합니다.
  4. 품질 보증: 5단계 검증 프로세스로 품질을 보장합니다.
  5. 데이터 증강: 역번역, 동의어 대체, 음성 속도 변경을 지원합니다.
  6. 프라이버시: 익명화와 문화적 민감성 관리를 내장합니다.
  7. 弘益人間: 표준화된 데이터로 전 세계 협력이 가능해집니다.

✏️ 복습 문제

1.

언어 메타데이터의 주요 항목과 중요성을 설명하시오.

2.

MT용 병렬 말뭉치와 ASR용 음성 데이터셋의 차이를 비교하시오.

3.

어댑터 기반 미세 조정이 저자원 언어에 유리한 이유를 논하시오.

4.

데이터 증강 기법 중 텍스트와 오디오에 적용 가능한 것을 설명하시오.

5.

문화적으로 민감한 데이터의 접근 제어 방법을 서술하시오.

6.

WIA-LANG-005 검증 프로세스의 5단계를 설명하시오.

7.

LanguageMetadata 인터페이스를 확장 구현하시오.

8.

ONNX 형식이 배포에 유리한 이유를 분석하시오.

© 2025 SmileStory Co., Ltd. / WIA · 弘益人間

📐 시뮬레이터 패널 3