STT 부가 기능
STT API 호출 시, transcribe_options 인자에 json 형태의 부가 기능을 입력하여 사용할 수 있습니다.
API 호출 방법은 API 호출 페이지를 참고해주세요.
한글 토큰 억제 기능 (suppress_korean)
Theta One STT는 기본적으로 한국어와 영어가 혼용된 코드 스위칭 형태의 예측을 수행합니다.
(예시: I love 김밥.)
그러나, 한국어 단어도 한글이 아닌 영어로 표기되기를 원하실 경우, suppression_korean 옵션을 true로 설정해주세요.
- cURL
- Python
curl -X 'POST' \
'https://stt.thetaone-ai.com/transcribe' \
-H 'accept: application/json' \
-H 'x-api-key: YOUR_API_KEY' \
-H 'Content-Type: multipart/form-data' \
-F 'file=@audio.wav;type=audio/wav' \
-F 'transcribe_options={"suppress_korean": true}'
import requests
import json
url = "https://stt.thetaone-ai.com/transcribe"
headers = {
"x-api-key": "YOUR_API_KEY"
}
with open("audio.wav", "rb") as audio_file:
files = {"file": ("audio.wav", audio_file, "audio/wav")}
data = {"transcribe_options": json.dumps({"suppress_korean": True})}
response = requests.post(url, headers=headers, files=files, data=data)
result = response.json()
print(f"Transcription: {result['text']}")
모든 예측 결과가 영어로 표기되게 됩니다.
(예시: I love Gimbap.)