File size: 2,645 Bytes
2f6b380
 
 
 
 
 
 
 
 
22bd9e9
2f6b380
 
 
 
 
 
 
 
 
d01de5d
 
2f6b380
d01de5d
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2f6b380
d01de5d
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
fa6b08f
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
---
title: Carsa AI - African Translation API
emoji: 🌍
colorFrom: blue
colorTo: green
sdk: docker
app_port: 7860
pinned: false
license: mit
short_description: African language translation API with TTS/STT
tags:
  - translation
  - speech-recognition  
  - text-to-speech
  - african-languages
  - fastapi
  - whisper
---

# 🌍 Carsa AI - African Language Translation API

[![Hugging Face Spaces](https://img.shields.io/badge/%F0%9F%A4%97%20Hugging%20Face-Spaces-blue)](https://huggingface.co/spaces/CarsaAI/carsa_api)
[![FastAPI](https://img.shields.io/badge/FastAPI-009485?style=flat&logo=fastapi&logoColor=white)](https://fastapi.tiangolo.com)
[![Python](https://img.shields.io/badge/Python-3.11-blue)](https://python.org)

A comprehensive AI-powered API for African language translation, speech-to-text, and text-to-speech capabilities.

## 🎯 Features

- **πŸ”„ Translation**: English ↔ 4 African languages (Twi, Ga, Ewe, Hausa)
- **🎀 Speech-to-Text**: Advanced ASR using Whisper
- **πŸ”Š Text-to-Speech**: High-quality voice synthesis with 109+ voices
- **⚑ Fast API**: Optimized for mobile applications
- **🌍 Global Access**: Hosted on Hugging Face Spaces

## πŸ“± Supported Languages

| Language | Code | Region |
|----------|------|--------|
| Twi | `twi` | Ghana |
| Ga | `ga` | Ghana |
| Ewe | `ewe` | Ghana/Togo |
| Hausa | `hausa` | Nigeria/Niger |

## πŸš€ API Endpoints

### Translation
```http
POST /translate
Content-Type: application/json

{
  "text": "Hello, how are you?",
  "target_lang": "twi"
}
```

### Speech-to-Text
```http
POST /speech-to-text
Content-Type: multipart/form-data

audio_file: [WAV file]
```

### Text-to-Speech
```http
POST /text-to-speech
Content-Type: application/json

{
  "text": "Hello world"
}
```

## πŸ₯ Health Check
```http
GET /health
```

## πŸ“– Interactive Documentation

Visit `/docs` for complete interactive API documentation.

## πŸ› οΈ Technology Stack

- **FastAPI**: Modern Python web framework
- **Transformers**: Hugging Face model library
- **Whisper**: OpenAI speech recognition
- **Coqui TTS**: Text-to-speech synthesis
- **PyTorch**: Deep learning framework

## πŸ“Š Performance

- **Translation**: ~200ms response time
- **Speech-to-Text**: ~2-5 seconds processing
- **Text-to-Speech**: ~1-3 seconds generation
- **Uptime**: 99.9%+ on Hugging Face Spaces

## πŸ“± Mobile Integration

Perfect for Flutter, React Native, or any mobile framework. Optimized for:
- Low latency responses
- Efficient data usage
- Reliable connectivity
- Global accessibility

---

**Built with ❀️ for African language preservation and accessibility**

<!-- Trigger rebuild -->