Skip to content
Snippets Groups Projects
Commit f2b88b5b authored by Erwan Rouchet's avatar Erwan Rouchet Committed by Bastien Abadie
Browse files

Update schema for ML classes

parent bf45321c
No related branches found
No related tags found
No related merge requests found
Pipeline #28196 passed
...@@ -229,12 +229,12 @@ paths: ...@@ -229,12 +229,12 @@ paths:
classifications: classifications:
items: items:
properties: properties:
class_name:
type: string
confidence: confidence:
type: number type: number
ml_class:
type: string
required: required:
- ml_class - class_name
- confidence - confidence
type: array type: array
classifier: classifier:
...@@ -255,12 +255,12 @@ paths: ...@@ -255,12 +255,12 @@ paths:
classifications: classifications:
items: items:
properties: properties:
class_name:
type: string
confidence: confidence:
type: number type: number
ml_class:
type: string
required: required:
- ml_class - class_name
- confidence - confidence
type: array type: array
classifier: classifier:
...@@ -275,6 +275,8 @@ paths: ...@@ -275,6 +275,8 @@ paths:
- ml - ml
/api/v1/classifications/: /api/v1/classifications/:
post: post:
description: Manually add a class on a page, as a human, not as a machine learning
tool.
operationId: CreateClassification operationId: CreateClassification
parameters: [] parameters: []
requestBody: requestBody:
...@@ -303,8 +305,11 @@ paths: ...@@ -303,8 +305,11 @@ paths:
required: required:
- page - page
- ml_class - ml_class
tags:
- ml
/api/v1/classifications/{id}/reject/: /api/v1/classifications/{id}/reject/:
put: put:
description: Reject an existing classification.
operationId: RejectClassification operationId: RejectClassification
parameters: parameters:
- description: '' - description: ''
...@@ -317,52 +322,7 @@ paths: ...@@ -317,52 +322,7 @@ paths:
content: content:
application/json: application/json:
schema: schema:
properties: properties: {}
confidence:
nullable: true
type: number
id:
type: string
ml_class:
properties:
id:
type: string
name:
type: string
required:
- name
type: object
source:
properties:
id:
type: string
internal:
type: boolean
revision:
type: string
slug:
type: string
type:
enum:
- classifier
- recognizer
- ner
- dla
required:
- type
- slug
- revision
- internal
type: object
state:
enum:
- pending
- validated
- rejected
required:
- source
- ml_class
- state
x-name: body x-name: body
responses: responses:
'200': '200':
...@@ -415,8 +375,11 @@ paths: ...@@ -415,8 +375,11 @@ paths:
- source - source
- ml_class - ml_class
- state - state
tags:
- ml
/api/v1/classifications/{id}/validate/: /api/v1/classifications/{id}/validate/:
put: put:
description: Validate an existing classification.
operationId: ValidateClassification operationId: ValidateClassification
parameters: parameters:
- description: '' - description: ''
...@@ -429,52 +392,7 @@ paths: ...@@ -429,52 +392,7 @@ paths:
content: content:
application/json: application/json:
schema: schema:
properties: properties: {}
confidence:
nullable: true
type: number
id:
type: string
ml_class:
properties:
id:
type: string
name:
type: string
required:
- name
type: object
source:
properties:
id:
type: string
internal:
type: boolean
revision:
type: string
slug:
type: string
type:
enum:
- classifier
- recognizer
- ner
- dla
required:
- type
- slug
- revision
- internal
type: object
state:
enum:
- pending
- validated
- rejected
required:
- source
- ml_class
- state
x-name: body x-name: body
responses: responses:
'200': '200':
...@@ -527,6 +445,8 @@ paths: ...@@ -527,6 +445,8 @@ paths:
- source - source
- ml_class - ml_class
- state - state
tags:
- ml
/api/v1/corpus/: /api/v1/corpus/:
get: get:
description: List corpora with their access rights description: List corpora with their access rights
...@@ -756,7 +676,8 @@ paths: ...@@ -756,7 +676,8 @@ paths:
- corpora - corpora
/api/v1/corpus/{id}/classes/: /api/v1/corpus/{id}/classes/:
get: get:
operationId: ListCorpusMLClass description: List all available classes in a corpus
operationId: ListCorpusMLClasses
parameters: parameters:
- description: '' - description: ''
in: path in: path
...@@ -776,6 +697,8 @@ paths: ...@@ -776,6 +697,8 @@ paths:
type: string type: string
required: required:
- name - name
tags:
- ml
/api/v1/corpus/{id}/pages/: /api/v1/corpus/{id}/pages/:
get: get:
description: List all pages in all volumes of a corpus description: List all pages in all volumes of a corpus
...@@ -4826,7 +4749,8 @@ paths: ...@@ -4826,7 +4749,8 @@ paths:
- iiif - iiif
/api/v1/ml-classes/: /api/v1/ml-classes/:
get: get:
operationId: ListMLClass description: List available machine learning classes in all corpora.
operationId: ListMLClasses
parameters: parameters:
- description: A page number within the paginated result set. - description: A page number within the paginated result set.
in: query in: query
...@@ -4852,6 +4776,8 @@ paths: ...@@ -4852,6 +4776,8 @@ paths:
type: string type: string
required: required:
- name - name
tags:
- ml
/api/v1/oauth/credentials/: /api/v1/oauth/credentials/:
get: get:
description: List all OAuth credentials for the authenticated user description: List all OAuth credentials for the authenticated user
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment