Created
June 6, 2017 19:19
-
-
Save halfak/10183548a4d754935481b9bddf9544e8 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"$schema": "http://json-schema.org/draft-04/schema#", | |
"description": "Score precache response format for ORES (v3)", | |
"type": "object", | |
"properties": { | |
"warnings": { | |
"description": "A list of warnings raised while generating a response", | |
"items": { | |
"$ref": "#/definitions/ErrorWarningDocument" | |
}, | |
"type": "array" | |
}, | |
"error": { | |
"$ref": "#/definitions/ErrorWarningDocument" | |
} | |
}, | |
"additionalProperties": { | |
"$ref": "#/definitions/ContextDocument" | |
}, | |
"definitions": { | |
"ContextDocument": { | |
"description": "A mapping of scores and model information", | |
"type": "object", | |
"properties": { | |
"scores": { | |
"description": "The scores generated.", | |
"type": "object", | |
"additionalProperties": { | |
"$ref": "#/definitions/RevisionScoresDocument" | |
} | |
}, | |
"models": { | |
"description": "The models with information requested.", | |
"type": "object", | |
"additionalProperties": { | |
"$ref": "#/definitions/ModelInfoDocument" | |
} | |
} | |
} | |
}, | |
"ErrorWarningDocument": { | |
"description": "A warning or error message.", | |
"type": "object", | |
"properties": { | |
"type": { | |
"description": "A short string identifying the error", | |
"type": "string" | |
}, | |
"message": { | |
"description": "A human-readable explanation of what went wrong", | |
"type": "string" | |
} | |
} | |
}, | |
"ModelInfoDocument": { | |
"description": "Information about the model", | |
"type": "object", | |
"properties": { | |
"version": { | |
"description": "A semantic version string", | |
"type": "string" | |
}, | |
"trained": { | |
"description": "The datetime at which the model was trained (in seconds since Jan. 1st 1970)", | |
"type": "number" | |
}, | |
"params": { | |
"description": "A list of parameters used when constructing the model", | |
"additionalProperties": true, | |
"type": "object" | |
}, | |
"type": { | |
"description": "The type of model used to score", | |
"type": "string" | |
}, | |
"test_stats": { | |
"description": "A list of test statistics used on the model.", | |
"additionalProperties": true, | |
"type": "object" | |
} | |
} | |
}, | |
"RevisionScoresDocument": { | |
"type": "object", | |
"description": "A collection of scores for a single revision (or an error)", | |
"additionalProperties": { | |
"$ref": "#/definitions/ModelScoreDocument" | |
} | |
}, | |
"ModelScoreDocument": { | |
"type": "object", | |
"properties": { | |
"features": { | |
"description": "A mapping of feature names to the values generated in scoring", | |
"additionalProperties": { | |
"type": [ | |
"number", | |
"boolean", | |
"array" | |
] | |
}, | |
"type": "object" | |
}, | |
"score": { | |
"description": "The generated score", | |
"additionalProperties": { | |
"type": [ | |
"number", | |
"string", | |
"boolean", | |
"array", | |
"object" | |
] | |
}, | |
"type": "object" | |
}, | |
"error": { | |
"description": "The an error generated while trying to generate a score", | |
"type": "object", | |
"$ref": "#/definitions/ErrorWarningDocument" | |
} | |
} | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Validates against https://ores.wikimedia.org/v3/scores/enwiki/2
And https://ores.wikimedia.org/v3/scores/enwiki/781154471