Spaces:
Sleeping
Sleeping
File size: 1,099 Bytes
cd48533 91da5d0 032494e 91da5d0 032494e 91da5d0 032494e 91da5d0 032494e 91da5d0 032494e 91da5d0 032494e 91da5d0 cd48533 |
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 |
---
title: Tokenizer
emoji: π
colorFrom: green
colorTo: yellow
sdk: docker
pinned: false
---
# Tokenizer API
A simple API for tokenizing text using spaCy.
## Usage Examples
### Using curl
```bash
curl -X POST "https://theirstory-tokenizer.hf.space/tokenize" \
-H "Content-Type: application/json" \
-H "accept: application/json" \
-d '{"text": "Hello world"}'
```
### Using Python
```python
import requests
response = requests.post(
"https://theirstory-tokenizer.hf.space/tokenize",
json={"text": "Hello world"},
headers={"accept": "application/json"}
)
tokens = response.json()
print(tokens)
```
### Using JavaScript
```javascript
const response = await fetch('https://theirstory-tokenizer.hf.space/tokenize', {
method: 'POST',
headers: {
'Content-Type': 'application/json',
'accept': 'application/json'
},
body: JSON.stringify({
text: 'Hello world'
})
});
const tokens = await response.json();
console.log(tokens);
```
Check out the configuration reference at https://huggingface.co/docs/hub/spaces-config-reference
|