Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/wamuir/golang-tf-api
https://github.com/wamuir/golang-tf-api
Last synced: 18 days ago
JSON representation
- Host: GitHub
- URL: https://github.com/wamuir/golang-tf-api
- Owner: wamuir
- License: other
- Created: 2020-08-09T15:11:31.000Z (over 4 years ago)
- Default Branch: master
- Last Pushed: 2020-12-24T15:14:21.000Z (about 4 years ago)
- Last Synced: 2024-10-30T08:20:01.406Z (2 months ago)
- Language: Python
- Size: 42 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE.md
Awesome Lists containing this project
README
# golang-tf-api
## About
API for a character-level convolutional neural network, using a model
exported from tensorflow. The API binds to port 5000 by default, and
inferences can be obtained by posting to `/predict`, optionally with
a limit on the number of predicted classes to be returned, such as
`/predict?page[limit]=10`.## application/json
```sh
curl -XPOST -d '{"input":"portal gun"}' -i http://localhost:5000/predict
```This returns product service codes and probability estimates, such as:
```json
{
"classes":[
{"id":"string","pr":"float32"},
{"id":"string","pr":"float32"},
{"id":"string","pr":"float32"}
],
"meta":{
"gini-impurity":"float32",
"relative-entropy":"float32",
"shannon-entropy":"float32"
}
}
```With classes in the relevant classlist identified by `id` and sorted in
descending order by corresponding probability (`pr`).## application/vnd.api+json
The API will negotiate content for [JSON API](https://jsonapi.org).
```sh
curl -X POST -H 'Accept: application/vnd.api+json' \
-H 'Content-Type: application/vnd.api+json' \
-d '{"data":{"type": "descriptions", "attributes":{"raw": "portal gun"}}}' \
-i 'http://localhost:5000/predict'
```