🌐 Cross-Origin Resource Sharing (CORS: *)
Tích Hợp Chấm Điểm AI Vào Mọi Website & App
Dễ dàng kết nối với website học tiếng Anh của bạn (React, Vue, Next.js, WordPress, LMS) hoặc ứng dụng di động (Flutter, React Native, iOS, Android).
1
Hỗ trợ File / Blob / Base64
Nhận âm thanh từ ghi âm trình duyệt (MediaRecorder), file tải lên hoặc chuỗi Base64 tiện lợi.
2
Chuẩn Quốc Tế IELTS & CEFR
Tự động trả về IELTS Band (5.0 - 9.0), CEFR Level (A1 - C2), nhận diện trọng âm từ và điểm từng âm vị IPA.
3
Tốc Độ Xử Lý Siêu Tốc
Thuật toán Goodness of Pronunciation (GOP) xử lý trực tiếp qua mạng nơ-ron với độ trễ dưới 0.8 giây.
⚡ Danh Sách API Endpoints
POST
/api/v1/assess
Multipart Form-Data (Gửi file âm thanh)
Tham số yêu cầu (Body Form-Data):
-
audio_fileFile âm thanh nhị phân (WAV, MP3, WEBM, M4A, OGG). -
textVăn bản tiếng Anh cần chấm điểm (ví dụ: "Hello world").
JavaScript (Fetch with Blob)
const formData = new FormData();
formData.append('audio_file', audioBlob, 'record.webm');
formData.append('text', 'Hello, how are you?');
const response = await fetch('http://localhost:8000/api/v1/assess', {
method: 'POST',
body: formData
});
const result = await response.json();
console.log('Overall Score:', result.score);
console.log('IELTS Band:', result.ielts_cefr.ielts_band);
console.log('Phoneme Details:', result.words_detail);
POST
/api/v1/assess-base64
JSON Payload (Gửi chuỗi Base64)
Tham số yêu cầu (JSON Body):
-
audio_base64Chuỗi âm thanh Base64 (hoặc data URIdata:audio/webm;base64,...). -
textCâu tiếng Anh mục tiêu.
Python (Requests)
import requests, base64
with open('user_voice.wav', 'rb') as f:
b64_audio = base64.b64encode(f.read()).decode('utf-8')
payload = {
"audio_base64": b64_audio,
"text": "The computer is very important",
"audio_format": "wav"
}
res = requests.post("http://localhost:8000/api/v1/assess-base64", json=payload)
data = res.json()
print("Score:", data["score"])
print("CEFR:", data["ielts_cefr"]["cefr_level"])
POST
/api/v1/assess-url
JSON Payload (Chấm điểm từ link âm thanh)
cURL Command
curl -X POST "http://localhost:8000/api/v1/assess-url" \
-H "Content-Type: application/json" \
-d '{
"audio_url": "https://example.com/audio/sample_recording.mp3",
"text": "She sells seashells by the seashore."
}'
Cấu Trúc Dữ Liệu Phản Hồi (Standard JSON Response):
{
"success": true,
"processing_time_ms": 540.2,
"score": 88.5,
"accuracy": 89.2,
"fluency": 81.0,
"completeness": 100.0,
"prosody_score": 93.4,
"transcribe": "HELLO HOW ARE YOU",
"feedback": "🎉 Phát âm xuất sắc! Bạn kiểm soát rất tốt ngữ điệu và các âm vị.",
"ielts_cefr": {
"ielts_band": "7.5 - 8.0",
"cefr_level": "C1",
"level_title": "C1 Advanced (Cao cấp / Thành thạo)",
"summary": "Phát âm rất rõ ràng, kiểm soát tốt hầu hết các âm vị và trọng âm."
},
"words_detail": [
{
"word": "Hello",
"score": 88.0,
"status": "correct",
"phonemes": [
{ "phoneme": "h", "score": 88.0, "status": "good", "tip": "..." },
{ "phoneme": "ə", "score": 88.0, "status": "good", "tip": "..." },
{ "phoneme": "l", "score": 88.0, "status": "good", "tip": "..." },
{ "phoneme": "oʊ", "score": 88.0, "status": "good", "tip": "..." }
],
"stress": {
"has_stress": true,
"syllable_display": "ˈHEL-lo",
"stress_pattern": "● ○",
"stress_status": "correct"
}
}
],
"actionable_tips": []
}