Edit model card

AZOU: GPT 3.5보다 뛰어난 제로샷 분류 성능을 가진 한국어 모델

[CLS] 입력 정보 [SEP] 지시문 [SEP] 라벨 [SEP] 형태의 텍스트를 모델에 넣으면, 모델이 세 텍스트의 관계를 파악하고 점수를 반환합니다. 점수가 높을 수록, 라벨이 지시문을 잘 따르는 결과임을 의미합니다. 텍스트에 다음과 같은 질문을 함께 주고 평가할 수 있습니다.

  1. 제로샷 분류(주제 분류, 혐오 분류): 이 글의 주제가 뭔가요? 이 글은 혐오 표현을 포함하고 있나요?
  2. 데이터 검색 및 필터링: 이 글은 "화장품 사용법"에 대한 내용을 포함하고 있나요?

space demo에서 모델을 직접 사용해보세요!
base model: klue/roberta-large

Developers

Benchmark

제로샷 분류 성능

task azou GPT-3.5-turbo
aihub_complaints_topic 32.84 15
aihub_dialog_topic 42.8 32
ko_relation_fields 40.3 38.1
Average 38.65 28.37
  • 학습에 사용하지 않은 텍스트와 라벨도 잘 분류하는지 판단하기 위해, AIHub의 텍스트 분류 데이터셋들을 가져와서 ChatGPT와 정확도를 비교했습니다.
  • GPT 3.5-turbo의 경우, 비용 문제로 aihub_complaints_topic는 1300개, aihub_dialog_topic와 ko_relation_fields는 1000개만 평가했습니다(azou는 전체 평가).
  • aihub_complaints_topic: AIHub 민원 업무 자동화 인공지능 언어 데이터 - 16개 카테고리 class 분류
  • aihub_dialog_topic: AIHub 한국어 대화 요약의 10개 주제 class 분류
  • ko_relation_fields: AIHub 한국어 지식기반 관계 데이터 의 13개 주제 및 분야 분류

Seen Task 성능

task accuracy
nsmc 87.42
apeach 83.26
klue-ynat 82.08
kobest-boolq 89.6
kobest-copa 70.9
kobest-hellaswag 76.4
kobest-sentineg 92.19
kobest-wic 79.84

CSATQA

Models GR LI RCH RCS RCSS WR Average
polyglot-ko-12.8B 32.0 29.73 17.14 10.81 21.43 18.18 21.55
gpt-3.5-wo-token 16.0 32.43 42.86 18.92 35.71 0.00 24.32
gpt-3.5-w-token 16.0 35.14 42.86 18.92 35.71 9.09 26.29
azou(ours) 24.0 22.32 25.71 21.62 30.95 9.09 22.61

사용 예시

# Load model directly
from transformers import AutoTokenizer, AutoModelForSequenceClassification

tokenizer = AutoTokenizer.from_pretrained("iknow-lab/azou")
model = AutoModelForSequenceClassification.from_pretrained("iknow-lab/azou")

def inference(instruction, input, labels):
    instruction = f"{input} [SEP] {instruction}"
    inputs = tokenizer([instruction] * len(labels), labels, truncation=True, padding=True, return_tensors="pt")
    
    scores = model(**inputs).logits.squeeze(1).tolist()
    output = dict(zip(labels, scores))

    print(instruction, output)

inference(
    "문장을 감성분류해주세요",
    "아 영화 노잼",
    ["긍정적", "부정적"]
)

inference(
    "글과 관련된 내용을 만들어주세요",
    "예전에는 주말마다 극장에 놀러갔는데 요새는 좀 안가는 편이에요",
    ["영화에 관한 글이다", "드라마에 관한 글입니다"]
)


inference(
    "글을 읽고 시장에 미칠 영향을 판단해보세요",
    """인천발 KTX와 관련한 송도역 복합환승센터가 사실상 무산, 단순 철도·버스 위주 환승시설로 만들어진다. 이 때문에 인천시의 인천발 KTX 기점에 앵커시설인 복합환승센터를 통한 인근 지역 경제 활성화를 이뤄낸다는 계획의 차질이 불가피하다.

25일 시에 따르면 연수구 옥련동 104 일대 29만1천725㎡(8만8천평)에 추진 중인 2만8천62가구 규모의 송도역세권구역 도시개발사업과 연계, KTX 송도역 복합환승센터와 상업시설·업무시설 등의 조성을 추진 중이다. """,
    ["긍정", "부정", "중립"]
)

Citation

@misc {azou2023,
  url={https://huggingface.co/iknow-lab/azou/},
  title={AZOU: GPT 3.5보다 뛰어난 제로샷 분류 성능을 가진 한국어 모델},
  author={Kim, Heegyu and Park, Sungho and Yuk, Sehyun and Kim, Hyojin},
  year={2023},
  month={Nov}
} 
Downloads last month
19
Inference API
This model does not have enough activity to be deployed to Inference API (serverless) yet. Increase its social visibility and check back later, or deploy to Inference Endpoints (dedicated) instead.

Datasets used to train iknow-lab/azou

Space using iknow-lab/azou 1