Views
No views yet

JEJUMA-001은 현재 방언과 표준어간 변경, 방언 탐지 등의 역할을 수행할 수 있습니다.JEJUMA-001을 모델을 훈련하기 위해 약 105만개의 제주방언-서울말 페어 데이터를 수집하고, 그 중 제주어가 잘 들어난 데이터 17만개를 선별하였습니다.| 입력 문장 | 자이 폴에 독솔 막 난 거 보난 언 생이우다 |
|---|---|
| 정답 | 재 팔에 닭살이 막 난 거 보니, 추운 모양이다. |
| 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-001"
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 JejuPromptTemplate:
19 @staticmethod
20 def dialect_to_standard(text):
21 return [{"role":"user", "content":"Convert the following sentence or word which is Jeju island dialect to standard Korean: " + text},]
22
23 @staticmethod
24 def standard_to_dialect(text):
25 return [{"role":"user", "content":"Convert the following sentence or word which is standard Korean to Jeju island dialect: " + text},]
26
27 @staticmethod
28 def detect_dialect(text):
29 return [{"role":"user", "content":"Detect the following sentence or word is Jeju island dialect or standard Korean: " + text},]
30
31 @staticmethod
32 def detect_dialect_and_convert(text):
33 return [{"role":"user", "content":"Detect the following sentence or word is Jeju island dialect or standard Korean and convert the following sentence or word to Jeju island dialect or standard Korean: " + text},]
34
35
36outputs = pipeline(
37 JejuPromptTemplate.standard_to_dialect("자이 폴에 독솔 막 난 거 보난 언 생이우다"),
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])