File size: 1,322 Bytes
eb2e1fc
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
---

title: Emoji Predictor API
emoji: πŸ˜„
colorFrom: blue
colorTo: purple
sdk: docker
pinned: false
license: mit
---


# 🎯 Emoji Predictor API

Predict the appropriate emoji for any English sentence using LSTM deep learning model.

## πŸš€ API Endpoints

### Health Check
```

GET /

GET /health

```

### Predict Single Text
```

POST /predict

Content-Type: application/json



{

    "text": "I love you"

}

```

**Response:**
```json

{

    "text": "I love you",

    "emoji": "❀️",

    "emoji_meaning": "love",

    "confidence": 0.95,

    "all_predictions": {

        "❀️": {"probability": 0.95, "meaning": "love"},

        "⚾": {"probability": 0.01, "meaning": "sports"},

        "πŸ˜„": {"probability": 0.02, "meaning": "happy"},

        "😞": {"probability": 0.01, "meaning": "sad"},

        "🍴": {"probability": 0.01, "meaning": "food"}

    }

}

```

### Predict Batch
```

POST /predict/batch

Content-Type: application/json



["I love you", "I am hungry", "Let's play baseball"]

```

## πŸ“Š Supported Emojis

| Emoji | Meaning |
|-------|---------|
| ❀️ | Love |
| ⚾ | Sports |
| πŸ˜„ | Happy |
| 😞 | Sad |
| 🍴 | Food |

## πŸ”§ Technology Stack

- FastAPI
- TensorFlow/Keras
- LSTM Neural Network
- GloVe Word Embeddings