Google Cloude Translate API 사용 방법

 

https://cloud.google.com/translate/pricing?hl=ko

    - 가격(요금)

500,000 자 : 무료

500,000~10억 자 : 백만 자당 $20

        - 참고, A4 영어는 7000자, 한글은 4200자 정도

        - 백만자는 A4지 150 장 정도


//--------------------------

< 참고 >

    - 파파고 번역

https://www.ncloud.com/product/aiService/papagoTranslation
Papago NMT API ,  20,000 원 / 1,000,000 글자

    주의! 1자만 써도 2만원(공짜는 거부)

 

    - Amazon Translation

https://aws.amazon.com/ko/translate/pricing/

        - 백만자당 $15 

        - 매월 2백만자 무료

 

 

 

//-----------------------------------------------------------------------------

//--------------------------

    - 관리(설정)

https://console.cloud.google.com/



//--------------------

< 사용방법 >

https://cloud.google.com/translate/docs/setup



* 프로젝트 선택

https://console.cloud.google.com/projectselector2/home/dashboard



* API 사용 설정

https://console.cloud.google.com/flows/enableapi?apiid=translate.googleapis.com



* 서비스 계정 키 만들기

https://console.cloud.google.com/apis/credentials/serviceaccountkey

    - 생성하면 키 파일이 다운로드 된다



    - Windows 환경변수 설정

GOOGLE_APPLICATION_CREDENTIALS = 다운받은 JSON 파일 경로




* Cloud SDK 설치

https://cloud.google.com/sdk/docs

 

    - Cloud SDK 설치 프로그램 다운로드 설치

    - 인증정보 보기 명령 (웹 REST 요청시 인증 정보)

gcloud auth application-default print-access-token

        

 

//------------------

* 웹 REST 로 실행 방법

https://cloud.google.com/translate/docs/basic/quickstart

 

    - request.json  요청 내용 json

{

  "q": "The Great Pyramid of Giza (also known as the Pyramid of Khufu or the Pyramid of Cheops) is the oldest and largest of the three pyramids in the Giza pyramid complex.",

  "source": "en",

  "target": "es",

  "format": "text"

}

 

    - 요청 보내기

curl -X POST -H "Authorization: Bearer "$(gcloud auth application-default print-access-token) -H "Content-Type: application/json; charset=utf-8" -d @request.json  https://translation.googleapis.com/language/translate/v2




//----------------------------------------------------

* 네이버 파파고 API 사용법

https://developers.naver.com/docs/papago/

 

developers.naver.com/docs/papago/papago-nmt-overview.md

 한 번에 번역할 수 있는 분량은 최대 5,000자이며, 하루 번역 처리 한도는 10,000자입니다.

 

    - API 등록

https://developers.naver.com/apps/#/list



    - 웹 REST 로 실행(API 요청)

curl "https://openapi.naver.com/v1/papago/n2mt" \

-H "Content-Type: application/x-www-form-urlencoded; charset=UTF-8" \

-H "X-Naver-Client-Id: API아이디" \

-H "X-Naver-Client-Secret: API키" \

-d "source=ko&target=en&text=만나서 반갑습니다." -v




//-----------------------------------------

< 번역 결과 비교 >

 

    - 영어 원문

Mark Twain once said that if the first thing you do each morning is to eat a live frog, you can go through the day with the satisfaction of knowing that that is probably the worst thing that is going to happen to you all day long. 

Your “frog” is your biggest, most important task. 

It is also the one task that can have the greatest positive impact on your life and results at the moment.

If you have many important tasks before you, start with the biggest, hardest, and most important task first. 

Discipline yourself to begin immediately and then persist until the task is complete before you go on to something else.

 

    - 구글

'Mark Twain은 매일 아침 가장 먼저하는 일이 살아있는 개구리를 먹는 것이라면, 그것이 아마도 하루 종일 일어날 최악의 일이라는 것을 알고 만족하면서 하루를 보낼 수 있다고 말했습니다. 

당신의 "개구리"는 당신의 가장 크고 중요한 임무입니다. 

그것은 또한 현재 당신의 삶과 결과에 가장 큰 긍정적 인 영향을 미칠 수있는 하나의 작업입니다. 

이전에 중요한 작업이 많으면 가장 크고 어렵고 가장 중요한 작업부터 시작하십시오. 

즉시 시작하도록 자신을 훈련 한 다음 다른 일을하기 전에 작업이 완료 될 때까지 지속하십시오.'



    - 파파고

마크 트웨인은 만약 여러분이 매일 아침 가장 먼저 하는 일이 살아있는 개구리를 먹는 것이라면, 여러분은 그것이 아마도 하루 종일 여러분에게 일어날 최악의 일이라는 것을 아는 만족감을 가지고 하루를 보낼 수 있다고 말한 적이 있다. 

너의 "개구리"는 너의 가장 크고 가장 중요한 임무야. 

그것은 또한 현재 당신의 삶과 결과에 가장 큰 긍정적인 영향을 미칠 수 있는 하나의 과제다. 

앞에 중요한 일이 많으면 가장 크고, 가장 어렵고, 가장 중요한 일부터 시작하라. 

즉시 시작하도록 스스로를 단련하고 다른 일을 계속하기 전에 일이 완료될 때까지 계속하라.


   - 아마존(AWS)

마크 트웨인 (Mark Twain) 은 매일 아침 가장 먼저하는 일이 살아있는 개구리를 먹는 것이라면 하루 종일 일어날 최악의 일이라는 것을 알고 만족스럽게 하루를 보낼 수 있다고 말했습니다. 
“개구리”는 가장 크고 중요한 임무입니다. 
또한 현재 삶과 결과에 가장 긍정적 인 영향을 미칠 수있는 하나의 과제입니다. 
중요한 작업이 많으면 가장 크고, 가장 힘들고, 가장 중요한 작업부터 먼저 시작하십시오. 
즉시 시작한 다음 다른 작업을 진행하기 전에 작업이 완료 될 때까지 계속하도록 훈련하십시오.

 

반응형
Posted by codens