Used to quickly analyze and classify the importance, responsible department, complaint type, and emotional state of civil complaint data uploaded to the Seoul City Response Center.
Inputs & Outputs
The input data consists of a System Prompt with the Qwen2.5 Chat Template applied, along with the complaint title and body data. The output data is keyword data in dictionary format. An example is shown below.
Input: Petition Data With Qwen Chat Template
<|im_start|>system
SYSTEM_PROMPT = """당신은 서울시 민원 분류 담당관입니다. 지금부터 민원과 민원에 대한 답변을 읽고 키워드를 추출해주세요.
민원은 제목인 Title과 본문인 Question으로 구분되어 입력됩니다.
민원에 대한 답변은 Answer로 입력됩니다.
1. importance
Title과 Question을 보고 해당 민원의 중요도를 파악해 높음, 보통, 낮음 중 레이블을 구분하세요.
- 높음 : 행정적 조치, 전문적인 도움이 필요한 글. 특정한 문제가 발생했거나 부당한 처우에 대한 항의.
- 보통 : 보통의 의견이나 제안, 생각을 담은 글. 소식, 칭찬, 정보를 담은 글 등.
- 낮음 : 감정적으로만 작성한 글. 어그로성 글. 특정 개인에 대한 근거 없고 맹목적인 비난 글. 비논리적이고 문맥에 일관성이 없는 글. 작성이 온전히 다 되지 않은 글. 등
2. department
다음은 서울시의 각 부서가 담당하는 분야입니다. 민원 내용을 보고 해당 민원이 전달되어야 할 부서를 골라주세요.
- 교통실 : 버스·지하철·택시, 대중교통 정책, 자전거·킥보드·보행, 주차, 신호, 불법주정차, 한강버스, 교통카드, 도로교통, 자율주행
- 복지실 : 기초생활보장, 저소득층 지원, 노숙인, 어르신 돌봄, 장애인 지원, 아동·청소년 복지, 한부모·다문화가족, 중장년 지원
- 경제실 : 창업·스타트업, 소상공인·전통시장 지원, 청년 취업·일자리, 중소기업 자금, 소비자 권익, 생활임금·노동정책, 자영업자, 지원금
- 기후환경본부 : 쓰레기·재활용, 소각장, 미세먼지·대기질, 동물보호, 탄소중립·신재생에너지, 친환경차·전기차 충전, 도시공원, 식품안전
- 문화본부 : 도서관, 박물관·문화시설, 공연·예술 지원, 문화유산, 전통문화, 관광 계획, 공원 시설 관리/조성
- 시민건강국 : 보건소, 응급의료, 감염병·방역, 정신건강, 예방접종, 치매 예방, 공중위생, 건강증진, 마약 대응, 금연 지원, 금연구역 관리
- 재난안전실 : 재난대응, 취약시설 점검, 도로·보도 안전, 대피소, 시민안전보험, 제설, 인파 안전관리, 도로공사 안전 관리, 공사현장 관리
- 주택실 : 재개발·재건축, 공공주택, 전세사기, 건축인허가, 도시계획, 주거환경개선, 도시재생, 시설물 관리, 공공시설 관리, 부동산, 사유지
- 여성가족실 : 보육·어린이집, 저출생 대응, 아동학대 예방, 청소년 지원·보호, 성폭력·성희롱 예방, 디지털성범죄, 여성 안전, 양성평등
- 분류 보류 : 정부 부서 관할 이외의 기관에 대한 내용. 정치적인 내용.
단, Answer를 제외한 민원(Title과 Question)을 보았을 때 다음의 경우에 해당한다면 '분류 보류'를 설정하세요.
- Title과 Question만으로 민원의 주제를 알 수 없어 특정 부서를 분류할 수 없는 경우
- 첨부 파일을 업로드 했다고 되어 있으나 Title과 Question만으로 어떤 내용인지 유추할 수 없는 경우.
- Title과 Question이 내용을 알 수 없을 정도로 짧은 경우.
3. complaint_type
Title과 Question을 보고 민원의 유형을 다음 중 하나로 구분하세요
- 신고 : 불법 행위, 위험 상황, 규정 위반 등 제3자나 시설에 대한 문제를 알리는 경우
- 문의 : 제도, 정책, 절차, 방법 등에 대한 정보나 안내를 요청하는 경우
- 건의 : 정책 개선, 시설 설치, 제도 변경 등을 제안하는 경우
- 항의 : 행정 처리나 처우에 대한 불만을 표출하거나 시정을 요구하는 경우
- 칭찬 : 공무원, 서비스, 정책 등에 대한 긍정적인 평가를 담은 경우.
- 그 외 : 위 유형 중 어느 것으로도 분류되지 않는 경우.
4. emotion
Title과 Question을 보고 민원인의 감정상태를 긍정, 중립, 부정 중 하나로 구분하세요.
"""<|im_end|>
<|im_start|>user
Title: 하자 있는 행정행위는 어디에 호소해야 합니까?
Question : 2014.7.2 노량진청과물도매시장 폐지가 결정이 됬다는데 ...
<|im_end|>
<|im_start|>assistant
{"importance": "높음", "department": "주택실", "complaint_Type": "항의", "emotion": "부정"}
<|im_end|>
General-purpose text classification tasks unrelated to civil complaints
Use as a base model for further fine-tuning
Any malicious use such as generating or manipulating complaint data
Bias, Risks, and Limitations
None
Recommendations
For optimal model performance, it is recommended to use the same System Prompt during inference as the one used during fine-tuning.
Users (both direct and downstream) should be made aware of the risks, biases and limitations of the model. More information needed for further recommendations.
How to Get Started with the Model
Use the code below to get started with the model.
python
1import torch
2from peft import AutoPeftModelForCausalLM
3from transformers import AutoTokenizer
45peft_model_id ="leejunho12316/qwen2.5-3b-finetuned-checkpoint1300"67tokenizer = AutoTokenizer.from_pretrained(peft_model_id)8model = AutoPeftModelForCausalLM.from_pretrained(9 peft_model_id,10 device_map="auto",11 torch_dtype=torch.float16
12)1314SYSTEM_PROMPT ="""당신은 서울시 민원 분류 담당관입니다..."""# Use the full system prompt from above1516messages =[17{"role":"system","content": SYSTEM_PROMPT},18{"role":"user","content":"Title: ...\nQuestion: ..."}19]2021text = tokenizer.apply_chat_template(messages, tokenize=False, add_generation_prompt=True)22inputs = tokenizer(text, return_tensors="pt").to(model.device)2324with torch.no_grad():25 outputs = model.generate(**inputs, max_new_tokens=64)2627print(tokenizer.decode(outputs[0][inputs["input_ids"].shape[1]:], skip_special_tokens=True))28# Output: {"importance": "높음", "department": "주택실", "complaint_Type": "항의", "emotion": "부정"}
Raw Source: Seoul City Response Center (서울시 응답소 - 시장에게 알린다), web-crawled from 2011 Q4 to April 2026
Total labeled samples: 2,500
Train set: 2,000 samples (80%)
Test set: 500 samples (20%)
Label generation: Labels were generated using Claude claude-haiku-4-5 with with_structured_output (Pydantic BaseModel), selected among 6 LLMs based on labeling accuracy measured against 50 manually annotated ground-truth samples.
Training Procedure
Preprocessing
Raw data cleaning: Removed 356 anomalies from 13,540 rows → 13,184 rows
Irretrievable data (lost attachments, abnormally short content)
Label shuffling: Department options in the system prompt were randomly shuffled per sample during label generation to prevent order-bias memorization.
Chat template conversion: Applied Qwen2.5 chat template to each sample, with tokenize=False and add_generation_prompt=True.
Loss masking via collate_fn: System and user token positions are masked with -100 so the model only computes loss on the assistant output (the keyword dictionary). Padding tokens are also masked with -100.
Total training steps: ~1,500 steps over 3 epochs on 2,000 samples
Evaluation
Testing Data, Factors & Metrics
Testing Data
Test set: 500 samples held out from the 2,500 labeled dataset (20% split)
Source: Same distribution as training data (Seoul City Response Center complaints)
Factors
Evaluation is disaggregated by keyword type:
importance (중요도): 높음 / 보통 / 낮음
department (전달부서): 10 Seoul city departments + 분류보류
complaint_type (민원유형): 신고 / 문의 / 건의 / 항의 / 칭찬 / 그 외
emotion (감정상태): 긍정 / 중립 / 부정
Metrics
Keyword-level accuracy: exact string match between predicted and ground-truth label for each of the 4 keywords.
Results
Qwen2.5-3B, Checkpoint 1300 (final model):
Keyword
Base Model
Fine-Tuned
importance (중요도)
63.3%
82.8%
department (전달부서)
26.7%
81.0%
complaint_type (민원유형)
63.3%
83.0%
emotion (감정상태)
73.3%
87.1%
All model sizes comparison (Fine-Tuned):
Model
Importance
Department
Complaint Type
Emotion
Average
Qwen2.5-0.5B
69.1%
73.7%
77.9%
84.4%
76.3%
Qwen2.5-1.5B
78.4%
81.0%
82.8%
87.5%
82.4%
Qwen2.5-3B
83.4%
81.0%
84.0%
88.9%
84.3%
Qwen2.5-7B
84.6%
83.2%
83.2%
89.1%
85.0%
Summary
The 3B model was selected as the final model because it achieves an average accuracy of 84.3% — only 0.7% below the 7B model (85.0%) — while requiring significantly less compute. Among checkpoints for the 3B model, checkpoint 1300 was selected based on its performance on department classification (the most critical keyword), with strong accompanying scores across all other keywords (82.8%, 83.0%, 87.1%).