EduTech & AI 인공지능 & IT관련 소식

google 번역 api 사용하기 본문

카테고리 없음

google 번역 api 사용하기

Edu&Tech 2018. 4. 9. 13:00




Cloud Translation API는 최첨단 기술인 신경망 기계 번역을 이용하여 임의 문자열을 지원되는 언어로 번역할 수 있는 간단한 프로그래매틱 인터페이스를 제공합니다. Translation API는 응답성이 높으므로 출발어의 원본 텍스트를 도착어(예: 프랑스어에서 영어)로 빠르고 동적으로 번역하기 위해 웹사이트와 애플리케이션을 Translation API와 통합할 수 있습니다. 출발어를 알지 못하는 경우를 대비하여 언어 감지 기능도 제공됩니다. 여기에 사용되는 획기적인 기계 번역 기술은 지속적인 업데이트를 거치므로 번역의 질이 계속 향상되고 새로운 언어와 언어 조합이 추가됩니다.


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


엔드 포인트에 curl요청할 때 사용하십시오 https://translation.googleapis.com/language/translate/v2.

이 curl명령에는 번역 할 텍스트 ( q), 번역 할 언어 ( source) 및 번역 할 언어 로 JSON이 포함됩니다 target.

소스 및 타겟 언어는 iso-639-1 코드를 사용하여 식별됩니다 원본 언어는 영어 (en)이고 대상 언어는 스페인어 (es)입니다. 쿼리의 형식은 일반 텍스트의 "텍스트"로 표시됩니다.



curl -s -X POST -H "Content-Type: application/json" \
   
-H "Authorization: Bearer "$(gcloud auth print-access-token) \
   
--data "{
  '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'
}"
"https://translation.googleapis.com/language/translate/v2"
 

You should see a response similar to the following:

{ "data": { "translations": [ { "translatedText": "La Gran Pirámide de Giza (también conocida como la Pirámide de Khufu o la Pirámide de Keops) es la más antigua y más grande de las tres pirámides en el complejo de la pirámide de Giza." } ] } }


Comments