11Feature:
22 CogStack ModelServe APIs
33
4+ @status
45 Scenario Outline : Get general information about server healthiness, readiness and the running model
56 Given CMS app is up and running
67 When I send a GET request to <endpoint>
@@ -12,92 +13,103 @@ Feature:
1213 | /readyz | medcat_umls | 200 |
1314 | /info | "model_type ":"medcat_umls " | 200 |
1415
16+ @ner
1517 Scenario : Extract entities from free texts
1618 Given CMS app is up and running
1719 When I send a POST request with the following content
1820 | endpoint | data | content_type |
1921 | /process | Spinal stenosis | text /plain |
2022 Then the response should contain annotations
2123
24+ @ner
2225 Scenario : Extract entities from JSON Lines
2326 Given CMS app is up and running
2427 When I send a POST request with the following jsonlines content
2528 | endpoint | data | content_type |
2629 | /process_jsonl | {"name ": "doc1 ", "text ": "Spinal stenosis "}\n {"name ": "doc2 ", "text ": "Spinal stenosis "} | application /x -ndjson |
2730 Then the response should contain json lines
2831
29- @skip
32+ @ner
3033 Scenario : Extract entities from bulk texts
3134 Given CMS app is up and running
3235 When I send a POST request with the following content
33- | endpoint | data | content_type |
34- | /process_bulk | ["Spinal stenosis ", "Spinal stenosis "] | application /json |
36+ | endpoint | data | content_type |
37+ | /process_bulk | ["Spinal stenosis ", "Intracerebral hemorrhage ", " Cerebellum "] | application /json |
3538 Then the response should contain bulk annotations
3639
37- @skip
40+ @ner
3841 Scenario : Extract entities from a file with bulk texts
3942 Given CMS app is up and running
4043 When I send a POST request with the following content where data as a file
41- | endpoint | data | content_type |
42- | /process_bulk_file | ["Spinal stenosis ", "Spinal stenosis "] | multipart /form -data |
44+ | endpoint | data | content_type |
45+ | /process_bulk_file | ["Spinal stenosis ", "Intracerebral hemorrhage ", " Cerebellum "] | multipart /form -data |
4346 Then the response should contain bulk annotations
4447
48+ @redaction
4549 Scenario : Extract and redact entities from free texts
4650 Given CMS app is up and running
4751 When I send a POST request with the following content
4852 | endpoint | data | content_type |
4953 | /redact | Spinal stenosis | text /plain |
5054 Then the response should contain text [spinal stenosis]
5155
56+ @redaction
5257 Scenario : Extract and redact entities from free texts with a mask
5358 Given CMS app is up and running
5459 When I send a POST request with the following content
5560 | endpoint | data | content_type |
5661 | /redact ?mask =*** | Spinal stenosis | text /plain |
5762 Then the response should contain text ***
5863
64+ @redaction
5965 Scenario : Extract and redact entities from free texts with a hash
6066 Given CMS app is up and running
6167 When I send a POST request with the following content
6268 | endpoint | data | content_type |
6369 | /redact ?mask =any &hash =true | Spinal stenosis | text /plain |
6470 Then the response should contain text 4c86af83314100034ad83fae3227e595fc54cb864c69ea912cd5290b8d0f41a4
6571
72+ @redaction
6673 Scenario : Warn when no entities are detected for redaction
6774 Given CMS app is up and running
6875 When I send a POST request with the following content
6976 | endpoint | data | content_type |
7077 | /redact ?warn_on_no_redaction =true | abcdefgh | text /plain |
7178 Then the response should contain text warning: no entities were detected for redaction.
7279
80+ @redaction
7381 Scenario : Extract and redact entities if not filtered out
7482 Given CMS app is up and running
7583 When I send a POST request with the following content
7684 | endpoint | data | content_type |
7785 | /redact ?concepts_to_keep =C0037944 | Spinal stenosis | text /plain |
7886 Then the response should contain text spinal stenosis
7987
88+ @redaction
8089 Scenario : Extract and redact entities with encryption
8190 Given CMS app is up and running
8291 When I send a POST request with the following content
8392 | endpoint | data | content_type |
8493 | /redact_with_encryption | {"text ": "Spinal stenosis ", "public_key_pem ": "-----BEGIN PUBLIC KEY -----\nMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEA3ITkTP8Tm /5FygcwY2EQ7LgVsuCF0OH7psUqvlXnOPNCfX86CobHBiSFjG9o5ZeajPtTXaf1thUodgpJZVZSqpVTXwGKo8r0COMO87IcwYigkZZgG /WmZgoZART +AA0 +JvjFGxflJAxSv7puGlf82E +u5Wz2psLBSDO5qrnmaDZTvPh5eX84cocahVVI7X09 /kI +sZiKauM69yoy1bdx16YIIeNm0M9qqS3tTrjouQiJfZ8jUKSZ44Na /81LMVw5O46 +5GvwD +OsR43kQ0TexMwgtHxQQsiXLWHCDNy2ZzkzukDYRwA3V2lwVjtQN0WjxHg24BTBDBM +v7iQ7cbweQIDAQAB \n -----END PUBLIC KEY -----"} | application /json |
8594 Then the response should contain encrypted labels
8695
96+ @preview
8797 Scenario : Extract and preview entities
8898 Given CMS app is up and running
8999 When I send a POST request with the following content
90100 | endpoint | data | content_type |
91101 | /preview | Spinal stenosis | text /plain |
92102 Then the response should contain a preview page
93103
104+ @preview
94105 Scenario : Preview trainer export
95106 Given CMS app is up and running
96107 When I send a POST request with the following trainer export
97108 | endpoint | file_name | content_type |
98109 | /preview_trainer_export ?project_id =14 &document_id =3204 | trainer_export .json | multipart /form -data |
99110 Then the response should contain a preview page
100111
112+ @train
101113 Scenario : Train supervised
102114 Given CMS app is up and running
103115 When I send a POST request with the following trainer export
@@ -109,6 +121,7 @@ Feature:
109121 When I send a GET request to /train_eval_metrics with that ID
110122 Then the response should contain the supervised evaluation metrics
111123
124+ @train
112125 Scenario : Train unsupervised
113126 Given CMS app is up and running
114127 When I send a POST request with the following training data
@@ -120,6 +133,7 @@ Feature:
120133 When I send a GET request to /train_eval_metrics with that ID
121134 Then the response should contain the unsupervised evaluation metrics
122135
136+ @train
123137 Scenario : Evaluate served model
124138 Given CMS app is up and running
125139 When I send a POST request with the following trainer export
@@ -128,3 +142,41 @@ Feature:
128142 Then the response should contain the evaluation ID
129143 When I send a GET request to /train_eval_info with that ID
130144 Then the response should contain the evaluation information
145+
146+ @misc
147+ Scenario : Sanity check the model with a trainer export
148+ Given CMS app is up and running
149+ When I send a POST request with the following trainer export
150+ | endpoint | file_name | content_type |
151+ | /sanity -check | trainer_export .json | multipart /form -data |
152+ Then the response should contain evaluation metrics per concept
153+
154+ @misc
155+ Scenario Outline : Calculate Inter Annotator Agreement (IAA) scores between two annotation projects
156+ Given CMS app is up and running
157+ When I send a POST request with the following trainer export
158+ | endpoint | file_name | content_type |
159+ | /iaa -scores ?annotator_a_project_id =14 &annotator_b_project_id =15 &scope =<scope > | trainer_export .json ,another_trainer_export .json | application /json |
160+ Then the response should contain IAA scores
161+
162+ Examples :
163+ | scope |
164+ | per_concept |
165+ | per_document |
166+ | per_span |
167+
168+ @misc
169+ Scenario : Concatenate multiple trainer export files into a single file
170+ Given CMS app is up and running
171+ When I send a POST request with the following trainer export
172+ | endpoint | file_name | content_type |
173+ | /concat_trainer_exports | trainer_export .json ,another_trainer_export .json | multipart /form -data |
174+ Then the response should contain a concatenated trainer export
175+
176+ @misc
177+ Scenario : Get annotation stats of trainer export files
178+ Given CMS app is up and running
179+ When I send a POST request with the following trainer export
180+ | endpoint | file_name | content_type |
181+ | /annotation -stats | trainer_export .json ,another_trainer_export .json | multipart /form -data |
182+ Then the response should contain annotation stats
0 commit comments