File size: 991 Bytes
2a56b48
 
 
 
 
 
 
 
 
 
2fbba2c
 
 
98b1f2a
2fbba2c
98b1f2a
2fbba2c
 
 
 
 
 
 
 
 
814693e
 
 
 
 
 
2fbba2c
 
 
 
 
 
 
 
 
 
 
 
 
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
---
title: UWS API
emoji: 🏆
colorFrom: red
colorTo: red
sdk: docker
pinned: false
---

Check out the configuration reference at https://huggingface.co/docs/hub/spaces-config-reference

## API

The Docker build downloads the official fastText Uyghur Common Crawl binary model, extracts it to `/app/models/cc.ug.300.bin`, and loads it once when the FastAPI app starts.

Model source: https://fasttext.cc/docs/en/crawl-vectors

### Query request

```bash
curl --get "https://<your-space>.hf.space/similarity" \
  --data-urlencode "word1=سىزغۇچ" \
  --data-urlencode "word2=نان"
```

```bash
curl --get "https://piyazon-uws-api.hf.space/similarity" \
  --data-urlencode "word1=سىزغۇچ" \
  --data-urlencode "word2=نان"
```

### JSON request

```bash
curl -X POST "https://<your-space>.hf.space/similarity" \
  -H "Content-Type: application/json" \
  -d '{"word1":"سىزغۇچ","word2":"نان"}'
```

Both endpoints return a JSON number, for example:

```json
42.123456
```