https://github.com/shitpostingio/analysis-api
https://github.com/shitpostingio/analysis-api
Last synced: 5 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/shitpostingio/analysis-api
- Owner: shitpostingio
- Created: 2020-10-10T15:50:52.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2022-05-16T23:59:25.000Z (about 4 years ago)
- Last Synced: 2023-07-27T22:37:13.427Z (almost 3 years ago)
- Language: Go
- Size: 65.4 KB
- Stars: 0
- Watchers: 4
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Analysis API
REST-powered API for analyzing media and text.
## Endpoints
- Media analysis `/analysis/{reqType}/{type}/{id}`
- Text analysis `/analysis/{reqType}`
- Health check `/healthy`
## Request types
- Complete media analysis: `complete`
- Media fingerprinting: `fingerprinting`
- Media NSFW recognition: `nsfw`
- Gibberish text analysis: `gibberish`
## Returned data
The data returned by the server when analyzing media is in the form:
```go
type Analysis struct {
Fingerprint FingerprintResponse
NSFW NSFWResponse
FingerprintErrorString string
NSFWErrorString string
}
```
The data returned by the server when analyzing text is in the form:
```go
type GibberishResponse struct {
IsGibberish bool
}
```
## Environment options
- API bind address and port: `API_BIND_ADDRESS` (defaults to `localhost:9999`).
- Path to configuration file: `API_CFG_PATH` (defaults to `config.toml`).
## Configuration file structure
```toml
fingerprintendpoint = "http://localhost:10000/fingerprinting"
nsfwendpoint = "http://localhost:10001/nsfw"
gibberishendpoint = "http://localhost:10002/gibberish"
testing =
[database]
authsource = "authsource"
collectionname = "collectionname"
databasename = "databasename"
hosts = ["localhost:27017"]
password = "password"
replicasetname = "replicasetname"
username = "username"
[redis]
Address = "localhost:6379"
NSFWDatabase = 2
FingerprintDatabase = 1
```