Views
No views yet

JEJUMA-002는 현재 방언과 표준어간 변경, 방언 탐지 등의 역할을 수행할 수 있습니다.JEJUMA-002를 모델을 훈련하기 위해 약 500만개의 지역방언-서울말 페어 데이터를 수집하고, 그 중 지역방언 잘 들어난 데이터를 평균 15만개씩 총 75만개 선별하였습니다.| 입력 문장 | 자이 폴에 독솔 막 난 거 보난 언 생이우다 |
|---|---|
| 정답 | 재 팔에 닭살이 막 난 거 보니, 추운 모양이다. |
| Upstage Solar 출력 | 그 바위에 뱀이 나타나는 걸 보니까 정말 놀랐다. |
| Naver HCX 출력 | 재의 풀에 독초가 마구 난 것을 보니 어린 소나무입니다. |
| GPT-4o 출력 | 저기 바위에 독사가 막 나타난 걸 보니까 정말 놀랐다. |
| JEJUMA-001 출력 | 재 팔에 닭살이 막 난 거 보니, 추운 모양이다. |
| 입력 문장 | 귤나무에 그냥 가서 너네 아버지좀 찾아와라. |
|---|---|
| 데이터셋 | 미깡낭 경 가심 너네 아방 좀 데령 |
| Upstage Solar 출력 | 귤 나무에 가서 네 아버지를 좀 찾아와. |
| Naver HCX 출력 | 귤낭에 강 느네 아방 좀 데령오라. |
| GPT-4o 출력 | 귤나무에 걍 가서 햄신 아방 좀 찾아와라. |
| JEJUMA-001 출력 | 미깡낭 경 가심 너네 아방 좀 촞아오라. |
dialect_to_standard, standard_to_dialect, detect_dialect, detect_dialect_and_convert 중 하나를 사용할 수 있습니다.dialect_to_standard: 방언을 표준어로 변경standard_to_dialect: 표준어를 방언으로 변경detect_dialect: 방언 종류 감지detect_dialect_and_convert: 자동으로 방언종류를 감지하여 표준어로 변경1import transformers
2import torch
3
4model_id = "JEJUMA/JEJUMA-002"
5
6pipeline = transformers.pipeline(
7 "text-generation",
8 model=model_id,
9 model_kwargs={"torch_dtype": torch.bfloat16},
10 device_map="auto",
11)
12
13terminators = [
14 pipeline.tokenizer.eos_token_id,
15 pipeline.tokenizer.convert_tokens_to_ids("<|eot_id|>")
16]
17
18class DialectPromptTemplate:
19 @staticmethod
20 def dialect_to_standard(text, region):
21 return [{"role":"user", "content":f"Convert the following sentence or word which is {region}'s dialect to standard Korean: " + text},]
22
23 @staticmethod
24 def standard_to_dialect(text, region):
25 return [{"role":"user", "content":f"Convert the following sentence or word which is standard Korean to {region}'s dialect: " + text},]
26
27 @staticmethod
28 def detect_dialect(text):
29 return [{"role":"user", "content":"Detect the following sentence or word is standard, jeju, chungcheong, gangwon, gyeongsang, or jeonla's dialect: " + text},]
30
31 @staticmethod
32 def detect_dialect_and_convert(text):
33 return [{"role":"user", "content":"Detect the following sentence or word is which dialect and convert the following sentence or word to standard Korean:" + text},]
34
35
36outputs = pipeline(
37 DialectPromptTemplate.dialect_to_standard("자이 폴에 독솔 막 난 거 보난 언 생이우다", "jeju"),
38 max_new_tokens=512,
39 eos_token_id=terminators,
40 do_sample=True,
41 temperature=0.1,
42 top_p=0.9,
43)
44
45print(outputs[0]["generated_text"][-1])