Spaces:
Sleeping
Sleeping
openapi: 3.0.0 | |
info: | |
title: Medical Entity Extraction API | |
description: This API allows users to extract medically relevant entities from PDF documents using a pre-trained NER model. | |
version: "1.0.0" | |
servers: | |
- url: 'http://localhost:5000' | |
description: Development server | |
paths: | |
/api/v1/extract: | |
post: | |
summary: Extract medical entities from a PDF document. | |
requestBody: | |
content: | |
multipart/form-data: | |
schema: | |
type: object | |
properties: | |
file: | |
type: string | |
format: binary | |
description: PDF file to be processed | |
required: | |
- file | |
description: PDF file to extract medical entities from. | |
responses: | |
'200': | |
description: Successfully extracted entities. | |
content: | |
application/json: | |
schema: | |
type: array | |
items: | |
$ref: '#/components/schemas/Entity' | |
'422': | |
description: Validation error, file not included or empty filename. | |
'415': | |
description: Unsupported file type. | |
'500': | |
description: Server error. | |
components: | |
schemas: | |
Entity: | |
type: object | |
properties: | |
entity: | |
type: string | |
example: 'CCR5' | |
description: The identified medical entity. | |
context: | |
type: string | |
example: '... uses on the relief of symptoms rather than on a biological ‘cure’. have identified rare mutations in CCR5 that confer resilience against ...' | |
description: Context where the entity was found, including text surrounding the entity for clarity. | |
start: | |
type: integer | |
format: int32 | |
example: 25 | |
description: The start position of the entity in the context with respect to the original text. | |
end: | |
type: integer | |
format: int32 | |
example: 34 | |
description: The end position of the entity in the context with respect to the original text. | |