You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: inference/inference_pipeline_queue.md
+8-3Lines changed: 8 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,7 +1,9 @@
1
1
# COSMOS Inference Pipeline
2
2
3
3
## Overview
4
-
COSMOS uses an ML inference pipeline to analyze and classify website content. This pipeline processes full-text content from URLs within collections to enhance metadata with classifications such as TDAMM categories (36 types) or science divisions (5 types).
4
+
The server runs both the COSMOS curation app and an ML Inference Pipeline, which can analyze and classify website content. COSMOS is process whole collections and send the full_texts of the individual urls to the Inference Pipeline for classification. Right now it supports Division Classifications and TDAMM Classifications.
5
+
6
+
The Inference Pipeline can support multiple model versions for a single classification type. When a collection needs to be classified for certain classification and model, say "Division" and "v1", the COSMOS app will create an InferenceJob object. The InferenceJob will then create ExternalJob objects for each batch of urls in the collection. The ExternalJob objects will send the full_texts to the Inference Pipeline API, which will return a job_id. The ExternalJob will then ping the API with the job_id to get the results. Once all ExternalJobs are complete, the InferenceJob will be marked as complete.
5
7
6
8
## Infrastructure
7
9
We are running both local and prod in docker compose. On local, we are using celery and redis. On prod, we point to AWS SQS instead.
@@ -11,8 +13,8 @@ We can log into flower locally at http://localhost:5555. The user and password c
11
13
## Core Components
12
14
13
15
### Collections and URLs
14
-
-**Collections**: Store website-level metadata
15
-
-**DeltaUrl/CuratedUrl**: Store individual URL metadata including full text content and paired field descriptors which will hold classification results
16
+
-**Collection**: Stores website-level metadata
17
+
-**DeltaUrl/CuratedUrl**: Stores individual URL metadata including full text content and paired field descriptors which will hold classification results
16
18
17
19
### Job Structure
18
20
The inference pipeline uses a two-level job system:
@@ -110,3 +112,6 @@ def unload_model():
110
112
- database saving and job sending should be handled at a batch level, so that we can retry batches which failed, without needing to re-run the entire collection
111
113
- database should not allow the creation of a a second InferenceJob if an existing Job exists where InferenceJob(collection=collection,classification_type=classification_type,completed=False)
112
114
- Long-term:Enable tracking of which model version produced which classifications. this should be stored at the level of the paired field
115
+
116
+
## Documentation Todo
117
+
- write about ModelVersion, and how we have active versions. Explain the api_identifier, etc
0 commit comments