Gunroar commited on
Commit
56538d0
Β·
1 Parent(s): 1b1da2e
Files changed (1) hide show
  1. README.md +10 -114
README.md CHANGED
@@ -1,114 +1,10 @@
1
- # Farmlingua Multilingual Translation API
2
-
3
- A FastAPI-based multilingual translation service supporting Igbo, Hausa, Yoruba, Swahili, and English for agricultural queries.
4
-
5
- ## Features
6
-
7
- - **Simple Language Identifier**: Specify language with `lang` parameter
8
- - **Single Endpoint**: `/ask` - Send text with language identifier
9
- - **Supported Languages**: English (en), Igbo (ig), Hausa (ha), Yoruba (yo), Swahili (sw)
10
- - **Agricultural Focus**: Specialized for farming and agricultural queries
11
- - **External Integration**: Connects to Milestone 1 Q&A service
12
-
13
- ## Quick Start
14
-
15
- ### Local Development
16
-
17
- 1. **Install Dependencies**
18
- ```bash
19
- pip install -r requirements.txt
20
- ```
21
-
22
- 2. **Run the Server**
23
- ```bash
24
- python main.py
25
- ```
26
-
27
- 3. **Test the API**
28
- ```bash
29
- python test_simple.py
30
- ```
31
-
32
- 4. **Access Documentation**
33
- - Interactive API docs: http://localhost:8000/docs
34
- - Health check: http://localhost:8000/health
35
-
36
- ### Docker Deployment
37
-
38
- 1. **Build Image**
39
- ```bash
40
- docker build -t farmlingua-api .
41
- ```
42
-
43
- 2. **Run Container**
44
- ```bash
45
- docker run -p 8000:8000 farmlingua-api
46
- ```
47
-
48
- ## API Usage
49
-
50
- ### Single Endpoint: `/ask`
51
-
52
- **POST** `/ask`
53
-
54
- **Request Body:**
55
- ```json
56
- {
57
- "text": "Kedu ka m ga-esi na-akα»₯ ọka?",
58
- "lang": "ig"
59
- }
60
- ```
61
-
62
- **Response:**
63
- ```json
64
- {
65
- "language": "Igbo",
66
- "language_code": "ig",
67
- "original_text": "Kedu ka m ga-esi na-akα»₯ ọka?",
68
- "english_translation": "How can I plant grain?",
69
- "response": "Jiri oghere mkpα»₯rα»₯ osisi ma ọ bα»₯ osisi aka..."
70
- }
71
- ```
72
-
73
- ### Supported Language Codes
74
-
75
- | Code | Language | NLLB Code |
76
- |------|----------|-----------|
77
- | `en` | English | `eng_Latn` |
78
- | `ig` | Igbo | `ibo_Latn` |
79
- | `ha` | Hausa | `hau_Latn` |
80
- | `yo` | Yoruba | `yor_Latn` |
81
- | `sw` | Swahili | `swh_Latn` |
82
-
83
- ## Project Structure
84
-
85
- ```
86
- FARMLINGUAMULTILINGUA/
87
- β”œβ”€β”€ models/
88
- β”‚ └── model.py # Hugging Face translation model
89
- β”œβ”€β”€ multilingual/
90
- β”‚ └── multi.py # FastAPI application
91
- β”œβ”€β”€ main.py # Application entry point
92
- β”œβ”€β”€ test_simple.py # Test suite
93
- β”œβ”€β”€ requirements.txt # Python dependencies
94
- β”œβ”€β”€ Dockerfile # Docker configuration
95
- β”œβ”€β”€ .gitignore # Git ignore rules
96
- └── README.md # This file
97
- ```
98
-
99
- ## Environment Variables
100
-
101
- - `HOST`: Server host (default: `0.0.0.0`)
102
- - `PORT`: Server port (default: `8000`)
103
-
104
- ## Technology Stack
105
-
106
- - **FastAPI**: Web framework
107
- - **Transformers**: Hugging Face model pipeline
108
- - **NLLB Model**: `drrobot9/nllb-ig-yo-ha-finetuned`
109
- - **Uvicorn**: ASGI server
110
- - **Docker**: Containerization
111
-
112
- ## License
113
-
114
- MIT License
 
1
+ ---
2
+ title: FARMLINGUAMULTILINGUA
3
+ emoji: 🐒
4
+ colorFrom: yellow
5
+ colorTo: pink
6
+ sdk: docker
7
+ pinned: false
8
+ ---
9
+
10
+ Check out the configuration reference at https://huggingface.co/docs/hub/spaces-config-reference