Instructions to use iknow-lab/azou with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use iknow-lab/azou with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-classification", model="iknow-lab/azou")# pip install -U transformers accelerate # Load model directly from transformers import AutoTokenizer, AutoModelForSequenceClassification tokenizer = AutoTokenizer.from_pretrained("iknow-lab/azou") model = AutoModelForSequenceClassification.from_pretrained("iknow-lab/azou", device_map="auto") - Notebooks
- Google Colab
- Kaggle
|
Download README.md from iknow-lab/azou: direct link, hf CLI and curl.
- Browser
- Download file 6.02 kB
-
https://huggingface.co/iknow-lab/azou/resolve/1a491c719431cb2e18dd21665ce982369bc62dba/README.md
- Command line
-
hf download hf://iknow-lab/azou@1a491c719431cb2e18dd21665ce982369bc62dba/README.md
-
curl -L -o README.md https://huggingface.co/iknow-lab/azou/resolve/1a491c719431cb2e18dd21665ce982369bc62dba/README.md
6.02 kB
metadata
license: mit
widget:
- text: >-
[CLS] 인천발 KTX와 관련한 송도역 복합환승센터가 사실상 무산, 단순 철도·버스 위주 환승시설로 만들어진다. 이 때문에 인천시의
인천발 KTX 기점에 앵커시설인 복합환승센터를 통한 인근 지역 경제 활성화를 이뤄낸다는 계획의 차질이 불가피하다. [SEP] 경제와
관련된 뉴스인가요? [SEP] 예 [SEP]
- text: >-
[CLS] 인천발 KTX와 관련한 송도역 복합환승센터가 사실상 무산, 단순 철도·버스 위주 환승시설로 만들어진다. 이 때문에 인천시의
인천발 KTX 기점에 앵커시설인 복합환승센터를 통한 인근 지역 경제 활성화를 이뤄낸다는 계획의 차질이 불가피하다. [SEP] 경제에
긍정적인 뉴스인가요? [SEP] 아니요 [SEP]
datasets:
- nsmc
- skt/kobest_v1
- jason9693/APEACH
- kor_nlu
- klue
- KETI-AIR/korquad
language:
- ko
pipeline_tag: text-classification
AZOU: GPT 3.5보다 뛰어난 제로샷 분류 성능을 가진 한국어 모델
[CLS] 입력 정보 [SEP] 지시문 [SEP] 라벨 [SEP] 형태의 텍스트를 모델에 넣으면, 모델이 세 텍스트의 관계를 파악하고 점수를 반환합니다. 점수가 높을 수록, 라벨이 지시문을 잘 따르는 결과임을 의미합니다. 텍스트에 다음과 같은 질문을 함께 주고 평가할 수 있습니다.
- 제로샷 분류(주제 분류, 혐오 분류): 이 글의 주제가 뭔가요? 이 글은 혐오 표현을 포함하고 있나요?
- 데이터 검색 및 필터링: 이 글은 "화장품 사용법"에 대한 내용을 포함하고 있나요?
space demo에서 모델을 직접 사용해보세요!
base model: klue/roberta-large
Developers
- 김희규(heekue83@gmail.com)
- 박성호(lop@soongsil.ac.kr)
- 육세현(sdfg8931@ajou.ac.kr)
- 김효진(snowfluppy@ajou.ac.kr)
Benchmark
제로샷 분류 성능
| task | azou | GPT-3.5-turbo |
|---|---|---|
| aihub_complaints_topic | 0.3284 | 0.15 |
| aihub_dialog_topic | 0.428 | 0.32 |
| ko_relation_fields | 0.403 | 0.381 |
| Average | 0.3865 | 0.2837 |
- GPT 3.5-turbo의 경우, 비용 문제로 aihub_complaints_topic는 1300개, aihub_dialog_topic와 ko_relation_fields는 1000개만 평가했습니다.
- aihub_complaints_topic: AIHub 민원 업무 자동화 인공지능 언어 데이터 - 16개 카테고리 class 분류
- aihub_dialog_topic: AIHub 한국어 대화 요약의 10개 주제 class 분류
- ko_relation_fields: AIHub 한국어 지식기반 관계 데이터 의 13개 주제 및 분야 분류
Seen Task 성능
| task | accuracy |
|---|---|
| nsmc | 0.8742 |
| apeach | 0.8326 |
| klue-ynat | 0.8208 |
| kobest-boolq | 0.896 |
| kobest-copa | 0.709 |
| kobest-hellaswag | 0.764 |
| kobest-sentineg | 0.9219 |
| kobest-wic | 0.7984 |
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 |
- GPT 3.5의 성능은 CSATQA 데이터셋의 README에서 가져왔습니다.
사용 예시
# 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}
}